Update readme example
This commit is contained in:
parent
f55247f718
commit
9d7df78797
|
@ -12,7 +12,7 @@ class ViewController: UIViewController, SplitflapDataSource, SplitflapDelegate {
|
|||
@IBOutlet weak var splitflap: Splitflap!
|
||||
@IBOutlet weak var actionButton: UIButton!
|
||||
|
||||
private let words = ["Hey you", "Bonsoir", "12h15", "Arrival"]
|
||||
private let words = ["Cat \(String(UnicodeScalar(0x1F63B)))", "Bonsoir", "12h15", "Arrival"]
|
||||
private var currentIndex = 0
|
||||
|
||||
override func viewDidLoad() {
|
||||
|
@ -30,7 +30,7 @@ class ViewController: UIViewController, SplitflapDataSource, SplitflapDelegate {
|
|||
override func viewDidAppear(animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
updateSplitFlapAction(actionButton)
|
||||
//updateSplitFlapAction(actionButton)
|
||||
}
|
||||
|
||||
// MARK: - Action Methods
|
||||
|
@ -50,11 +50,11 @@ class ViewController: UIViewController, SplitflapDataSource, SplitflapDelegate {
|
|||
// MARK: - Splitflap DataSource Methods
|
||||
|
||||
func numberOfFlapsInSplitflap(splitflap: Splitflap) -> Int {
|
||||
return 7
|
||||
return 5
|
||||
}
|
||||
|
||||
func tokensInSplitflap(splitflap: Splitflap) -> [String] {
|
||||
return SplitflapTokens.AlphanumericAndSpace
|
||||
return [" ", "C", "a", "t", String(UnicodeScalar(0x1F63B))] //SplitflapTokens.AlphanumericAndSpace
|
||||
}
|
||||
|
||||
// MARK: - Splitflap Delegate Methods
|
||||
|
@ -65,12 +65,12 @@ class ViewController: UIViewController, SplitflapDataSource, SplitflapDelegate {
|
|||
|
||||
func splitflap(splitflap: Splitflap, builderForFlapAtIndex index: Int) -> FlapViewBuilder {
|
||||
return FlapViewBuilder { builder in
|
||||
builder.backgroundColor = UIColor.blackColor()
|
||||
builder.backgroundColor = UIColor(red: 251/255, green: 249/255, blue: 243/255, alpha: 1)
|
||||
builder.cornerRadius = 5
|
||||
builder.font = UIFont(name: "Courier", size: 50)
|
||||
builder.font = UIFont(name: "Avenir-Black", size:45)
|
||||
builder.textAlignment = .Center
|
||||
builder.textColor = UIColor.whiteColor()
|
||||
builder.lineColor = UIColor.darkGrayColor()
|
||||
builder.textColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5)
|
||||
builder.lineColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.3)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
10
README.md
10
README.md
|
@ -34,6 +34,8 @@ func numberOfFlapsInSplitflap(splitflap: Splitflap) -> Int {
|
|||
|
||||
`Splitflap` allows you to customize each flap individually by providing a `splitflap:builderForFlapAtIndex:` delegate method:
|
||||
|
||||

|
||||
|
||||
```swift
|
||||
let splitflapView = Splitflap(frame: CGRectMake(0, 0, 370, 53))
|
||||
splitflapView.delegate = self
|
||||
|
@ -43,12 +45,12 @@ splitflapView.delegate = self
|
|||
// Configure the appearance for each flaps
|
||||
func splitflap(splitflap: Splitflap, builderForFlapAtIndex index: Int) -> FlapViewBuilder {
|
||||
return FlapViewBuilder { builder in
|
||||
builder.backgroundColor = UIColor.blackColor()
|
||||
builder.backgroundColor = UIColor(red: 251/255, green: 249/255, blue: 243/255, alpha: 1)
|
||||
builder.cornerRadius = 5
|
||||
builder.font = UIFont(name: "Courier", size: 50)
|
||||
builder.font = UIFont(name: "Avenir-Black", size:45)
|
||||
builder.textAlignment = .Center
|
||||
builder.textColor = UIColor.whiteColor()
|
||||
builder.lineColor = UIColor.darkGrayColor()
|
||||
builder.textColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5)
|
||||
builder.lineColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.3)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue