Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @IBAction func addToken(sender: AnyObject) {
- let title = names[Int(arc4random_uniform(UInt32(names.count)))] as String
- let token = KSToken(title: title, object: title as AnyObject?)
- // Token background color
- var red = CGFloat(Float(arc4random()) / Float(UINT32_MAX))
- var green = CGFloat(Float(arc4random()) / Float(UINT32_MAX))
- var blue = CGFloat(Float(arc4random()) / Float(UINT32_MAX))
- token.tokenBackgroundColor = UIColor(red: red, green: green, blue: blue, alpha: 1.0)
- // Token text color
- red = CGFloat(Float(arc4random()) / Float(UINT32_MAX))
- green = CGFloat(Float(arc4random()) / Float(UINT32_MAX))
- blue = CGFloat(Float(arc4random()) / Float(UINT32_MAX))
- token.tokenTextColor = UIColor(red: red, green: green, blue: blue, alpha: 1.0)
- tokenView.addToken(token)
- }
- /// An array of string values. Default values are "." and ",". Token is created with typed text, when user press any of the character mentioned in this Array
- open var tokenizingCharacters = [".", ","]
- tokenView.tokenizingCharacters = [];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement