Skip to content

Releases: teufelaudio/FoundationExtensions

v0.6.0

08 Sep 07:11
46b1198
Compare
Choose a tag to compare
  • Adds extension of string implementing LocalizedError to have default Error encoding (#52)

v0.5.2

25 Jul 12:23
fe3a226
Compare
Choose a tag to compare
  • Added KeyPath support for map on AsyncSequence.
  • Added async initialisers for Promise type.

v0.5.1

04 May 10:31
6b9bd39
Compare
Choose a tag to compare
  • Fix platform version.

v0.5.0

03 May 15:30
550f4fa
Compare
Choose a tag to compare
  • Add A11y.

v0.4.0

13 Mar 13:04
9dbbdf2
Compare
Choose a tag to compare
  • Bridge to Structured Concurrency implemented.
    • Publisher<Output, Error> .stream computed property returns AsyncThrowingStream<Output, Error>.
    • Publisher<Output, Never> .stream computed property returns AsyncStream<Output>.
    • Promise<Output, Error> .value computed property returns get async throws -> Output.

v0.3.1

09 Mar 16:09
0aa9050
Compare
Choose a tag to compare
  • Add TypePathConvertible and default implementation to create a string out of the type hierarchy.

v0.3.0

01 Mar 16:09
079dcc3
Compare
Choose a tag to compare
  • Add MutableParameter.
  • Add '.eraseFailureToError()' 'Publisher' and 'Promise' types.
  • Update file headers.

v0.2.0

30 Jan 09:37
c837d87
Compare
Choose a tag to compare
  • Add mutate free function.
  • Add .nilOutIfEmpty for the String.

Added CombineLatest7

17 Jan 17:03
6bf3ae7
Compare
Choose a tag to compare
Added combine latest 7 struct (#41)

Co-authored-by: Giulia Ariu <>

v0.1.19

24 Nov 13:33
def4b8d
Compare
Choose a tag to compare

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)
    }
}