Xcode extension for SwiftUI
SwiftUI Tools is an Xcode plug-in to manipulate your Swift code. Currently in version 1.0 the extension contains tools to maniplutate the commenting or removal of lines with open braces '{'. This is useful when using SwiftUI previews to adjust view while in Preview.
More tools will be added in later versions.
There are a couple of ways to install.
-
Download the App directly.
https://github.com/tgunr/swiftuitools/releases/download/v1.0/SwiftUI.Tools.zip -
Clone and archive to Mac App by yourself.
After installation, you should open the SwiftUI Tools Extension.app
once to make the functionality works.
In Xcode, select text containing an opening brace as shown in the previews.
In the Xcode menu click [Editor] -> [SwiftUI Tools] -> [Tool]
Select one of:
[Toggle Brace]
[Toggle Brace Lines]
[Remove Brace]
[Remove Brace Lines]
You can also create a hot-key in [Xcode] -> [Preferences..] -> [Key Bindings] Suggested bindings are:
[Toggle Brace] F1
[Toggle Brace Lines] F2
[Remove Brace] Option + F1
[Remove Brace Lines] Option + F2
![](./README/Key Bindings.png)
Check [System Preferences] -> [Extensions] -> [Xcode Source Editor] -> [SwiftUI Tools] is checked. ![](./README/System Preferences.png)
This extensions use code from https://github.com/Jintin/Swimat for parsing.
Bug reports and pull requests are welcome on GitHub at https://github.com/tgunr/swiftuitools.
The module is available as open source under the terms of the MIT License.