It doesn't need to implement the UITableViewDataSource or UIColletionViewDataSource inside your view class. It also compatible with XIB contain cells or the programmatically implemented cells.
-No need to Register Cell
-No need Type check for each cell type (no more if / else)
-No need to set reuseIdentifier (Automatically created from your class name)
-No need to set or comfirm DataSource protocols
-Enhanced for MVVM structures
-No need to deal with CollectionFlowLayout
-Both UITableView and UICollectionView supported
-Cand initiate with XIB or programmatically
To run the example project, clone the repo, and run pod install
from the Example directory first.
iOS 9.3+ Xcode 11 Swift 5.0
BEKListKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'BEKListKit'
This is a tableView contains some collectionViews as tableCell. The TableView made in 3 lines of code. and the CollectionView made in just 4 lines.
Download the project and check the example
usage:
Table Configuration:
Set BEKMultiCellTable to the table's class.
@IBOutlet weak var tableView: BEKMultiCellTable!
TableCell Configuration: Make your custom cell confirms the BEKBindableCell protocol.
extension MyCustomCell: BEKBindableCell {
typealias ViewModeltype = NewContactViewModel
func bindData(withViewModel viewModel: NewContactViewModel) {
titleLabel.text = viewModel.nameText
profileImage.image = viewModel.profileImage
newProfileImage.image = viewModel.extraImage
}
}
Create and push BEKGenericCell:
Create a BEKGenericCell with a UITableViewCell base Class and pass it's viewModel.
tableView.push(cell: BEKGenericCell.Table<MyCustomCell>(viewModel: viewModel))
Or a BEKGenericCell with a UICollectionViewCell base Class and pass it's viewModel.
tableView.push(cell: BEKGenericCell.Collection<MyCustomCell>(viewModel: viewModel))
CollectionLayout Composer:
Use BEKCollectionLayoutComposer to set layout to your collectionView.
collectionView.collectionViewLayout = BEKCollectionLayoutComposer.makeLayout(ForItemSize: bounds.size, scrollDirection: .horizontal)
pod 'BEKListKit'
Behrad Kazemi, Behradkzm@gmail.com, bekapps.com Visit Web Site
BEKCurveTabbar is available under the MIT license. See the LICENSE file for more info.