UIImagePickerController for camera and photo library
Declare var imagePicker = UIImagePickerController()
and conform the delegates UIImagePickerControllerDelegate, UINavigationControllerDelegate
You need to ask the use permission before access the camera, do this by adding usage key Privacy - Camera Usage Description to your app’s Info.plist together with a purpose string.