From dd59b84ec9525942842ad9f355d05c40804b1a97 Mon Sep 17 00:00:00 2001 From: Andreas Bauer Date: Mon, 14 Oct 2024 10:52:29 +0200 Subject: [PATCH] Docs changes --- .../Interactions with Application.md | 2 +- .../Module/Interactions with Application.md | 42 +++++++++++++++++++ Sources/Spezi/Spezi.docc/Module/Module.md | 1 + .../Spezi/Spezi.docc/Module/Notifications.md | 13 +++--- Sources/Spezi/Spezi.docc/Spezi.md | 1 - Tests/UITests/TestApp/TestApp.swift | 2 - 6 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 Sources/Spezi/Spezi.docc/Module/Interactions with Application.md diff --git a/Sources/Spezi/Spezi.docc/Interactions with Application.md b/Sources/Spezi/Spezi.docc/Interactions with Application.md index 07b0c2dc..ebaa68b9 100644 --- a/Sources/Spezi/Spezi.docc/Interactions with Application.md +++ b/Sources/Spezi/Spezi.docc/Interactions with Application.md @@ -16,7 +16,7 @@ SPDX-License-Identifier: MIT Spezi provides platform-agnostic mechanisms to interact with your application instance. To access application properties or actions you can use the ``Module/Application`` property wrapper within your -``Module``, ``Standard`` or SwiftUI `View`. +``Module`` or ``Standard``. > Tip: The articles illustrates how you can easily manage user notifications within your Spezi application. diff --git a/Sources/Spezi/Spezi.docc/Module/Interactions with Application.md b/Sources/Spezi/Spezi.docc/Module/Interactions with Application.md new file mode 100644 index 00000000..ebaa68b9 --- /dev/null +++ b/Sources/Spezi/Spezi.docc/Module/Interactions with Application.md @@ -0,0 +1,42 @@ +# Interactions with Application + +Interact with the Application. + + + +## Overview + +Spezi provides platform-agnostic mechanisms to interact with your application instance. +To access application properties or actions you can use the ``Module/Application`` property wrapper within your +``Module`` or ``Standard``. + +> Tip: The articles illustrates how you can easily manage user notifications within your Spezi application. + +## Topics + +### Application Interaction + +- ``Module/Application`` + +### Properties + +- ``Spezi/logger`` +- ``Spezi/launchOptions`` + +### Notifications + +- ``Spezi/registerRemoteNotifications`` +- ``Spezi/unregisterRemoteNotifications`` + +### Platform-agnostic type-aliases + +- ``ApplicationDelegateAdaptor`` +- ``BackgroundFetchResult`` diff --git a/Sources/Spezi/Spezi.docc/Module/Module.md b/Sources/Spezi/Spezi.docc/Module/Module.md index 86bdf412..687332c6 100644 --- a/Sources/Spezi/Spezi.docc/Module/Module.md +++ b/Sources/Spezi/Spezi.docc/Module/Module.md @@ -64,6 +64,7 @@ class ExampleModule: Module { ### Capabilities - +- - - - diff --git a/Sources/Spezi/Spezi.docc/Module/Notifications.md b/Sources/Spezi/Spezi.docc/Module/Notifications.md index ceff9b85..ecabc70e 100644 --- a/Sources/Spezi/Spezi.docc/Module/Notifications.md +++ b/Sources/Spezi/Spezi.docc/Module/Notifications.md @@ -14,7 +14,7 @@ SPDX-License-Identifier: MIT ## Overview -Spezi provides platform-agnostic mechanisms to manage and respond to User Notifications within your ``Module``, ``Standard`` or SwiftUI `View`. +Spezi provides platform-agnostic mechanisms to manage and respond to User Notifications within your ``Module`` or ``Standard``. ### Handling Notifications @@ -29,8 +29,6 @@ respectively for more details. To register for remote notifications, you can use the ``Module/Application`` property and the corresponding ``Spezi/registerRemoteNotifications`` action. Below is a short code example on how to use this action. -- Note: You can also use the `@Application` property wrapper in your SwiftUI `View` directly. - ```swift class ExampleModule: Module { @Application(\.registerRemoteNotifications) @@ -59,12 +57,13 @@ implement the ``NotificationHandler/receiveRemoteNotification(_:)`` method. ## Topics -### Remote Notification Registration +### Notifications -- ``Spezi/registerRemoteNotifications`` -- ``Spezi/unregisterRemoteNotifications`` +- ``NotificationHandler`` ### Apple Push Notification Service -- ``NotificationHandler`` - ``NotificationTokenHandler`` +- ``Spezi/registerRemoteNotifications`` +- ``Spezi/unregisterRemoteNotifications`` + diff --git a/Sources/Spezi/Spezi.docc/Spezi.md b/Sources/Spezi/Spezi.docc/Spezi.md index b91cafca..1b4b90cd 100644 --- a/Sources/Spezi/Spezi.docc/Spezi.md +++ b/Sources/Spezi/Spezi.docc/Spezi.md @@ -99,7 +99,6 @@ You can learn more about modules in the documentation. - ``Spezi/Spezi`` - ``Standard`` - ``Module`` -- ### Previews diff --git a/Tests/UITests/TestApp/TestApp.swift b/Tests/UITests/TestApp/TestApp.swift index 1ae7686b..02646a68 100644 --- a/Tests/UITests/TestApp/TestApp.swift +++ b/Tests/UITests/TestApp/TestApp.swift @@ -10,8 +10,6 @@ import Spezi import SwiftUI import XCTestApp -// TODO: test @Application somewhere! (maybe just use @Environment???) - @main struct UITestsApp: App {