Changes

Jump to: navigation, search

An iOS 9 UIKit Dynamics Tutorial

20 bytes removed, 20:34, 1 February 2016
m
Text replacement - "<google>BUY_IOS9</google>" to "<htmlet>ios9</htmlet>"
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
var animator: UIDynamicAnimator?
</pre>
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
Next, modify the viewDidLoad method within the ViewController.swift file once again to add code to create and initialize the instance, noting that the top level view of the view controller is passed through as the reference view:
}
</pre>
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
Compile and run the application once again. Note that after launching, the gravity behavior causes the views to fall from the top of the reference view and out of view at the bottom of the device display. In order to keep the views within the bounds of the reference view, it is necessary to set up a collision behavior.
Figure 66-2
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
Release the touch and note that gravity causes the blue box to fall once again and settle at the bottom edge of the reference view.
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>

Navigation menu