Giter VIP home page Giter VIP logo

mmcardview's Introduction

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)

4.Set Card Height (Defualt is Screen 85%)

card.setCardHeight(height:100)

5.Remove Card

card.removeCard(at index:0)
card.removeSelectCard()  

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, [email protected]

License

MMCardView is available under the MIT license. See the LICENSE file for more info.

mmcardview's People

Contributors

millmany avatar

Watchers

James Cloos avatar NiuJun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.