[FIX] flap animation continue when new text is set #2

This commit is contained in:
Yannick Loriot 2015-12-14 19:48:55 +01:00
parent 427356d014
commit b75379d7de
4 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,8 @@
language: objective-c
osx_image: xcode7.1
branches:
only:
- master
env:
matrix:
- DESTINATION="OS=9.1,name=iPad 2"

View File

@ -159,10 +159,14 @@ final class FlapView: UIView {
topAnim.duration = rotationDuration / 4 * 3
bottomAnim.duration = rotationDuration / 4
let animating = targetToken != nil
targetToken = sanitizedToken
targetCompletionBlock = completionBlock
displayNextToken()
if !animating {
displayNextToken()
}
}
else {
tokenGenerator.currentElement = sanitizedToken

View File

@ -47,7 +47,7 @@ import UIKit
/**
The delegate for the split-flap view.
The data source must adopt the SplitflapDelegate protocol and implement the
The delegate must adopt the SplitflapDelegate protocol and implement the
required methods to specify the flap rotation for example.
*/
public weak var delegate: SplitflapDelegate?

View File

@ -36,7 +36,7 @@ import Foundation
*/
public class SplitflapTokens {
/// Numeric characters.
public static let Numeric = "0123456789".characters.map { String($0) }
public static let Numeric = (0 ... 9).map { String($0) }
/// Alphabetic characters (lower and upper cases).
public static let Alphabetic = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".characters.map { String($0) }