extension UIColor {
class func ptm_black() -> UIColor {
return UIColor ( red: 0.0895, green: 0.0895, blue: 0.0895, alpha: 1.0 )
}
class func ptm_grey() -> UIColor {
return UIColor ( red: 0.8115, green: 0.8115, blue: 0.8115, alpha: 1.0 )
}
class func ptm_brown() -> UIColor {
return UIColor ( red: 0.4042, green: 0.2848, blue: 0.2091, alpha: 1.0 )
}
class func ptm_green() -> UIColor {
return UIColor ( red: 0.3137, green: 0.6824, blue: 0.3333, alpha: 1.0 )
}
class func ptm_red() -> UIColor {
return UIColor ( red: 0.9381, green: 0.1339, blue: 0.1453, alpha: 1.0 )
}
class func ptm_gold() -> UIColor {
return UIColor ( red: 0.9457, green: 0.7034, blue: 0.0621, alpha: 1.0 )
}
}
NSMutableAttributedString * seeMore = [[NSMutableAttributedString alloc] initWithString:@"Learn more"];
[seeMore addAttribute: NSLinkAttributeName value: @"http://google.com/" range: NSMakeRange(0, seeMore.length)];
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
...
let userDefaults = NSUserDefaults.standardUserDefaults()
if var numberOfLaunches = userDefaults.objectForKey("numberOfLaunches") as? Int {
numberOfLaunches++
userDefaults.setInteger(numberOfLaunches, forKey: "numberOfLaunches")
} else {
let n = 1
userDefaults.setInteger(n, forKey: "numberOfLaunches")
}
print(userDefaults.objectForKey("numberOfLaunches") as! Int)
return true
}