ACKReactiveExtensions is set of useful extensions for ReactiveCocoa you could use in your apps.
Currently we have extensions for
If you'd love to have more extensions available just open an issue or even better create a pull request!
ACKReactiveExtensions is available through CocoaPods. Simply add the following line to your Podfile:
- Xcode 8.x
- Swift 3.x
- iOS 8.3 and newer
For Swift 2.x compatible version use ACKReactiveExtensions in 1.2.x version.
pod "ACKReactiveExtensions" you will get only general and UIKit extensions but there are also subspecs you can like/need.
pod 'ACKReactiveExtensions/AlamofireImage' pod 'ACKReactiveExtensions/Argo' pod 'ACKReactiveExtensions/Marshal' pod 'ACKReactiveExtensions/Reachability' pod 'ACKReactiveExtensions/Realm' pod 'ACKReactiveExtensions/SDWebImage' pod 'ACKReactiveExtensions/WebKit'
These subspecs mostly require aditional dependencies (as Argo or Reachability) and you could not need it for your project. That's why it is separated to subspecs.
Usage is really simple, ACKReactiveExtensions contains just more extensions for ReactiveSwift's
Reactive struct so it can be used on more objects.
let imageURL: Property<URL> = ... let imageView = UIImageView() imageView.reactive.imageURL <~ imageURL
ACKReactiveExtensions contains reactive mapping extensions for following libraries. See their page for more information.
In general we are against mapping objects on main thread (and you should be too), but you know, you only live once so we still give you the opportunity to do so. By default our mapping extensions allow this behavior but if you want to restrict that, you can do that by setting a configuration variable.
ACKReactiveExtensionsConfiguration.allowMappingOnMainThread = false
From now on the mapping extensions will expect to be called on background thread, but don't worry, we use asserts so your production users are safe from crashing if somehow things don't go as good as expected.
UITextField/UITextView two way binding
ACKReactiveExtensions contains special
<~> two way binding operator which will create binding between
MutableProperty and your
Until now all those bindings looked like this
let textProperty: MutableProperty<String?> ... let textField: UITextField ... textField.reactive.text <~ textProperty textProperty <~ textField.reactive.continousTextValues
From now on you can use the
textProperty <~> textField
<~> operator is commutative so the order of operands doesn't matter.
ACKategories is available under the MIT license. See the LICENSE file for more info.
You may find interesting
5.2.0 - 2020-09-08 13:01:01
SwiftPM & Realm 5 - 2020-07-17 12:01:22
- add SwiftPM support (#47, kudos to @olejnjak)
~> 5.0(#47, kudos to @olejnjak)
- 2019-06-26 10:41:44
RealmCollectionbug in case when Realm data is modified before it sends initial change notification (#43, kudos to @olejnjak)
- 2019-05-02 12:47:12
- update ReactiveSwift & ReactiveCocoa, use native Result (#41, kudos to @olejnjak)
- deprecate extensions which are available using Swift typed keypaths #40 (#42, kudos to @olejnjak)
Deprecated extensions will be removed in next release
Swift 5 & Xcode 10.2 - 2019-03-28 15:35:25
- migrate to Xcode 10.2 and Swift 5 (#39, kudos to @olejnjak)
Dependencies fix - 2019-01-11 14:26:32
- fix dependencies to keep library compileable
App extension API only - 2018-10-15 17:53:28
- allow app extension API only (#36, kudos to @olejnjak)
Swift 4.2 & Xcode 10 - 2018-09-20 07:20:43
This is the first version that requires Xcode 10 and Swift 4.2+.
- 2018-09-19 20:32:49
tableView.reactive.tableFooterView(#28, kudos to @olejnjak)
caLayer.reactive.cornerRadius(#30, kudos to @olejnjak)
imageView.reactive.imageSignal(#30, kudos to @olejnjak)
view.reactive.frame(#30, kudos to @olejnjak)
view.reactive.bounds(#30, kudos to @olejnjak)
NOTE: This is the last release that supports Xcode 9.x
Fix ambiguities - 2018-08-29 11:55:56
UINavigationItemExtensionsambiguity with new extensions from ReactiveCocoa (#29, kudos to @tommhol)
3.4.2 - 2018-07-31 11:38:01
signal.merge(with:)as it is ambigous in ReactiveSwift 4.0 (#26, kudos to @olejnjak)
producer.merge(with:)as it is amibous in ReactiveSwift 4.0 (#27, kudos to @olejnjak
3.4.0 - 2018-07-30 23:41:50
- update ReactiveCocoa to 8.0 (kudos to @olejnjak)
3.3.1 - 2018-07-20 13:03:25
action.run()so now it is disposed when outer producer is disposed (#25, kudos to @olejnjak)
- add missing subproject to README (#24, kudos to @LukasHromadnik)
3.3.0 - 2018-07-05 00:32:36
- new extensions for AlamofireImage (#19, kudos to @olejnjak)
- new extensions for
UITableView(#18, kudos to @olejnjak)
- new extensions for
UIView(#18, #21, kudos to @olejnjak)
- new extensions for
UIViewController(#21, kudos to @olejnjak)
- new helper for merging
Signals (#20 kudos to @josefdolezal)
Action.run()extension so it now reflects
disabledstate (#22, #23, kudos to @olejnjak)
3.2.1 - 2018-05-02 23:25:41
Carthage fixes - 2018-03-22 18:22:51
Old prebuilt framework was corrupt for App Store submit, this one is OK.
Threading fixes - 2018-02-04 01:09:41
Fix Textfield binding so it doesn't access
text property on incorrect thread.
Patches - 2018-01-03 20:31:19
- fix textfield binding
Carthage support - 2017-12-28 16:27:04
- add support for Carthage
- move from Reachability to Reachability.swift as old one doesn't fully support Carthage
Swift 4 support - 2017-11-22 12:18:14
No mapping on main thread? - 2017-05-25 12:02:10
Now you can make sure your Argo and Marshal mappings are performed on background thread! But if you don't want to dont worry and see README. 😎
We also added some new extensions for
Mapping extensions - 2017-04-12 13:12:18
New Realm extensions - 2017-03-08 11:05:36
With this release we support Realm (thanks to @tkohout)! Stay tuned for more great stuff!
Swift 2.3 release - 2017-03-08 11:04:21
This version is the last that supports Swift 2.3