Skip to content

CodeSlicing/pure-swift-ui-tools

Repository files navigation

PureSwiftUITools is a companion package to PureSwiftUI which is designed to provide useful implementation of various concepts written for SwiftUI.

Motivation

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.

Documentation

Containers

GridView

GridView facilitates the easy creation and manipulation of grids with a specified number of columns of rows.

Utilities

GradientMap

GradientMap allows the extraction of colors along a gradient for use where context sensitive colors are a requirement of the UX.

Extensions

Inner Shadows

These extensions bring inner shadows to all major component types in SwiftUI. You can read about them here.

Caveats

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.

Installation

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.

Versioning

This project adheres to a semantic versioning paradigm.

Version History

  • 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
  • 1.3.1 Updating dependency on PureSwiftUI to 1.20.0
  • 2.0.0 Updating dependency on PureSwiftUI to 2.0.0. Breaking changes in PureSwiftUI 2.0.0 (although only on the type system) so be careful if using this library to pull in PureSwiftUI.
  • 2.0.1 Updating dependency on PureSwiftUI to 2.0.1.
  • 2.0.2 Updating dependency on PureSwiftUI to 2.0.1 to next major version.
  • 3.0.0 Updating dependency on PureSwiftUI to 3.0.0 to next major version.

Licensing

This project is licensed under the MIT License - see here for details.

Contact

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.

About

Repository for tooling and utilities for SwiftUI

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages