Lazy instantiating a UIDynamicAnimator with referenceView - Swift
问题 I'm trying to lazy instantiate a UIDynamicAnimator in my code. I want to initialise it with an UIView as an IBOutlet I have. class ViewController: UIViewController { @IBOutlet var gameView : UIView @lazy var animator = UIDynamicAnimator(referenceView: gameView) ... I'm assuming this isn't working because the UIView isn't yet created because the animator property throws back an error saying it can't find the gameView. How can I get around this? 回答1: In the session video "Building Interruptible