UIViewController
public extension UIViewController
-
Checks current viewController is navigated
Declaration
Swift
func isNavigated(by navigationController: UINavigationController) -> Bool
-
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
titleBarButton title
imageBarButton image
actionAction
-
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
titleUIAlertController title
messageUIAlertController message
buttonTitleUIAlertAction button text
View on GitHub
UIViewController Extension Reference