WeakableSelf alternatives and similar libraries
Based on the "Utility" category.
Alternatively, view WeakableSelf alternatives based on common mentions on social networks and blogs.
-
SwifterSwift
A handy collection of more than 500 native Swift extensions to boost your productivity. -
R.swift
Strong typed, autocompleted resources like images, fonts and segues in Swift projects -
SwiftGen
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs! -
SwiftGen-Storyboard
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs! -
swift-protobuf
Plugin and runtime library for using protobuf with Swift -
Dollar
A functional tool-belt for Swift Language similar to Lo-Dash or Underscore.js in Javascript -
ExSwift
a set of Swift extensions for standard types and classes. -
DifferenceKit
💻 A fast and flexible O(n) difference algorithm framework for Swift collection. -
EZSwiftExtensions
:smirk: How Swift standard types and classes were supposed to work. -
Result
Swift type modelling the success/failure of arbitrary operations. -
DeepDiff
🦀Amazingly incredible extraordinary lightning fast diffing in Swift -
Device
Light weight tool for detecting the current device and screen size written in swift. -
SwiftLinkPreview
It makes a preview from an URL, grabbing all the information such as title, relevant texts and images. -
WhatsNew
Showcase new features after an app update similar to Pages, Numbers and Keynote. -
Codextended
Extensions giving Swift's Codable API type inference super powers 🦸♂️🦹♀️ -
Popsicle
Delightful, extensible Swift value interpolation framework. -
SwiftyJSONAccelerator
macOS app to generate Swift 5 code for models from JSON (with Codeable) -
Playbook
📘A library for isolated developing UI components and automatically taking snapshots of them. -
ReadabilityKit
Preview extractor for news, articles and full-texts in Swift -
ObjectiveKit
Swift-friendly API for a set of powerful Objective C runtime functions. -
Compass
:earth_africa: Compass helps you setup a central navigation system for your application -
Bow
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift -
Solar
A Swift micro library for generating Sunrise and Sunset times. -
Pythonic.swift
Pythonic tool-belt for Swift – a Swift implementation of selected parts of Python standard library. -
SwiftyUtils
All the reusable code that we need in each project -
BetterSafariView
A better way to present a SFSafariViewController or start a ASWebAuthenticationSession in SwiftUI. -
SwiftPlantUML
A command-line tool and Swift Package for generating class diagrams powered by PlantUML
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of WeakableSelf or a related project?
README
WeakableSelf
Context
Closures are one of Swift must-have features, and Swift developers are aware of how tricky they can be when they capture the reference of an external object, especially when this object is self
.
To deal with this issue, developers are required to write additional code, using constructs such as [weak self]
and guard
, and the result looks like the following:
service.call(completion: { [weak self] result in
guard let self = self else { return }
// use weak non-optional `self` to handle `result`
})
Purpose of WeakableSelf
The purpose of this micro-framework is to provide the developer with a helper function weakify
that will allow him to declaratively indicate that he wishes to use a weak non-optional reference to self
in closure, and not worry about how this reference is provided.
Usage
Using this weakify
function, the code above will be transformed into the much more concise:
import WeakableSelf
service.call(completion: weakify { strongSelf, result in
// use weak non-optional `strongSelf` to handle `result`
})
weakify
works with closures that take up to 7 arguments.
Installation
Requirements
- Swift 4.2+
- Xcode 10+
CocoaPods
Add the following to your Podfile
:
pod "WeakableSelf"
Carthage
Add the following to your Cartfile
:
github "vincent-pradeilles/weakable-self"