4
4
extension AlertController {
5
5
/// Constants indicating the type of alert to display.
6
6
public enum Style : Int {
7
+ /// An action sheet displayed in the context of the view controller that
8
+ /// presented it.
7
9
case actionSheet
10
+
11
+ /// An alert displayed modally for the app.
8
12
case alert
9
13
}
10
14
}
11
15
16
+ /// An object that displays an alert message to the user.
12
17
public class AlertController : ViewController {
13
- /// Configuring the Alert
18
+ // MARK - Configuring the Alert
19
+
20
+ /// Descriptive text that provides more details about the reason for the
21
+ /// alert.
14
22
public var message : String ?
23
+
24
+ /// The style of the alert controller.
15
25
public let preferredStyle : AlertController . Style
16
26
17
- /// Creating an Alert Controller
27
+ // MARK - Creating an Alert Controller
28
+
29
+ /// Creates and returns a view controller for displaying an alert to the user.
18
30
public init ( title: String ? , message: String ? ,
19
31
preferredStyle: AlertController . Style ) {
20
32
self . message = message
21
33
self . preferredStyle = preferredStyle
22
34
super. init ( )
23
35
}
24
36
25
- /// Configuring the User Actions
37
+ // MARK - Configuring the User Actions
38
+
39
+ /// Attaches an action object to the alert or action sheet.
40
+ public func addAction( _ action: AlertAction ) {
41
+ }
26
42
27
43
/// The actions that the user can take in response to the alert or action
28
44
/// sheet.
@@ -31,16 +47,12 @@ public class AlertController: ViewController {
31
47
/// The preferred action for the user to take from an alert.
32
48
public var preferredAction : AlertAction ?
33
49
34
- /// Attaches an action object to the alert or action sheet.
35
- public func addAction( _ action: AlertAction ) {
36
- }
37
-
38
- /// Configuring Text Fields
39
-
40
- /// The array of text fields displayed by the alert.
41
- public private( set) var textFields : [ TextField ] ?
50
+ // MARK - Configuring Text Fields
42
51
43
52
/// Adds a text field to an alert.
44
53
public func addTextField( configurationHandler: ( ( TextField ) -> Void ) ? = nil ) {
45
54
}
55
+
56
+ /// The array of text fields displayed by the alert.
57
+ public private( set) var textFields : [ TextField ] ?
46
58
}
0 commit comments