-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Storyboard and code at the same time
- Loading branch information
Showing
11 changed files
with
220 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// DetailsViewController.swift | ||
// WOWCardStackView | ||
// | ||
// Created by Zhou Hao on 17/3/17. | ||
// Copyright © 2017 CocoaPods. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import WOWCardStackView | ||
|
||
class DetailsViewController: UIViewController, CardStackViewDataSource { | ||
|
||
@IBOutlet weak var cardStackView: CardStackView! | ||
var id: Int! | ||
var orderNo: Int = 5 | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
self.title = "\(id!)" | ||
|
||
cardStackView.register(nib: UINib(nibName: "MyCard", bundle: nil)) | ||
cardStackView.dataSource = self | ||
|
||
} | ||
|
||
func nextCard(in: CardStackView) -> CardView? { | ||
let card = cardStackView.dequeueCardView() as! MyCard | ||
card.numberLabel.text = "\(orderNo)" | ||
orderNo += 1 | ||
return card | ||
} | ||
|
||
func cardStackView(_ cardStackView: CardStackView, cardAt index: Int) -> CardView { | ||
let card = cardStackView.dequeueCardView() as! MyCard | ||
card.numberLabel.text = "\(index)" | ||
return card | ||
} | ||
|
||
func numOfCardInStackView(_ cardStackView: CardStackView) -> Int { | ||
return 5 | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.