@@ -75,8 +75,10 @@ public extension UIAlertController {
7575 }
7676
7777 /// A basic message and single button `.Default` alert
78- public static func prompt( var presentedFrom vc: UIViewController ? , withMessage message: String ? , action: String = " OK " ) {
78+ public static func prompt( presentedFrom vc: UIViewController ? , withMessage message: String ? , action: String = " OK " ) {
7979 manager. dismiss ( )
80+
81+ var vc = vc
8082 if vc == nil {
8183 vc = UIApplication . sharedApplication ( ) . delegate? . window?? . rootViewController
8284 }
@@ -100,8 +102,10 @@ public extension UIAlertController {
100102 }
101103
102104 /// A configurable `.Default` alert
103- public static func alert( var presentedFrom vc: UIViewController ? , withTitle title: String ? , message: String ? , cancelAction: String ? , destructiveAction: String ? , otherActions: [ String ] ? , completion: DefaultAlertCompletion ) {
105+ public static func alert( presentedFrom vc: UIViewController ? , withTitle title: String ? , message: String ? , cancelAction: String ? , destructiveAction: String ? , otherActions: [ String ] ? , completion: DefaultAlertCompletion ) {
104106 manager. dismiss ( )
107+
108+ var vc = vc
105109 if vc == nil {
106110 vc = UIApplication . sharedApplication ( ) . delegate? . window?? . rootViewController
107111 }
@@ -150,8 +154,10 @@ public extension UIAlertController {
150154 }
151155
152156 /// A configurable `.Default` style alert with a single `UITextField`
153- public static func textAlert( var presentedFrom vc: UIViewController ? , withTitle title: String ? , message: String ? , initialText: String ? , cancelAction: String ? , otherActions: [ String ] ? , completion: TextAlertCompletion ) {
157+ public static func textAlert( presentedFrom vc: UIViewController ? , withTitle title: String ? , message: String ? , initialText: String ? , cancelAction: String ? , otherActions: [ String ] ? , completion: TextAlertCompletion ) {
154158 manager. dismiss ( )
159+
160+ var vc = vc
155161 if vc == nil {
156162 vc = UIApplication . sharedApplication ( ) . delegate? . window?? . rootViewController
157163 }
@@ -196,8 +202,10 @@ public extension UIAlertController {
196202 }
197203
198204 /// A configurable `.Default` style alert with a single secure `UITextField`
199- public static func secureAlert( var presentedFrom vc: UIViewController ? , withTitle title: String ? , message: String ? , initialText: String ? , cancelAction: String ? , otherActions: [ String ] ? , completion: TextAlertCompletion ) {
205+ public static func secureAlert( presentedFrom vc: UIViewController ? , withTitle title: String ? , message: String ? , initialText: String ? , cancelAction: String ? , otherActions: [ String ] ? , completion: TextAlertCompletion ) {
200206 manager. dismiss ( )
207+
208+ var vc = vc
201209 if vc == nil {
202210 vc = UIApplication . sharedApplication ( ) . delegate? . window?? . rootViewController
203211 }
@@ -244,8 +252,10 @@ public extension UIAlertController {
244252
245253 /// A configurable `.Default` style alert with two `UITextField`s, the
246254 /// second of which is secure
247- public static func credentialAlert( var presentedFrom vc: UIViewController ? , withTitle title: String ? , message: String ? , initialCredentials: NSURLCredential ? , cancelAction: String ? , otherActions: [ String ] ? , completion: CredentialAlertCompletion ) {
255+ public static func credentialAlert( presentedFrom vc: UIViewController ? , withTitle title: String ? , message: String ? , initialCredentials: NSURLCredential ? , cancelAction: String ? , otherActions: [ String ] ? , completion: CredentialAlertCompletion ) {
248256 manager. dismiss ( )
257+
258+ var vc = vc
249259 if vc == nil {
250260 vc = UIApplication . sharedApplication ( ) . delegate? . window?? . rootViewController
251261 }
@@ -304,8 +314,10 @@ public extension UIAlertController {
304314
305315 /// A configurable `.ActionSheet` style alert presented from the
306316 /// `viewController` or `sourceView` on Regular horizontal size classes
307- public static func sheet( var presentedFrom vc: UIViewController ? , withBarButtonItem barButtonItem: UIBarButtonItem ? , orSourceView sourceView: UIView ? , title: String ? , message: String ? , cancelAction: String ? , destructiveAction: String ? , otherActions: [ String ] ? , completion: DefaultAlertCompletion ) {
317+ public static func sheet( presentedFrom vc: UIViewController ? , withBarButtonItem barButtonItem: UIBarButtonItem ? , orSourceView sourceView: UIView ? , title: String ? , message: String ? , cancelAction: String ? , destructiveAction: String ? , otherActions: [ String ] ? , completion: DefaultAlertCompletion ) {
308318 manager. dismiss ( )
319+
320+ var vc = vc
309321 if vc == nil {
310322 vc = UIApplication . sharedApplication ( ) . delegate? . window?? . rootViewController
311323 }
0 commit comments