changjiashuai's blog

Runnig...

The future belongs to those who believe in the beauty of their dreams.


Swift基础---类型别名

如何定义

typealias AudioSample = UInt16

var maxAmplitudeFound = AudioSample.min    //0
最近的文章

Swift基础---Assertions

let age = -3assert(age >=0, "A person's age cannot be less than zero")// this causes the assertion to trigger, because age is not >= 0…

继续阅读
更早的文章

Swift基础---Tuples

声明let http404Error = (404, "Not Found")// http404Error is of type (Int, String),// and equals (404, "Not Found") 使用let (statusCode, statusMessage) = http404Errorprintln("The status code is \(statusCode)")// prints "The status code is 404"printl...…

继续阅读