Skip to content

0.4.1

Choose a tag to compare

@liamnichols liamnichols released this 28 May 20:31
· 8 commits to main since this release
f07f28c

What's Changed

New in 0.4.0, dedicated support for SwiftUI has been added through extensions on Text and LocalizedStringKey 馃帀 APIs support iOS 13/macOS 10.5 and later and allow you to benefit from full SwiftUI support for features such as markdown and dynamic language overrides.

var body: some View {
    Form {
        TextField(.localizable(.namePlaceholder), text: $name)
        Text(localizable: .footnote)
    }
    .navigationTitle(.localizable(.createAccountTitle))
}

It is now preferred to use the LocalizedStringKey.localizable(_:) or LocalizedStringResource.localizable(_:) static methods instead of the LocalizedStringResource.localizable static property. The static property has been marked as deprecated. A warning will be emitted starting in 0.5.0 and the code will be completely removed in 1.0.0. See below for migrating your code:

- Text(.localizable.foo)
+ Text(.localizable(.foo))
- String(localized: .localizable.bar)
+ String(localizable: .bar)
- .navigationTitle("\(.localizable.title)")
+ .navigationTitle(.localizable(.title))

Pull Requests

0.4.1

0.4.0