Skip to content

Instantly share code, notes, and snippets.

@claymcleod
Last active August 29, 2015 14:15
Show Gist options
  • Save claymcleod/d66f08c06918cee065be to your computer and use it in GitHub Desktop.
Save claymcleod/d66f08c06918cee065be to your computer and use it in GitHub Desktop.
// Title: Lazy Initialization of Swift Variables
// Authors: Clay McLeod
// Description: An example of how to create a variable using lazy initialization
// in the Swift programming language.
// Section: Swift
// Subsection: Variables
import UIKit
lazy var _animator : UIDynamicAnimator! = {
[unowned self] in
return UIDynamicAnimator(referenceView: self.view)
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment