Skip to content
Combine & CombineX extensions for Cocoa
Swift Ruby Objective-C
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CXCocoa.xcodeproj rename ControlPropertyBinder to ControlProperty Sep 19, 2019
CXCocoa.xcworkspace rename Sep 7, 2019
Demo update deps Sep 11, 2019
Pods sync deps's changes Sep 11, 2019
Sources rename ControlPropertyBinder to ControlProperty Sep 19, 2019
.gitignore add .swiftpm to gitignore Sep 9, 2019
CXCocoa.podspec init macos support Sep 19, 2019
Cartfile carthage deps Sep 11, 2019
LICENSE init Aug 19, 2019
Podfile add CXCompatible Sep 8, 2019
Podfile.lock sync deps's changes Sep 11, 2019
README.md update discord invite link Sep 11, 2019
README.zh_cn.md update discord invite link Sep 11, 2019
demo.1.gif improve demo Aug 22, 2019
demo.2.gif improve demo Aug 22, 2019

README.md

CombineX.Cocoa(中文)

release install platform license dicord

Notice

This library is still in beta, so do not use it in production!

🐱

What is CXCocoa

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.

Demo

Install

CocoaPods

pod 'CXCocoa', :git => 'https://github.com/cx-org/CXCocoa.git', :branch => 'master'

Carthage

github "cx-org/CXCocoa" "master"

What is Combine/CombineX

Check here.

Contribution

Welcome! Any kind of contribution is welcome at any time!!!

You can:

  1. Add more control extensions, especially for macOS controls.
  2. Add documentation.
  3. Make your suggestions.
  4. 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. 🤣

Use with Combine

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.

Acknowledgement

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!

You can’t perform that action at this time.