Skip to content

Instantly share code, notes, and snippets.

View experion-tibin's full-sized avatar

Tibin Thomas experion-tibin

  • Experion Technologies
View GitHub Profile
@rpassis
rpassis / ImagePickerHandler.swift
Last active August 27, 2019 10:40
Protocol and extension for handling the presentation of image picker controllers and selection of media
// Since we are unable to extend ObjC protocols in swift, we wrap this around a custom NSObject subclass
// that deals exclusive with handling the image picker delegate methods and chaining the response down to
// the MediaPickerPresenter conforming delegate
class ImagePickerHandler: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
var delegate: MediaPickerPresenter?
let sourceType: UIImagePickerControllerSourceType
let picker = UIImagePickerController()