UIViewController

extension UIViewController

Back Button

  • Hides the back button title from the navigation bar.

    Declaration

    Swift

    public func hideBackButtonTitle()

Child View Controllers

  • 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)

Modal

  • Return true if the view controller was presented modally.

    Declaration

    Swift

    public var isModal: Bool { get }

Segue

  • Performs the segue with an identifier like the view controller class name.

    Declaration

    Swift

    public func performSegue(show type: UIViewController.Type, sender: Any?)

Show Alert Controller

  • 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.