Title: Theory / Important / CS / Programming / Objective-C / Library / UIKit / Screen and window
Tags: constant type automatedNewLineAfterCommaSpace
On every note of this deck, unless a note says otherwise:
Language: Objective-C

Typ: UIWindow
Meaning: containers for your app’s onscreen content.  receive events from UIKit and to forward any relevant events to the root view controller and associated views.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
https://developer.apple.com/documentation/uikit/uiwindow?language=objc
Language: Objective-C
Subtype of: UIView

Typ: UIScreen
Meaning: report the characteristics of the underlying display to your app
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Language: Objective-C

Instruction: [window
  initWithWindowScene:windowScene
]
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Effect: Creates a window and associates it with the specified scene object.
Language: Objective-C
Variables: UIWindow window
Typ: UIScreen

Variable: window.rootViewController
Meaning: The root view controller for the window.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Language: Objective-C
Variables: UIWindow window

Variable: window.windowLevel
Meaning: The position of the window in the z-axis.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Language: Objective-C
Variables: UIWindow window

Typ: UIWindowLevel
Meaning: The positioning of windows relative to each other.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Language: Objective-C

Variable: window.canResizeToFitContent
Meaning: whether the window's constraint-based content determines its size.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Language: Objective-C
Variables: UIWindow window
Initialization: NO

Variable: window.keyWindow
Meaning: whether the window is the key window of its scene (iOS >=15) or of the app
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Language: Objective-C
Variables: UIWindow window

Name: The key window
Definition: The window that receives keyboard and other non-touch-related events.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Variables: UIWindow window

Variable: window.canBecomeKeyWindow
Meaning: whether the window can become the key window.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Language: Objective-C
Variables: UIWindow window

Instruction: [window
  makeKeyAndVisible
]
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Effect: Shows the window and makes it the key window.
Language: Objective-C
Variables: UIWindow window

Instruction: [window
  makeKey
]
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Effect: Makes the receiver the key window.
Language: Objective-C
Variables: UIWindow window

Instruction: [window
  becomeKeyWindow
]
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Effect: Tells the window that it’s the key window.
Language: Objective-C
Variables: UIWindow window
Extra: Don't call it directly. Subclass it if needed

Instruction: [window
  resignKeyWindow
]
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Effect: Tells the window that it’s not the key window anymore.
Language: Objective-C
Variables: UIWindow window
Extra: Don't call it directly. Subclass it if needed

Variable: window.windowScene
Meaning: The scene containing the window.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Language: Objective-C
Variables: UIWindow window
Extra: Don't call it directly. Subclass it if needed

Variable: window.avDisplayManager
Meaning: The display manager that handles requests for screen resolution, refresh rate, and HDR mode information.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Language: Objective-C
Variables: UIWindow window
Extra: Don't call it directly. Subclass it if needed

Instruction: [window
  convertPoint:point
  toWindow:window
]
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Language: Objective-C
Returns: Converts a point from the current window’s coordinate system to the coordinate system of another window.
Variables: UIWindow window
Extra: Don't call it directly. Subclass it if needed

Instruction: [window
  convertPoint:point
  fromWindow:window
]
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Language: Objective-C
Returns: Converts a point from the coordinate system of a given window to the coordinate system of the current window.
Variables: UIWindow window
Extra: Don't call it directly. Subclass it if needed

Instruction: [window
  convertRect:toWindow
  fromWindow:window
]
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Language: Objective-C
Returns: Converts a rect from the coordinate system of a given window to the coordinate system of the current window.
Variables: UIWindow window
Extra: Don't call it directly. Subclass it if needed

Instruction: [window
  convertRect:toWindow
  toWindow:window
]
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Language: Objective-C
Returns: Converts a rect from the coordinate system of the current window to the coordinate system of the given window.
Variables: UIWindow window
Extra: Don't call it directly. Subclass it if needed

Instruction: [window
  sendEvent:event
]
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Effect: Dispatches the specified event to its views.
Language: Objective-C
Variables: UIWindow window
Extra: Don't call it directly. Subclass it if needed

Constant: UIWindow.UIWindowDidBecomeVisibleNotification
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Typ: NSNotificationName

Constant: UIWindow.UIWindowDidBecomeHiddenNotification
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Typ: NSNotificationName

Constant: UIWindow.UIWindowDidBecomeKeyNotification
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Typ: NSNotificationName

Constant: UIWindow.UIWindowDidResignKeyNotification
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Typ: NSNotificationName

Constant: UIWindow.UIKeyboardWillShowNotification
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Typ: NSNotificationName

Constant: UIWindow.UIKeyboardDidShowNotification
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Typ: NSNotificationName

Constant: UIWindow.UIKeyboardWillHideNotification
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Typ: NSNotificationName

Constant: UIWindow.UIKeyboardDidHideNotification
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Typ: NSNotificationName

Constant: UIWindow.UIKeyboardWillChangeFrameNotification
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Typ: NSNotificationName

Constant: UIWindow.UIKeyboardDidChangeFrameNotification
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc
Typ: NSNotificationName

Constant: UIWindow.UIKeyboardAnimationCurveUserInfoKey
Meaning: A user info key to retrieve the animation curve that the system uses to animate the keyboard onto or off the screen.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc

Constant: UIWindow.UIKeyboardAnimationDurationUserInfoKey
Meaning: A user info key to retrieve the duration of the keyboard animation in seconds.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc

Constant: UIWindow.UIKeyboardIsLocalUserInfoKey
Meaning: A user info key to retrieve a Boolean value that indicates whether the keyboard belongs to the current app.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc

Constant: UIWindow.UIKeyboardFrameBeginUserInfoKey
Meaning: A user info key to retrieve the keyboard’s frame at the beginning of its animation.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc

Constant: UIWindow.UIKeyboardFrameEndUserInfoKey
Meaning: A user info key to retrieve the keyboard’s frame at the end of its animation.
Page: https://developer.apple.com/documentation/uikit/windows_and_screens?language=objc

Typ: UICoordinateSpace
Function: - convertPoint:toCoordinateSpace:
Converts a point from the coordinate space of the current object to the specified coordinate space.
Required.
Page: https://developer.apple.com/documentation/uikit/uicoordinatespace?language=objc
Function2: - convertPoint:fromCoordinateSpace:
Converts a point from the specified coordinate space to the coordinate space of the current object.
Required.
Function3: - convertRect:toCoordinateSpace:
Converts a rectangle from the coordinate space of the current object to the specified coordinate space.
Required.
Function4: - convertRect:fromCoordinateSpace:
Converts a rectangle from the specified coordinate space to the coordinate space of the current object.
Required.
Function5: bounds
The bounds rectangle describing the item’s location and size in its own coordinate system.
Required.
Language: Objective-C

Variable: coordinateSpace.bounds
Meaning: The bounds rectangle describing the item’s location and size in its own coordinate system.
Page: https://developer.apple.com/documentation/uikit/uicoordinatespace?language=objc
Language: Objective-C
Typ: UICoordinateSpace coordinateSpace

Instruction: [coordinateSpace
  convert(Point|Rect):converted
  (to|from)CoordinateSpace:coordinateSpace
]
Page: https://developer.apple.com/documentation/uikit/uicoordinatespace?language=objc
Language: Objective-C
Returns: Converts a point|rect from/to the coordinate space of the current object to/from the specified coordinate space.
Typ: UICoordinateSpace coordinateSpace

Question: What to do during activation
Answer: Show your app’s windows, if needed.
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground?language=objc
Context: Objective-C
Answer2: Change the currently visible view controller, if needed.
Answer3: Update the data values and state of views and controls.
Answer4: Display controls to resume a paused game.
Answer5: Start or resume any dispatch queues that you use to execute tasks.
Answer6: Update data source objects.
Answer7: Start timers for periodic tasks.

Question: When UI will appear, in which order methods are called?
Answer: sceneWillEnterForeground:
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground?language=objc
Context: UIKit
Answer2: sceneDidBecomeActive:
Answer3: viewWillAppear:

Question: When the app is unsuspended in which order events are delivered
Answer: first the stacked system events, then user generated events
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground/processing_queued_notifications?language=objc
Context: UIKit

Constant: NSUserDefaultsDidChangeNotification
Meaning: The user changed your app's preferences
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground/processing_queued_notifications?language=objc

Constant: NSCurrentLocaleDidChangeNotification
Meaning: The current language or locale settings changed.
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground/processing_queued_notifications?language=objc

Constant: UIScreenModeDidChangeNotification
Meaning: The screen mode of a display changes.
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground/processing_queued_notifications?language=objc

Constant: UIScreenDidConnectNotification
Meaning: An external display is connected
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground/processing_queued_notifications?language=objc

Constant: UIScreenDidDisconnectNotification
Meaning: An external display is diconnected
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground/processing_queued_notifications?language=objc

Constant: EAAccessoryDidConnectNotification
Meaning: An accessory is connected
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground/processing_queued_notifications?language=objc

Constant: EAAccessoryDidDisconnectNotification
Meaning: An accessory is disconnected
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground/processing_queued_notifications?language=objc

Constant: NSUbiquityIdentityDidChangeNotification
Meaning: The status of the user's iCloud account changed.
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground/processing_queued_notifications?language=objc

Constant: UIDeviceOrientationDidChangeNotification
Meaning: The device orientation changed.
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground/processing_queued_notifications?language=objc

Constant: UIApplicationSignificantTimeChangeNotification
Meaning: There was a significant time change.
Page: https://developer.apple.com/documentation/uikit/uiapplicationprotecteddatawillbecomeunavailable?language=objc
https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground/processing_queued_notifications?language=objc

Constant: UIDeviceBatteryLevelDidChangeNotification
Meaning: The battery level changed
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground/processing_queued_notifications?language=objc

Constant: UIDeviceBatteryStateDidChangeNotification
Meaning: The battery state changed
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground/processing_queued_notifications?language=objc

Constant: UIDeviceProximityStateDidChangeNotification
Meaning: The device's proximity to the user changed.
Page: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_foreground/processing_queued_notifications?language=objc

Name: The launch storyboard
Definition: The storyboard shown while waiting for the main screen to be ready to be displayed
Page: https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app?language=objc
Context: Objective-C

Question: When an app launch, in which order are method called?
Answer: application:willFinishLaunchingWithOptions:
Page: https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app?language=objc
Context: Objective-C
Answer2: application:didFinishLaunchingWithOptions:
Name: The launch storyboard

Question: What to do when app launch
Answer: Initialize your app's data structures.
Page: https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app?language=objc
Context: Objective-C
Answer2: Verify that your app has the resources it needs to run.
Answer3: Perform any one-time setup when your app launches for the first time. For example, install templates or user-modifiable files in a writable directory. See Performing One-Time Setup for Your App.
Answer4: Connect to any critical services that your app uses. For example, connect to the Apple Push Notification service if your app supports remote notifications.
Answer5: Check the launch options dictionary for information about why your app launched. See Determine Why Your App Launched.

Name: Prewarming
Definition: executes an app’s launch sequence up until, but not including, when main() calls UIApplicationMain
Page: https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app/about_the_app_launch_sequence?language=objc
Context: Objective-C
Intuition: Reduce loading time

Instruction: UIApplicationMain(
  argc,
  argv,
  principalClassname,
  delegateClassName
)
Page: https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app/about_the_app_launch_sequence?language=objc
Effect: Creates the application object and the application delegate and sets up the event cycle.
Language: Objective-C
Returns: Never