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
Blog
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
Mobile Dev Toolbox
Want to be a one-person mobile app factory? Then you'll need the tools below! iOS Development Required This one is probably the most annoying if you're not already an Apple user: you'll need a Mac of some sort, first of all because Apple requires it, but secondly because only Macs can run Xcode, which iOS… Continue reading Mobile Dev Toolbox
Swift/Kotlin Functional Programming: Tips and Tricks
Here are some of the main advantages I see to doing things in a functional way: Less code – writing simple, small functions allows you to reuse them in many different places by giving you the flexibility to compose and combine them in any way you can think of. This leads to fewer levels of… Continue reading Swift/Kotlin Functional Programming: Tips and Tricks
Android Instant Apps – tips and tricks
At I/O a few years ago, Google announced Instant Apps, an innovation that promises to be good for users and app developers alike. Instant Apps allow visitors to your Play Store listing to try before they buy – in one tap they're able to quickly download a demo version of your app and see how… Continue reading Android Instant Apps – tips and tricks
Smart Apartment Speaker System Setup
Today I'd like to talk about how I've set up my apartment's homegrown, multi-room, auto synced speaker system. When I discovered Sonos a few years ago, I was amazed at it's multi-room sound syncing speakers... I was also disappointed by the cost. So, I set out to build (or, at least, assemble) my own system… Continue reading Smart Apartment Speaker System Setup
Alabama’s New Law is a Dangerous Overstep by Big Government
Alabama just passed a forced labor law. According to this law, the state has the right to determine that one person is entitled to the labor of another: a pregnant woman MUST house and feed a fetus – without pay and against her will – under threat of state violence. If that's the case, how… Continue reading Alabama’s New Law is a Dangerous Overstep by Big Government
More flexible UITableViews
Originally, UITableViews were envisioned to hold homogenous data. Something like this: Every cell was the same type, just with different data backing it. And so the UITableView API was designed with that in mind. In your controller you'd register a cell type, and in the data source you'd set the data on that cell. Easy.… Continue reading More flexible UITableViews
Don’t make something “new,” make something better
A student recently asked me how to come up with ideas for new products... all the good ideas, it seemed to them, were already taken. I realized from talking to this student that a lot of people looking to be entrepreneurs think you have to come up with something new in order to be successful. But… Continue reading Don’t make something “new,” make something better
UITableViews: removing those effin little lines
Those effin little lines are called 'separators' (you can adjust their insets over in the sidebar) and UITableViews add them whenever the list on the screen is too short to fill up all of it. It's annoying. The way you get rid of them is by adding an empty view as the footer of the… Continue reading UITableViews: removing those effin little lines