Here is my code:
import UIKit
import RxSwift
import RxCocoa
import RxOptional
class ViewController: UIViewController {
@IBOutlet weak var collectionView: UICollectionView!
let disposeBag = DisposeBag()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let items = Observable.just(
(0..<20).map{ "Test \($0)" }
)
items.asObservable().bindTo(self.collectionView.rx.items(cellIdentifier: CustomCollectionViewCell.reuseIdentifier, cellType: CustomCollectionViewCell.self)) { row, data, cell in
cell.data = data
}.addDisposableTo(disposeBag)
}
}
So how to show 3 columns in 1 row.
I can't find any tutorial about collection view with RxSwift.
Something like this: