Title: Theory / Important / CS / Programming / Objective-C / Library / UIKit / View / Alert
On every note of this deck, unless a note says otherwise:
Page: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets?language=objc

Name: Alert sheet
Definition: additional information or acknowledgment from the user
Page: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets?language=objc

Question: How to present an Alert or Action sheet
Answer: create a UIAlertController object,
Page: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets?language=objc
Answer2: Configure the alert controller
Answer3: call its presentViewController:animated:completion: method

Question: Constraint on action sheet on ipad
Answer: It must be in a popover
Page: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets?language=objc

Question: Constraint on action sheet in popover
Answer: cancel buttons are removed. Clicking anywhere else cancels the popover and so the action sheet
Page: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets?language=objc

Typ: UIAlertAction
Meaning: An action that can be taken when the user taps a button in an alert.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets?language=objc

Variable: alertAction.title
Meaning: The title of the action’s button.
Variables: UIAlertAction alertAction

Variable: alertAction.style
Meaning: The style that is applied to the action’s button.
Variables: UIAlertAction alertAction

Variable: alertAction.enabled
Meaning: Whether the action is currently enabled.
Variables: UIAlertAction alertAction

Instruction: [UIAlertAction
  actionWithTitle:title
  style:style
  handler:handler
]
Page: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets?language=objc
Returns: an action with the specified title and behavior.

Typ: UIAlertActionStyle
TypMeaning: Styles to apply to action buttons in an alert.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets?language=objc
Value: UIAlertActionStyleDefault
Apply the default style to the action’s button.
Value2: UIAlertActionStyleCancel
Apply a style that indicates the action cancels the operation and leaves things unchanged.
Value3: UIAlertActionStyleDestructive
Apply a style that indicates the action might change or delete data.

Typ: UIAlertController
Meaning: An object that displays an alert message to the user.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets?language=objc
Subtype of: UIViewController

Variable: alertController.preferredStyle
Meaning: Style of the alert controller
Typ: UIAlertControllerStyle
Variables: UIAlertController alertController

Variable: alertController.title
Meaning: The title of the alert.
Variables: UIAlertController alertController

Variable: alertController.message
Meaning: Descriptive text that provides more details about the reason for the alert.
Variables: UIAlertController alertController

Variable: alertController.actions
Meaning: The actions that the user can take in response to the alert or action sheet.
Typ: NSArray<UIAlertAction *>
Variables: UIAlertController alertController

Variable: alertController.preferredAction
Meaning: The preferred action for the user to take from an alert.
Typ: UIAlertAction
Variables: UIAlertController alertController
Assuming: Value is set AFTER being added to the alert controller

Variable: alertController.textFields
Meaning: The array of text fields displayed by the alert.
Typ: NSArray<UITextField *>
Variables: UIAlertController alertController

Variable: alertController.severity
Meaning: the severity of the alert.
Typ: UIAlertControllerSeverity
Variables: UIAlertController alertController

Instruction: [alertController
  addAction
]
Page: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets?language=objc
Effect: Attaches an action object to the alert or action sheet.
Variables: UIAlertController alertController

Instruction: [alertController
  addTextFieldWithConfigurationHandler:configurationHandler
]
Page: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets?language=objc
Effect: Adds a text field to an alert.
Variables: UIAlertController alertController
(void (^)(UITextField *textField))configurationHandler

Instruction: [UIAlertController
  alertControllerWithTitle:title
  message:message
  preferredStyle:preferredStyle
]
Page: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets?language=objc
Returns: a view controller for displaying an alert to the user.

Typ: UIAlertControllerSeverity
TypMeaning: specifying the severity of an alert in apps built with Mac Catalyst.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets?language=objc
Value: UIAlertControllerSeverityDefault
Indicates that the system should present the alert using the standard alert style.
Value2: UIAlertControllerSeverityCritical
Indicates that the system should present the alert using the critical, or caution, style.

Typ: UIAlertControllerStyle
TypMeaning: indicating the type of alert to display.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens/getting_the_user_s_attention_with_alerts_and_action_sheets?language=objc
Value: UIAlertControllerStyleActionSheet
An action sheet displayed by the view controller that presented it.
Value2: UIAlertControllerStyleAlert
An alert displayed modally for the app.