Utensils
A set of useful iOS tools.
Adding Utensils to your project
CocoaPods
CocoaPods is the recommended way to add Utensils to your project.
- Add Utensils to your Podfile
pod 'Utensils'
. - Install the pod(s) by running
pod install
. - Add Utensils to your files with
import Utensils
.
Swift Package manager
Swift Package Manager can be used to add Utensils
the to your project:
- Add
.package(url: "https://github.com/rbaumbach/Utensils", from: "0.1.0")
- Follow intructions to add the Utensils package to your project.
Clone from Github
- Clone repository from github and copy files directly, or add it as a git submodule.
- Add all files from
Source
directory to your project.
What tools?
- A
Debouncer
:
let debouncer = Debouncer()
debouncer.mainDebounce(seconds: 0.1) {
thingy.doExpensiveWork()
}
- A
Directory
:
let directory = Directory(.temp(additionalPath: "filez/"))
- A persistence tool called
Trunk
:
let trunk = Trunk()
trunk.save(data: [0, 1, 2, 3, 4])
let arrayOfInts: [Int]? = trunk.load()
- An
AppLaunchViewController
Using the default launch view:
let appLaunchViewController = AppLaunchViewController { print("I'm launching!") }
Using a custom user supplied view:
let appLaunchViewController = AppLaunchViewController { thingy.doSomethingLengthyBeforeAppLaunches() }
appLaunchViewController.customLoadingView = fancyBrandedLoadingView
Note: The custom view will be anchored to all 4 corners of view controller
- A generic
Validator
let email = Email(string: "[email protected]")
let isValidEmail = AnyValidator<Email>().isValid(email)
And more to come...
Goodies
All tools will have accompanying protocols and fakes for those of you that enjoy testing your software. This allows you to program your application to this "interface" and then you can stub it out with your own fake implementation for unit tests.
Testing
This project has been setup to use fastlane to run the specs.
First, bundle required gems, install Cocoapods. Next, inside the root project directory run:
$ bundle
$ bundle exec pod install
And then use fastlane to run all the specs on the command line:
$ bundle exec fastlane specs
Suggestions, requests, and feedback
Thanks for checking out Utensils. Any feedback, suggestions and feedback can be can be sent to: [email protected], or opened as a github issue.