[ADD] TwelveHourClock, TwentyFourHourClock and MinuteAndSecond tokens

This commit is contained in:
Yannick Loriot 2015-11-20 10:30:55 +01:00
parent 0e77d6984d
commit 241c8f73b4
3 changed files with 16 additions and 5 deletions

View File

@ -1,6 +1,6 @@
![Splitflap](http://yannickloriot.com/resources/splitflap-logo.gif)
[![Supported Platforms](https://cocoapod-badges.herokuapp.com/p/Splitflap/badge.svg)](http://cocoadocs.org/docsets/Splitflap/) [![Version](https://cocoapod-badges.herokuapp.com/v/Splitflap/badge.svg)](http://cocoadocs.org/docsets/Splitflap/) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.org/yannickl/Splitflap.svg?branch=master)](https://travis-ci.org/yannickl/Splitflap) [![codecov.io](http://codecov.io/github/yannickl/Splitflap/coverage.svg?branch=master)](http://codecov.io/github/yannickl/Splitflap?branch=master)
[![License](https://cocoapod-badges.herokuapp.com/l/Splitflap/badge.svg)](http://cocoadocs.org/docsets/Splitflap/) [![Supported Platforms](https://cocoapod-badges.herokuapp.com/p/Splitflap/badge.svg)](http://cocoadocs.org/docsets/Splitflap/) [![Version](https://cocoapod-badges.herokuapp.com/v/Splitflap/badge.svg)](http://cocoadocs.org/docsets/Splitflap/) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.org/yannickl/Splitflap.svg?branch=master)](https://travis-ci.org/yannickl/Splitflap) [![codecov.io](http://codecov.io/github/yannickl/Splitflap/coverage.svg?branch=master)](http://codecov.io/github/yannickl/Splitflap?branch=master)
Splitflap is a simple to use component to present changeable alphanumeric text like often used as a public transport timetable in airports or railway stations or with some flip clocks.

View File

@ -33,6 +33,8 @@ import UIKit
take a look at https://github.com/ochococo/Design-Patterns-In-Swift#-builder)
*/
public final class FlapViewBuilder {
// MARK: - Customizing Flaps
/**
The builder block.

View File

@ -35,15 +35,24 @@ import Foundation
it needs to animate its token change.
*/
public class SplitflapTokens {
/// Combination of numeric characters.
/// Numeric characters.
public static let Numeric = "0123456789".characters.map { String($0) }
/// Combination of alphabetic characters.
/// Alphabetic characters (lower and upper cases).
public static let Alphabetic = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".characters.map { String($0) }
/// Combination of alphabetic and numeric characters.
/// Combination of alphabetic (lower and upper cases) and numeric characters.
public static let Alphanumeric = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".characters.map { String($0) }
/// Combination of alphabetic and numeric characters plus the space.
/// Combination of alphabetic (lower and upper cases) and numeric characters plus the space.
public static let AlphanumericAndSpace = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".characters.map { String($0) }
/// The 12-hour clock characters (from 1 to 12).
public static let TwelveHourClock = (1 ... 12).map { String($0) }
/// The 24-hour clock characters (from 00 to 23).
public static let TwentyFourHourClock = (0 ... 23).map { String(format:"%02d", $0) }
/// The minute/second characters (from 00 to 59).
public static let MinuteAndSecond = (0 ... 59).map { String(format:"%02d", $0) }
}