CombineX.Cocoa(中文)
This library is still in beta, so do not use it in production!
🐱
Like ReactiveCocoa and ReaciveSwift, RxCocoa and RxSwift, CXCocoa is a derivative of CombineX. It provides Combine extensions to Cocoa Framework, making it easier to write Cocoa-related asynchronous code.
It includes but is not limited to:
- MethodPublisher/DeallocatePublisher, intercepting method calls with method swizzle
- KVOPublisher, observing property changes through the KVO mechanism
- DelegateProxy, forwarding delegate message
- UIKit extensions(binder & property), subscribing control event and binding values
- UIScheduler
- ...
You can freely switch the underlying dependency between CombineX
and Combine
.
pod 'CXCocoa', :git => 'https://github.com/cx-org/CXCocoa.git', :branch => 'master'
github "cx-org/CXCocoa" "master"
Check here.
Welcome! Any kind of contribution is welcome at any time!!!
You can:
- Add more control extensions, especially for macOS controls.
- Add documentation.
- Make your suggestions.
- Star! Then tell your friends!
Because the upstream CombineX is still in beta, if you encounter a strange problem in this library - then it may drift from upstream. 🤣
You can change the underlying dependency to Combine
by passing USE_COMBINE
to the target's build configurations. For example, if you are using CocoaPods, you can modify your podfile like below:
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'CXExtensions'
target.build_configurations.each do |config|
config.build_settings['OTHER_SWIFT_FLAGS'] = '-DUSE_COMBINE'
end
end
end
end
If you are using Carthage, you should be able to use XCODE_XCCONFIG_FILE
to do that.
The implementation of the library references both ReactiveCocoa and RxCocoa, especially ReactiveCocoa, the ObjC part is almost completely modified from its source code, really appreciate to their great work!