Group Group Group Group Group Group Group Group Group

raywenderlich.com Forums

Video Tutorial: iOS 101 Part 10: Cameras and Pickers

Learn how to use UIImagePickerController to integrate a device's camera or photo gallery into your iOS app.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3716-ios-101-with-swift-2/lessons/11

Hello,

I don’t understand this line

picker.delegate = self

what does it do?

Thanks!

What this piece of code does is simply inform the picker object that the current class will handle any delegate events. Your object creates the picker, then tells the picker that it will respond to any picker events. You could alternatively create an entirely different object to respond to picker events as well.

I hope that helps!

1 Like