diff --git a/docs/fundamentals/app-lifecycle.md b/docs/fundamentals/app-lifecycle.md index 931e26f78f..a43edc434e 100644 --- a/docs/fundamentals/app-lifecycle.md +++ b/docs/fundamentals/app-lifecycle.md @@ -192,6 +192,8 @@ For more information about the Android app lifecycle, see [Understand the Activi The following table lists the .NET MAUI delegates that are invoked in response to iOS lifecycle events being raised: +::: moniker range="=net-maui-7.0" + | Delegate | Arguments | Description | | -- | -- | -- | | `ApplicationSignificantTimeChange` | `UIKit.UIApplication` | Invoked when a significant time change occurs, such as midnight, carrier-changed time, or the start or stop of daylight savings. | @@ -220,7 +222,44 @@ The following table lists the .NET MAUI delegates that are invoked in response t | `WindowSceneDidUpdateCoordinateSpace` | `UIKit.UIWindowScene`, `UIKit.IUICoordinateSpace`, `UIKit.UIInterfaceOrientation`, `UIKit.UITraitCollection` | Invoked when the size, orientation, or traits of a scene change. | > [!IMPORTANT] -> Each delegate has a corresponding identically named extension method, that can be called to register a handler for the delegate. +> Each delegate has a corresponding identically named extension method that can be called to register a handler for the delegate. + +::: moniker-end + +::: moniker range=">=net-maui-8.0" + +| Delegate | Arguments | Description | +| -- | -- | -- | +| `ApplicationSignificantTimeChange` | `UIKit.UIApplication` | Invoked when a significant time change occurs, such as midnight, carrier-changed time, or the start or stop of daylight savings. | +| `ContinueUserActivity` | `UIKit.UIApplication`, `Foundation.NSUserActivity`, `UIKit.UIApplicationRestorationHandler` | Invoked when the app receives data associated with a user activity, such as transferring an activity from a different device using Handoff. | +| `DidEnterBackground` | `UIKit.UIApplication` | Invoked when the app has entered the background. | +| `FinishedLaunching` | `UIKit.UIApplication`, `Foundation.NSDictionary` | Invoked when the app has launched. | +| `OnActivated` | `UIKit.UIApplication` | Invoked when the app is launched and every time the app returns to the foreground. | +| `OnResignActivation` | `UIKit.UIApplication` | Invoked when the app is about to enter the background, be suspended, or when the user receives an interruption such as a phone call or text. | +| `OpenUrl` | `UIKit.UIApplication`, `Foundation.NSDictionary` | Invoked when the app should open a specified URL. | +| `PerformActionForShortcutItem` | `UIKit.UIApplication`, `UIKit.UIApplicationShortcutItem`, `UIKit.UIOperationHandler` | Invoked when a Home screen quick action is initiated. | +| `PerformFetch` | `UIKit.UIApplication`, `Action` | Invoked to tell the app that it can begin a fetch operation if it has data to download. | +| `SceneContinueUserActivity` | `UIKit.UIScene`, `Foundation.NSUserActivity` | Invoked to handle the specified Handoff-related activity. | +| `SceneDidDisconnect` | `UIKit.UIScene` | Invoked when a scene is removed from the app. | +| `SceneDidEnterBackground` | `UIKit.UIScene` | Invoked when a scene is running in the background and isn't onscreen. | +| `SceneDidFailToContinueUserActivity` | `UIKit.UIScene`, `string`, `Foundation.NSError` | Invoked to inform the user that the activity couldn't be completed. | +| `SceneDidUpdateUserActivity` | `UIKit.UIScene`, `Foundation.NSUserActivity` | Invoked when the specified activity is updated. | +| `SceneOnActivated` | `UIKit.UIScene` | Invoked when the scene becomes active and able to respond to user events. | +| `SceneOnResignActivation` | `UIKit.UIScene` | Invoked when the scene is about to resign the active state and stop responding to user events. | +| `SceneOpenUrl` | `UIKit.UIScene`, `Foundation.NSSet` | Invoked when a scene asks to open one or more URLs. | +| `SceneRestoreInteractionState` | `UIKit.UIScene`, `Foundation.NSUserActivity` | Invoked to restore the activity state. | +| `SceneWillConnect` | `UIKit.UIScene`, `UIKit.UISceneSession`, `UIKit.UISceneConnectionOptions` | Invoked when a scene is added to the app. | +| `SceneWillContinueUserActivity` | `UIKit.UIScene`, `string` | Invoked to prepare to receive Handoff-related data. | +| `SceneWillEnterForeground` | `UIKit.UIScene` | Invoked when a scene is about to run in the foreground and become visible to the user. | +| `WillEnterForeground` | `UIKit.UIApplication` | Invoked if the app will be returning from a backgrounded state. | +| `WillFinishLaunching` | `UIKit.UIApplication`, `Foundation.NSDictionary` | Invoked when app launching has begun, but state restoration has not yet occurred. | +| `WillTerminate` | `UIKit.UIApplication` | Invoked if the app is being terminated due to memory constraints, or directly by the user. | +| `WindowSceneDidUpdateCoordinateSpace` | `UIKit.UIWindowScene`, `UIKit.IUICoordinateSpace`, `UIKit.UIInterfaceOrientation`, `UIKit.UITraitCollection` | Invoked when the size, orientation, or traits of a scene change. | + +> [!IMPORTANT] +> Each delegate, with the exception of `PerformFetch`, has a corresponding identically named extension method that can be called to register a handler for the delegate. + +::: moniker-end To respond to an iOS lifecycle delegate being invoked, call the `ConfigureLifecycleEvents` method on the `MauiAppBuilder` object in the `CreateMauiapp` method of your `MauiProgram` class. Then, on the `ILifecycleBuilder` object, call the `AddiOS` method and specify the `Action` that registers handlers for the required delegates: diff --git a/docs/whats-new/dotnet-8.md b/docs/whats-new/dotnet-8.md index da35b0cbcb..fa593eac65 100644 --- a/docs/whats-new/dotnet-8.md +++ b/docs/whats-new/dotnet-8.md @@ -1,7 +1,7 @@ --- title: What's new in .NET MAUI for .NET 8 description: Learn about the new features introduced in .NET MAUI for .NET 8. -ms.date: 10/02/2023 +ms.date: 10/10/2023 --- # What's new in .NET MAUI for .NET 8 @@ -27,6 +27,7 @@ For information about what's new in .NET 8, see [What's new in .NET 8](/dotnet/c - Resources defined in a can also be consumed in an [`AppThemeBinding`](xref:Microsoft.Maui.Controls.Xaml.AppThemeBindingExtension) with the [`DynamicResource`](xref:Microsoft.Maui.Controls.Xaml.DynamicResourceExtension) markup extension. For more information, see [Define and consume theme resources](~/user-interface/system-theme-changes.md#define-and-consume-theme-resources). - The `Grid.Add` overload that accepts 5 arguments has been added back to .NET MAUI. However, this method is deprecated and is only present to aid migrations from Xamarin.Forms. - gains an `AddWithSpan` extension method that adds a view to the `Grid` at the specified row and column with the specified row and column spans. +- On iOS, `MauiUIApplicationDelegate` gains a `PerformFetch` method that can be overridden or consumed via the `iOSLifecycle.PerformFetch` delegate. For more information, see [iOS platform lifecycle events](~/fundamentals/app-lifecycle.md#ios). The following types or members have been deprecated: