@@ -123,10 +123,19 @@ public protocol ApplicationDelegate: AnyObject, _TriviallyConstructible {
123
123
/// Informs the delegate that the application is about to terminate.
124
124
func applicationWillTerminate( _ application: Application )
125
125
126
- /// Responding to Environment Changes
126
+ // MARK - Responding to Environment Changes
127
+
128
+ /// Tells the delegate that protected files are available now.
127
129
func applicationProtectedDataDidBecomeAavailable( _ application: Application )
130
+
131
+ /// Tells the delegate that the protected files are about to become
132
+ /// unavailable.
128
133
func applicationProtectedDataWillBecomeUnavailable( _ application: Application )
134
+
135
+ /// Tells the delegate when the app receives a memory warning from the system.
129
136
func applicationDidRecieveMemoryWarning( _ application: Application )
137
+
138
+ /// Tells the delegate when there is a significant change in the time.
130
139
func applicationSignificantTimeChange( _ application: Application )
131
140
132
141
// MARK - Configuring and Discarding Scenes
@@ -142,18 +151,23 @@ public protocol ApplicationDelegate: AnyObject, _TriviallyConstructible {
142
151
didDiscardSceneSessions sceneSessions: Set < SceneSession > )
143
152
}
144
153
145
- public extension ApplicationDelegate {
146
- func application( _ application: Application ,
147
- willFinishLaunchingWithOptions options: [ Application . LaunchOptionsKey : Any ] ? )
154
+ extension ApplicationDelegate {
155
+ public func application( _ application: Application ,
156
+ willFinishLaunchingWithOptions options: [ Application . LaunchOptionsKey : Any ] ? )
148
157
-> Bool {
149
158
return true
150
159
}
151
160
152
- func application( _ application: Application ,
153
- didFinishLaunchingWithOptions options: [ Application . LaunchOptionsKey : Any ] ? )
161
+ public func application( _ application: Application ,
162
+ didFinishLaunchingWithOptions options: [ Application . LaunchOptionsKey : Any ] ? )
154
163
-> Bool {
155
164
return true
156
165
}
166
+
167
+ /// A notification that posts immediately after the app finishes launching.
168
+ public static var didFinishLaunchingNotification : NSNotification . Name {
169
+ NSNotification . Name ( rawValue: " UIApplicationDidFinishLaunchingNotification " )
170
+ }
157
171
}
158
172
159
173
extension ApplicationDelegate {
@@ -171,6 +185,33 @@ extension ApplicationDelegate {
171
185
172
186
public func applicationWillTerminate( _: Application ) {
173
187
}
188
+
189
+ /// A notification that posts when the app becomes active.
190
+ public static var didBecomeActiveNotification : NSNotification . Name {
191
+ NSNotification . Name ( rawValue: " UIApplicationDidBecomeActiveNotification " )
192
+ }
193
+
194
+ /// A notification that posts when the app is no longer active and loses
195
+ /// focus.
196
+ public static var willResignActiveNotification : NSNotification . Name {
197
+ NSNotification . Name ( rawValue: " UIApplicationWillResignActiveNotification " )
198
+ }
199
+
200
+ /// A notification that posts when the app enters the background.
201
+ public static var didEnterBackgroundNotification : NSNotification . Name {
202
+ NSNotification . Name ( rawValue: " UIApplicationDidEnterBackgroundNotification " )
203
+ }
204
+
205
+ /// A notification that posts shortly before an app leaves the background
206
+ /// state on its way to becoming the active app.
207
+ public static var willEnterForegroundNotification : NSNotification . Name {
208
+ NSNotification . Name ( rawValue: " UIApplicationWillEnterForegroundNotification " )
209
+ }
210
+
211
+ /// A notification that posts when the app is about to terminate.
212
+ public static var willTerminateNotification : NSNotification . Name {
213
+ NSNotification . Name ( rawValue: " UIApplicationWillTerminateNotification " )
214
+ }
174
215
}
175
216
176
217
extension ApplicationDelegate {
@@ -185,6 +226,31 @@ extension ApplicationDelegate {
185
226
186
227
public func applicationSignificantTimeChange( _ application: Application ) {
187
228
}
229
+
230
+ /// A notification that posts when the protected files become available for
231
+ /// your code to access.
232
+ public static var protectedDataDidBecomeAvailableNotification : NSNotification . Name {
233
+ NSNotification . Name ( rawValue: " UIApplicationProtectedDataDidBecomeAvailableNotification " )
234
+ }
235
+
236
+ /// A notification that posts shortly before protected files are locked down
237
+ /// and become inaccessible.
238
+ public static var protectedDataWillBecomeUnavailableNotification : NSNotification . Name {
239
+ NSNotification . Name ( rawValue: " UIApplicationProtectedDataWillBecomeUnavailableNotification " )
240
+ }
241
+
242
+ /// A notification that posts when the app receives a warning from the
243
+ /// operating system about low memory availability.
244
+ public static var didReceiveMemoryWarningNotification : NSNotification . Name {
245
+ NSNotification . Name ( rawValue: " UIApplicationDidReceiveMemoryWarningNotification " )
246
+ }
247
+
248
+ /// A notification that posts when there is a significant change in time, for
249
+ /// example, change to a new day (midnight), carrier time update, and change
250
+ /// to or from daylight savings time.
251
+ public static var significantTimeChangeNotification : NSNotification . Name {
252
+ NSNotification . Name ( rawValue: " UIApplicationSignificantTimeChangeNotification " )
253
+ }
188
254
}
189
255
190
256
extension ApplicationDelegate {
@@ -203,27 +269,3 @@ extension ApplicationDelegate {
203
269
}
204
270
}
205
271
}
206
-
207
- extension ApplicationDelegate {
208
- public static var didFinishLaunchingNotification : NSNotification . Name {
209
- NSNotification . Name ( rawValue: " UIApplicationDidFinishLaunchingNotification " )
210
- }
211
- }
212
-
213
- extension ApplicationDelegate {
214
- public static var didBecomeActiveNotification : NSNotification . Name {
215
- NSNotification . Name ( rawValue: " UIApplicationDidBecomeActiveNotification " )
216
- }
217
- public static var didEnterBackgroundNotification : NSNotification . Name {
218
- NSNotification . Name ( rawValue: " UIApplicationDidEnterBackgroundNotification " )
219
- }
220
- public static var willEnterForegroundNotification : NSNotification . Name {
221
- NSNotification . Name ( rawValue: " UIApplicationWillEnterForegroundNotification " )
222
- }
223
- public static var willResignActiveNotification : NSNotification . Name {
224
- NSNotification . Name ( rawValue: " UIApplicationWillResignActiveNotification " )
225
- }
226
- public static var willTerminateNotification : NSNotification . Name {
227
- NSNotification . Name ( rawValue: " UIApplicationWillTerminateNotification " )
228
- }
229
- }
0 commit comments