Swiftpack.co - krzysztofzablocki/Strongify as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by krzysztofzablocki.
krzysztofzablocki/Strongify 1.3
Strongify is a 1-file µframework providing a nicer API for avoiding weak-strong dance.
⭐️ 444
🕓 2 years ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/krzysztofzablocki/Strongify.git", from: "1.3")

Strongify

1-file µframework that gets rid of weak-strong dancing in Swift.

Basically allows you to go from this:

target.closure = { [weak self, weak other] some, arguments in 
    guard let strongSelf = self, let strongOther = other else { return }
    /// ... code
}

To this:

target.closure = strongify(weak: self, other) { strongSelf, strongOther, some, arguments in
    /// ... code
}

Read more

Installation

Swift Package Manager

Add .Package(url: "https://github.com/krzysztofzablocki/Strongify.git", majorVersion: 1) to your Package.swift file's dependencies.

CocoaPods

Add pod 'Strongify' to your Podfile.

Carthage

Add github "krzysztofzablocki/Strongify" to your Cartfile.

License

Strongify is available under the MIT license. See LICENSE for more information.

Attributions

I've used SwiftPlate to generate xcodeproj compatible with SPM, CocoaPods and Carthage.

GitHub

link
Stars: 444
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

1.3
2 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics