PureSwiftUITools is a companion package to PureSwiftUI which is designed to provide useful implementation of various concepts written for SwiftUI.
Since SwiftUI
is still relatively new, there are many use-cases that are not addressed either directly by Apple or by the community in general. PureSwiftUITools is a way of formulating various ideas into tools which can be used directly in projects, or used as a basis for learning, extending for bespoke purposes, or as a foundation for building a more robust approach. I see this package as a educational platform as much as anything else. As various utilities are introduced they will be accompanied by appropriate demos and gists that demonstrate usage.
GridView facilitates the easy creation and manipulation of grids with a specified number of columns of rows.
GradientMap allows the extraction of colors along a gradient for use where context sensitive colors are a requirement of the UX.
These extensions bring inner shadows to all major component types in SwiftUI
. You can read about them here.
Although PureSwiftUITools exports SwiftUI
- meaning you don't need to import SwiftUI
at the top of your views for compilation - unfortunately at the time of writing previews do not work if you are not explicitly importing SwiftUI
. Hopefully this will be addressed in a future release.
The pure-swift-ui-tools
package can be found at:
https://github.com/CodeSlicing/pure-swift-ui-tools.git
Instructions for installing swift packages can be found here.
This project adheres to a semantic versioning paradigm. I'm sure a lot will change after WW20, so that's probably when version 2.0.0+ will appear.
- 1.0.0 Commit initial code with GridView
- 1.1.0 Add GradientMap and RGBA with appropriate supporting extensions
- 1.2.0 Add inner shadows
- 1.3.0 Fix segmentation fault in Xcode 11.4
This project is licensed under the MIT License - see here for details.
You can contact me on Twitter @CodeSlice. Happy to hear suggestions for improving the package, or feature suggestions. I've probably made a few boo boos along the way, so I'm open to course correction. I won't be open-sourcing the project for the moment since I simply don't have time to administer PRs at this point, though I do intend to do so in the future if there's enough interest.