If you have a subview of a row in SwiftUI which is a button or contains a button, you may run into difficulty getting it to respond to touches. The row itself may receive the touch, instead of the button itself. Read more…
Create a Simple Stepper Element in SwiftUI
To create a stepper in SwiftUI, check out the following code. It will give you a basic element which you can build upon, or use as is. Read more…
UIViewController Extension to Display Alert
Here are two extension functions you can add on UIViewController which make it easy to display alerts. One of the functions will show an alert with a single action option, and the other will show an alert with two options. Read more…
How to Use Combine with Network API Calls in Swift
The Combine framework provides an alternative to using callbacks or delegate methods when loading data from a web API. It’s actually based on a completely different paradigm: Reactive Programming. By using Combine’s publishers, you can observe for value changes and react accordingly (e.g. reload a table view, update label values, etc). Read more…
How to Access an Enum Associated Value in Swift
There are multiple ways to access an enum associated value in Swift. One of the most common methods is using a switch statement. There is also a more concise way to pull an associated value out of a single enum case. Read more…
Is a Coding Bootcamp Right For Me?
A question I hear from people is whether or not a bootcamp is right for them. There isn’t a straightforward answer to this, as it really depends on the person. Some people are fine to learn on their own, and some get overwhelmed with it. Read more…
How to Set Up a UITableView Diffable Data Source in Swift
With the release of iOS 13, Apple introduced UITableViewDiffableDataSource for table views. This class eliminates the need for UITableViewDataSource and is a great way to dynamically update your table view’s data. Read more…
How to Avoid Print Logging in Production Apps with Swift
There are a few reasons it’s a good idea to print to the console only while developing. The most important of these is security. Very often projects will print JSON requests and responses for debug purposes. This logging may contain passwords, API keys or other sensitive information. A malicious actor who was intent on it, could make their way into low levels of the app and pull information that was logged. Read more…
Automatically Indent Switch Statement Cases in Xcode
One of the formatting defaults in Xcode I’m not a fan of is the lack of indentation for case labels in switch statements. There is a setting in Xcode preferences that will add an indentation before the case label. In my opinion this makes the switch block much easier to read. Read more…
Create iOS Build Configurations for Test and Release
Build configurations in iOS development allow us to create specifications about how we want our app to be built. This makes it easy to compile an app for a particular environment (test, development, release, etc). Changing property values and executing code conditionally, depending on the environment, becomes essentially automatic. We’ll go through the steps to set this up below. Read more…
- Page 1 of 2
- 1
- 2