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.
-
Update macro usage:
// Old @TextBuilder var text: Text { ... } // New @TextBuilder func text() -> Text { ... }
-
Replace specialized macros:
// Old @TextBuilderWithSpaces func text() -> Text { ... } // New @TextBuilder(separator: " ") func text() -> Text { ... }
-
Update custom separators:
// Old struct MySeparator: TextBuilderSeparator { static var separator: String? { " | " } } @TextBuilderWith<MySeparator> // New @TextBuilder(separator: " | ")
-
Minimum requirements: Swift 6.0+
What's Changed
- Re-implement
@TextBuilder
as macro by @davdroman in #32 - Rename package to
swiftui-text-builder
by @davdroman in #36 - Bump to Swift 6.0 by @davdroman in #28
- Adopt Swift Testing by @davdroman in #31
- Update dependencies by @davdroman in #27
- Switch to tabs for indentation by @davdroman in #26
- Remove old compiler version check by @davdroman in #29
- Fix warnings by @davdroman in #30
- Add .spi.yml [skip ci] by @davdroman in #34
- Remove benchmarks by @davdroman in #33
- Rewrite README for 4.0.0 release by @davdroman in #35
Full Changelog: 3.0.1...4.0.0