ImagePickerPresenter
open class ImagePickerPresenter : NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate
A wrapper class setting up the presentation of an UIImagePickerController
by a designated view controller. This wrapper class only accepts media types of image or movie.
-
An enum representing the media types the
See moreImagePickerPresenter
will access.Declaration
Swift
public enum MediaType
-
Returns a newly initialized image picker presenter with the view controller presenting the image picker and the image picker presenter delegate.
Declaration
Swift
public init(presentingViewController: UIViewController, delegate: ImagePickerPresenterDelegate? = nil)
Parameters
presentingViewController
The view controller presenting the image picker.
delegate
The delegate object to associate with the image picker presenter.
Return Value
The initialized image picker presenter.
-
Presents the image picker using the presenting view controller with the specified media type.
Declaration
Swift
open func present(with mediaType: MediaType = .image, editable: Bool = false)
Parameters
mediaType
The media type to be accessed by the image picker. This is set by image media type by default.
editable
The Boolean property to indicate if the photo can be edited. The default value is set to false.
-
Undocumented
Declaration
Swift
public func imagePickerControllerDidCancel(_ picker: UIImagePickerController)
-
Undocumented
Declaration
Swift
public func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any])