UIViewController
extension UIViewController
-
Presents the image gallery with a given image URL’s.
Declaration
Swift
public func showImageGallery(with imageURLs: [URL]?, animated: Bool = true) -
Presents the Open Graph data in a
WebViewController.Declaration
Swift
public func showOpenGraphData(with ogData: OGResponse?, animated: Bool = true)
-
Hides the back button title from the navigation bar.
Declaration
Swift
public func hideBackButtonTitle()
-
Adds a child view controller to a given container view or to the self view.
Declaration
Swift
public func add(viewController: UIViewController, to containerView: UIView? = nil) -
Removes a child view controller.
Declaration
Swift
public func remove(viewController: UIViewController) -
Replaces a child view controller with a new one.
Declaration
Swift
public func replace(viewController: UIViewController, with newViewController: UIViewController)
-
Return true if the view controller was presented modally.
Declaration
Swift
public var isModal: Bool { get }
-
Performs the segue with an identifier like the view controller class name.
Declaration
Swift
public func performSegue(show type: UIViewController.Type, sender: Any?)
-
Undocumented
Declaration
Swift
func showErrorAlertIfNeeded(_ error: Error?) -
Undocumented
Declaration
Swift
func showErrorAlert(_ error: Error, function: String = #function, line: Int = #line) -
A completion block of an image picking.
Declaration
Swift
public typealias ImagePickerCompletion = (_ imagePickerInfo: [UIImagePickerController.InfoKey : Any], _ authorizationStatus: PHAuthorizationStatus, _ removed: Bool) -> VoidParameters
imagePickerInfothe result of the image picking from
UIImagePickerController.authorizationStatusthe current authorization status. See
PHAuthorizationStatus.removedtrue, if the user select the remove button from the action sheet of the source of the image.
-
Pick an image.
Declaration
Swift
public func pickImage(title: String? = "Add a photo", message: String? = "Select a photo source", removeTitle: String? = nil, popoverSetup: ((_ alert: UIAlertController) -> Void)? = nil, completion: @escaping ImagePickerCompletion)Parameters
titlea title of the action sheet to select the source of the image.
messagea message of the action sheet to select the source of the image.
removeTitlean optional title to add a button to the action sheet to perform the removing the the image.
popoverSetupan additional setup of
UIAlertControllerfor proper presenting of it on different devices.completiona completion block with the picking/removing action result.
View on GitHub
UIViewController Extension Reference