A simple card collection view for iOS, works like UITableView.
DeckView follows Apple convention for data-driven views by providing DataSource
& Delegate
protocols. And the CardView is reusable like UITableViewCell.
public protocol DeckViewDataSource: class {
func numberOfCardInDeckView(deckView: DeckView) -> Int
func deckView(deckView: DeckView, cardViewAt index: Int) -> CardView
}
public protocol DeckViewDelegate: class {
func deckView(deckView: DeckView, didSelectAt index: Int)
}
public func reloadData()
public func register(type cardClass: AnyClass?)
public func dequeueCardView(for index: Int) -> CardView
public func fadeOut(with animation: (cardView: CardView, completion: () -> Void) -> Void)
Swift 2.0, iOS 8.0
It's recommended to use CocoaPods.
CocoaPods is a dependency manager for Cocoa projects.
CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command:
$ [sudo] gem install cocoapods
To integrate DeckView into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'DeckView'
Then, run the following command:
$ pod install
You should open the {Project}.xcworkspace
instead of the {Project}.xcodeproj
after you installed anything from CocoaPods.
For more information about how to use CocoaPods, I suggest this tutorial.
DeckView is available under the [MIT License][mitLink] license. See the LICENSE file for more info. [mitLink]:http://opensource.org/licenses/MIT