func staticInsideFunction() {
    struct Temp { static var hasAnimated = false }
    if Temp.hasAnimated == false {
        // ... do something only on the first function call.
        Temp.hasAnimated = true
    } else {
        // ... do something on all subsequent function calls.
    }
}
func dateFormatterExample() {
    struct Temp {
        static let dateFormatter: NSDateFormatter = {
            let formatter = NSDateFormatter()
            formatter.dateFormat = "EEE, d MMM yyyy HH:mm:ss zzz"
            return formatter
            }()
    }

    let currentDate = NSDate()
    let dateString = Temp.dateFormatter.stringFromDate(currentDate)
    println("Date: \(currentDate)")
    println("Date string: \(dateString)")
}