Changes

Jump to: navigation, search

An Example iOS 9 Camera Application

20 bytes removed, 20:34, 1 February 2016
m
Text replacement - "<google>BUY_IOS9</google>" to "<htmlet>ios9</htmlet>"
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
In terms of Auto Layout constraints, begin by selecting the toolbar view and clicking on the Pin menu in the toolbar located in the lower right hand corner of the storyboard canvas and establish Spacing to nearest neighbor constraints on the bottom and two side edges of the view with the Constrain to margins option switched off.
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
Next, select the Image View object and, once again using the Pin menu, establish Spacing to nearest neighbor constraints on all four sides of the view, this time with the Constrain to margins option enabled.
}
</pre>
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
The useCameraRoll method is remarkably similar to the previous method with the exception that the source of the image is declared to be UIImagePickerControllerSourceType.PhotoLibrary and the newMedia flag is set to false (since the photo is already in the library we don’t need to save it again):
}
</pre>
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
The code in this delegate method dismisses the image picker view and identifies the type of media passed from the image picker controller. If it is an image it is displayed on the view image object of the user interface. If this is a new image it is saved to the camera roll. The finishedSavingWithError method is configured to be called when the save operation is complete. If an error occurred it is reported to the user via an alert box.
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>

Navigation menu