MMCardView
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
IOS 8.0+ Xcode 8.0+ Swift 3.0+Copy the code
1.Register your CollectionView Cell and Datasource
card.cardDataSource = self
card.registerCardCell(c: CardACell.classForCoder(), nib: UINib.init(nibName: "CardACell", bundle: nil))
Copy the code
2.Set your data use
card.set(cards: arr)
Copy the code
3.Create your Cell inherit “CardCell” and implement “CardCellProtocol”
class CardACell: CardCell,CardCellProtocol {
// Set your Cell Identifier
public static func cellIdentifier() -> String {
return "CardA"
}
}
Copy the code
4.Handle Datasource
item : What you put in Step 2
func cardView(collectionView:UICollectionView,item:AnyObject,indexPath:IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: item as! String, for: indexPath )
return cell
}
Copy the code
Style
public enum SequenceStyle:Int {
case normal
case cover
}
Copy the code
1.Hide you dont want to show use function
card.filterAllDataWith(isInclued: { (idex, obj) -> Bool in
return (obj as! String) == "CardA"
})
Copy the code
2.Show All Data
card.showAllData()
Copy the code
Other
1.BottomCount when Expand
card.expandBottomCount(count:Int)
Copy the code
2.Flip ViewController
card.presentViewController(to: vc)
Copy the code
3.Set show height for every cell (Default is 56.0)
card.setCardTitleHeight(heihgt: 56)
Copy the code
MMCardView is available through CocoaPods. To install it, simply add the following line to your Podfile:
Swift 3 pod 'MMCardView Swift2.3 pod' MMCardView ': git = >' https://github.com/MillmanY/MMCardView ': branch = >' Swift2 '
Author
Millman, [email protected]
License
MMCardView is available under the MIT license. See the LICENSE file for more info.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.