A Set of utilities to ease basic and repetitive tasks, in Swift.
This repository is an Xcode project with a set of ambidextrous (That's what I really mean by "generic"; not just using generics) tools that can be applied to Swift projects deployed for iOS, iPadOS, MacOS, WatchOS and TVOS.
These tools will work for all of these platforms, and will, at most, rely only on the Foundation library, and the Core Graphics types (in the Core Foundation Library).
This is a set of tools used to aid debugging and testing code.
Extensions to integer data types, as well as some degree/radian conversion for floats and doubles.
Extensions to the StringProtocol protocol. These are mostly parsing, filtering, and conversion capabilities.
Adds degree/radian conversion to CGFloat.
Adds rotation support to CGPoint.
You can use SPM to load the project as a dependency, by referencing its GitHub Repo URI (SSH: [email protected]:RiftValleySoftware/RVS_Generic_Swift_Toolbox.git, or HTTPS: https://github.com/RiftValleySoftware/RVS_Generic_Swift_Toolbox.git).
Once you have the dependency attached, you reference it by adding an import to the files that consume the package:
All of the extensions and utilities will be available.
Carthage is probably the "lowest-overhead" way to use these tools. It's extremely simple to use, and squeaky clean. You will only need to include references to the files into your project. You implement it by adding the following line in your Cartfile:
Once you have done this, navigate the Terminal to the directory containing the Cartfile, and execute:
This will result in a directory, at the same level as the Cartfile, called
Carthage. Inside of that directory, will be another directory, called
Checkouts. Inside of that directory, will be a directory called
The files that you are looking for will be in the
Sources/RVS_Generic_Swift_Toolbox directory. They are arranged in the grouping they are documented, above.
Just drag those files into your Xcode project, and add them to the appropriate targets.
If you choose to use the build products, be aware that Carthage builds may not always sign the modules, so you could have issues submitting to the app store.
You could also directly include the project as a Git Submodule. Submodules can be annoying to work with, but are a good way to maintain ironclad version integrity. If you do this, then you should do the same as above, but instead of a Carthage directory, you will have whatever directory you choose to use to place the submodule.
NOTE: Because of the intricacies of accessing the main bundle, in
accessibilityLocalizedVariantcomputed properties are not covered in the auto-test. This is OK, as they are used by every project I write, so they receive a lot of testing.
© Copyright 2019-2022, The Great Rift Valley Software Company
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.