####1. Framework Dog - for iOS ######-- target 1: Labrador ######-- target 2: GoldenRetriever Target 2 have a custom Swift Compiler Flag: -D FUR (I still don't know what -D mean)
class Dog {
#if FUR
var furLength: Double = 10
####1. Framework Dog - for iOS ######-- target 1: Labrador ######-- target 2: GoldenRetriever Target 2 have a custom Swift Compiler Flag: -D FUR (I still don't know what -D mean)
class Dog {
#if FUR
var furLength: Double = 10
convenience init(rgba: String) { | |
var red: CGFloat = 0.0 | |
var green: CGFloat = 0.0 | |
var blue: CGFloat = 0.0 | |
var alpha: CGFloat = 1.0 | |
let formattedCode = rgba.stringByReplacingOccurrencesOfString("#", withString: "") | |
let formattedCodeLength = count(formattedCode) | |
if formattedCodeLength != 3 && formattedCodeLength != 4 && formattedCodeLength != 6 && formattedCodeLength != 8 { | |
fatalError("invalid color") |
postfix func ++ <T: RawRepresentable, V: FloatingPointType>(lhs: T) -> V { | |
return (lhs.rawValue as! V) + 1 | |
} | |
postfix func -- <T: RawRepresentable, V: FloatingPointType>(lhs: T) -> V { | |
return (lhs.rawValue as! V) - 1 | |
} | |
postfix func ++ <T: RawRepresentable, V: IntegerType>(lhs: T) -> V { | |
return (lhs.rawValue as! V) + 1 |
postfix operator .. { } | |
postfix func ..<T: RawRepresentable> (lhs: T) -> T.RawValue { | |
return lhs.rawValue | |
} |
lazy var timeFormatter: NSNumberFormatter! = { | |
var formatter = NSNumberFormatter() | |
formatter.numberStyle = .NoStyle | |
formatter.groupingSize = 2 | |
formatter.groupingSeparator = ":" | |
formatter.usesGroupingSeparator = true | |
formatter.maximumFractionDigits = 0 | |
formatter.minimumIntegerDigits = 4 | |
formatter.maximumIntegerDigits = 4 | |
return formatter |