Skip to content

MxIris-Library-Forks/RxNSCollectionView

 
 

Repository files navigation

RxNSCollectionView

What's this

RxSwift + NSCollectionView

Why RxCocoa doesn't support NSCollectionView like UICollectionView? It's very inconvenient for me! You too right? Then I developed it from copy of some guy's codes.

Usage

// Your subclass of NSViewController with NSCollectionView

let itemType = CollectionViewItem.self
collectionView.register(itemType: itemType)

output.items
	.bind(to: collectionView.rx.items(itemType))
	.disposed(by: disposeBag)
// Your subclass of NSCollectionViewItem

extension CollectionViewItem: NibLoadable, Reusable {}

extension CollectionViewItem: Configurable {

	func configure(with model: ItemModel) {
		let input: Input = model
		let output: Output = model

		disposeBag = DisposeBag()

		downloadButton.rx.tap
			.bind(to: input.downloadClick)
			.disposed(by: disposeBag)

		output.name
			.bind(to: nameLabel.rx.text)
			.disposed(by: disposeBag)

		output.version
			.bind(to: versionLabel.rx.text)
			.disposed(by: disposeBag)
	}
}

Installation

pod 'RxNSCollectionView'

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 96.2%
  • Ruby 2.4%
  • Objective-C 1.4%