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) -> Void
Parameters
imagePickerInfo
the result of the image picking from
UIImagePickerController
.authorizationStatus
the current authorization status. See
PHAuthorizationStatus
.removed
true, 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
title
a title of the action sheet to select the source of the image.
message
a message of the action sheet to select the source of the image.
removeTitle
an optional title to add a button to the action sheet to perform the removing the the image.
popoverSetup
an additional setup of
UIAlertController
for proper presenting of it on different devices.completion
a completion block with the picking/removing action result.