Skip to content

Commit

Permalink
Fix Missing Localized Initializer (#29)
Browse files Browse the repository at this point in the history
# Fix Missing Localized Initializer

## ⚙️ Release Notes 
- Fixes a missing localized initializer with the new functionality
introduced in #28 noted when including it in the template application.



## 📝 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).
  • Loading branch information
PSchmiedmayer authored Nov 1, 2023
1 parent b281ff6 commit d3aad3e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Sources/SpeziOnboarding/OnboardingInformationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Icon: View>(
@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<Title: StringProtocol, Description: StringProtocol>(
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``.
Expand Down

0 comments on commit d3aad3e

Please sign in to comment.