Swiftpack.co - CodeSlicing/pure-swift-ui-tools as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Repository for tooling and utilities for SwiftUI
.package(url: "https://github.com/CodeSlicing/pure-swift-ui-tools.git", from: "3.0.0-beta-1")

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.


Inner Shadows

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:


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.

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


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.


Stars: 37
Last commit: 1 week ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics