From d3aad3e7df39cea33936d4369bb6ba5c352e5786 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Tue, 31 Oct 2023 23:09:26 -0700 Subject: [PATCH] Fix Missing Localized Initializer (#29) # Fix Missing Localized Initializer ## :gear: Release Notes - Fixes a missing localized initializer with the new functionality introduced in #28 noted when including it in the template application. ## :pencil: Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md). --- .../OnboardingInformationView.swift | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Sources/SpeziOnboarding/OnboardingInformationView.swift b/Sources/SpeziOnboarding/OnboardingInformationView.swift index 6feadc6..1853fe1 100644 --- a/Sources/SpeziOnboarding/OnboardingInformationView.swift +++ b/Sources/SpeziOnboarding/OnboardingInformationView.swift @@ -57,6 +57,33 @@ public struct OnboardingInformationView: View { self.description = String(description) } + /// Creates a new content for an area in the ``OnboardingInformationView``. + /// - Parameters: + /// - icon: The icon of the area in the ``OnboardingInformationView``. + /// - title: The localized title of the area in the ``OnboardingInformationView``. + /// - description: The localized description of the area in the ``OnboardingInformationView``. + public init( + @ViewBuilder icon: () -> Icon, + title: LocalizedStringResource, + description: LocalizedStringResource + ) { + self.init(icon: icon, title: title.localizedString(), description: description.localizedString()) + } + + /// Creates a new content for an area in the ``OnboardingInformationView``. + /// - Parameters: + /// - icon: The icon of the area in the ``OnboardingInformationView``. + /// - title: The title of the area in the ``OnboardingInformationView`` without localization. + /// - description: The description of the area in the ``OnboardingInformationView`` without localization. + @_disfavoredOverload + public init( + icon: Image, + title: Title, + description: Description + ) { + self.init(icon: { icon }, title: title, description: description) + } + /// Creates a new content for an area in the ``OnboardingInformationView``. /// - Parameters: /// - icon: The icon of the area in the ``OnboardingInformationView``.