MMCardView:类似 Wallet 应用的卡片式动效设计及演示

1,497 阅读1分钟
原文链接: github.com

MMCardView

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Demo

demo

Requirements

iOS 8.0+
Xcode 8.0+
Swift 3.0+

Use

1.Register your CollectionView Cell and Datasource

card.cardDataSource = self
card.registerCardCell(c: CardACell.classForCoder(), nib: UINib.init(nibName: "CardACell", bundle: nil))

2.Set your data use

card.set(cards: arr)

3.Create your Cell inherit "CardCell" and implement "CardCellProtocol"

class CardACell: CardCell,CardCellProtocol {

   // Set your Cell Identifier
   public static func cellIdentifier() -> String {
        return "CardA"
    }
}

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
}

Style

 public enum SequenceStyle:Int {
   case normal
   case cover
 }

Filter

1.Hide you dont want to show use function

card.filterAllDataWith(isInclued: { (idex, obj) -> Bool in
     return (obj as! String) == "CardA"
})

2.Show All Data

card.showAllData()

Other

1.BottomCount when Expand

card.expandBottomCount(count:Int)

2.Flip ViewController

card.presentViewController(to: vc)

3.Set show height for every cell (Default is 56.0)

card.setCardTitleHeight(heihgt: 56)

Installation

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, millmanyang@gmail.com

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.