UIViewController

public extension UIViewController
  • Checks current viewController is navigated

    Declaration

    Swift

    func isNavigated(by navigationController: UINavigationController) -> Bool

Presented Controls

  • Checks current viewController is presented

    Declaration

    Swift

    var isPresentedViewController: Bool { get }
  • Adds a button if currentView controller is presented it takes title or image, title is priority

    Declaration

    Swift

    @objc
    func showLeftBarButtonItemIfPresented(title: String?, image: UIImage?, action: Selector, accessibilityLabel: String? = nil)

    Parameters

    title

    BarButton title

    image

    BarButton image

    action

    Action

Alert

  • Generates a UIAlertController and shows on viewController

    if viewController presented, it does not show alert. it adds statically ‘Tamam’ button.

    Declaration

    Swift

    @objc
    func showAlert(title: String, message: String, buttonTitle: String = "Tamam")

    Parameters

    title

    UIAlertController title

    message

    UIAlertController message

    buttonTitle

    UIAlertAction button text