Skip to content

4.0.0

Latest
Compare
Choose a tag to compare
@davdroman davdroman released this 18 Sep 13:43
· 5 commits to main since this release
05ceff3

Migration Guide

@TextBuilder has been re-implemented from a result builder to a Swift macro.

Additionally, the repo has been renamed from davdroman/TextBuilder to davdroman/swiftui-text-builder. Both forms continue to work in SPM due to GitHub's URL redirection, but I strongly recommend you switch to the new form going forward.

  1. Update macro usage:

    // Old
    @TextBuilder
    var text: Text { ... }
    
    // New
    @TextBuilder
    func text() -> Text { ... }
  2. Replace specialized macros:

    // Old
    @TextBuilderWithSpaces
    func text() -> Text { ... }
    
    // New
    @TextBuilder(separator: " ")
    func text() -> Text { ... }
  3. Update custom separators:

    // Old
    struct MySeparator: TextBuilderSeparator {
        static var separator: String? { " | " }
    }
    @TextBuilderWith<MySeparator>
    
    // New
    @TextBuilder(separator: " | ")
  4. Minimum requirements: Swift 6.0+

What's Changed

Full Changelog: 3.0.1...4.0.0