CombineCocoa
CombineCocoa copied to clipboard
FeatureRequest: Add handlers for selectors
Feature request
In ReactiveCocoa there is an ability to subscribe to object selector's trigger like
navigationController?.reactive
.trigger(for: #selector(UINavigationController.popViewController))
.producer.observe(on: UIScheduler()).startWithValues { ... }
I think this feature is very useful and it would be great if Combine had this ability too 🙏
Btw I implemented it here (took ReactiveCocoa/ReactiveSwift as a reference), but I changed indentation and added macOS support (not features adoption, but an ability to build), removed carthage & cocoapods support and updated readme a bit, so I don't think the PR is useful, and if you interested, you can adopt this feature manually or tell me to create a PR anyway 🙂
Example:
navigationController?.publisher(for: #selector(UINavigationController.popViewController))
@maximkrouk This is BRILLIANT!!! Just what I need to finally completely remove RxSwift from my project. Do you mind to make a PR? It's a bit old, do you need any help updating it for usage?
Hello @viewDidAppear, I just extracted this logic to combine-interception package, it should be compatible with CombineExt/CombineCocoa
Oh @maximkrouk Thanks! I didn't see this so I prepared a PR of my own, with a fork against current master. Let me see if I can use your package instead 🤩