From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Make a camera on iPad

Make a camera on iPad

- [Instructor] One cool feature in iOS 11 Swift Playground for iPad is the use of the camera. There're several ways of accessing the camera, from the complex but powerful AV foundation to the much simpler UIImagePicker. Let me show ya how to quickly add a camera to an iPad Playground using the UIImagePicker. If you've never used it before, be aware you can also do this same code on an Xcode project, too. Open up the example file, like I've done here. I've included the basic code for a view controller, a view to display the photo, and added a button with an action to shoot a photo. I'll first add an ImagePickerController to the code. In my decorations I'll do a let picker equal UIImagePickerController. This is heavily dependent on delegates; you'll need two of them, and you're going to need to add them to the class. I'm actually going to go up top here, and since it's really hard to get that UIViewController, I'm going to delete brace, then put in my two delegates; the first one is the…

Contents