Releases: teufelaudio/FoundationExtensions
Releases · teufelaudio/FoundationExtensions
v0.6.0
v0.5.2
- Added KeyPath support for map on
AsyncSequence
. - Added async initialisers for Promise type.
v0.5.1
- Fix platform version.
v0.5.0
- Add A11y.
v0.4.0
- Bridge to Structured Concurrency implemented.
Publisher<Output, Error>
.stream
computed property returnsAsyncThrowingStream<Output, Error>
.Publisher<Output, Never>
.stream
computed property returnsAsyncStream<Output>
.Promise<Output, Error>
.value
computed property returnsget async throws -> Output
.
v0.3.1
v0.3.0
- Add
MutableParameter
. - Add '.eraseFailureToError()' 'Publisher' and 'Promise' types.
- Update file headers.
v0.2.0
- Add
mutate
free function. - Add
.nilOutIfEmpty
for theString
.
Added CombineLatest7
Added combine latest 7 struct (#41) Co-authored-by: Giulia Ariu <>
v0.1.19
Add L10n
Gives type-safe localization in 3 easy steps ✨.
Step 1: Define your strings in an extension of L10n (i.e. in App/Sources/L10n/L10n.swift
).
extension L10n {
public enum HomeScreen: Localizable {
// sourcery: comment=Navigation Bar Title on Home screen
case navigationBarTitle
// sourcery: comment=Some value with parameters
case value(/* sourcery: format=%d */ count: Int, another: String, /* sourcery: format=%.2f */ exacly: Float)
// sourcery: comment=Title for submit button on Home screen
case submitButton
}
}
Step 2: Use sourcery + genstrings + MergeL10n to generate Localizable.strings
.
See .sourcery-l10n-example.yml
and adjust the paths to your project. The sourcery template
can be found in Tools/Sourcery/Templates/Sources/Localizable.stencil
.
# Makefile excerpt
App/Sources/Generated/Localizable.generated.swift: App/Sources/L10n/L10n.swift
sourcery --config App/Sources/.sourcery-l10n.yml
genstrings -o App/Sources/Resources/zz.lproj -s LS App/Sources/Generated/Localizable.generated.swift
Tools/MergeL10n pseudo-to-languages --base-paths="App/Sources/Resources"
Step 3: Refer to the strings using the .localizedString
method.
public struct Example: View {
public var body: some View {
Text(L10n.HomeScreen.navigationBarTitle.localizedString)
}
}