🆒
I'm an iOS developer who's really into app architecture, testability, & getting the most out of Swift. Sidebar: why on EARTH don't gists count as contributions?
-
Potbelly
- Queen Creek, AZ
- http://www.jakehawken.com
Highlights
- Pro
Pinned Loading
-
@NonNil - crash with purpose!
@NonNil - crash with purpose! 1/// The NonNil property wrapper allows you to supply an error message at the declaration of a
2/// property, and then otherwise access it like it's non-nil in your code. Any access before it's
3/// set will still result in a crash the way explicity unwrapping would, but with the added benefi
4/// of there being an informative crash message. Intended to be a conscientious and thoughtful
5/// replacement for the `!` operator.
-
Testable Swift Playgrounds! Just dro...
Testable Swift Playgrounds! Just drop this in the Sources folder of a Swift Playground, and you'll be able to write XCTest-style tests right there in your code! 1/*
2Ever wanted to write unit tests in a Swift Playground? … No? Oh.
3I’m really the only person? Well ok, then never mind.
4If you change your mind though, you can drop this file directly
5into the Sources folder and be able to write XCTest-style code
-
@DiskBacked - Easy computed properti...
@DiskBacked - Easy computed properties backed by UserDefaults. 1/// This propety wrapper generates a variable that is backed by UserDefaults.
2/// This can be used with any Codable type, and saves the item to disk as Data.
3/// At initialization, you supply the key at which the the variable will be
4/// saved, and the instance of UserDefaults in which to save it.
5///
-
PubSub: The absolutely lightest weig...
PubSub: The absolutely lightest weight one-to-many pub/sub I could conceive of while also being respectful of memory pressure. 1/// An object which contains a weak reference to another object.
2/// Allows you to keep a reference to something if it's still in
3/// memory, but not increase its reference count.
4class WeakBox<T: AnyObject>: CustomStringConvertible, Hashable {
5
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.