Protocols allow you to define functions and properties that any class or struct which conforms to it must implement. This gives you the ability to rely only upon the things you need, while not putting too many restrictions on the conforming type. Let's look at an example. Consider the following: protocol Fireable { func fire()… Continue reading Quick Swift: Protocols
Month: November 2019
Quick Swift: Swift Optionals and nil
TLDR: calling a method on nil will crash. Variables that can be nil are called Optional, and are defined using a question mark. To call a method on an optional variable, unwrap it by using a question mark (optional chaining), an exclamation point (force unwrapping), or an "if let" or "guard let" statement (conditional unwrapping).… Continue reading Quick Swift: Swift Optionals and nil
iOS App Codebase Best Practices
A client recently had me prepare a document containing suggestions on how to bring their app in line with current best practices as they continue to iterate and grow their team. Below I've listed some of those best practices, as I see them, and some suggestions on how to get there on a 'lazy' basis… Continue reading iOS App Codebase Best Practices