Swift Five - Week of February 14, 2021
Feb 13, 2021, 7:00 PM
Persistence prevails: Dave shares his iOS developer journey
After watching Dave Jacobsen’s story on YouTube, I found myself asking, “When would I have given up if I were in Dave’s shoes?”
He shares about the...
How to Download Old Versions of Xcode
Dec 8, 2020, 11:21 PM
Whyyy would I need an old version of Xcode?
Valid question – it’s not often you’ll need one. Two reasons off the top of my head though:
1) To compare with your previous experience
Perhaps you’re just wanting to...
iOS 14 Getting Started
Dec 3, 2020, 7:00 PM
Developing for iOS is a valuable and in-demand skill, but if you haven’t developed in the Apple world before, it can be surprisingly different.
In this course, iOS 14: Getting Started, you’ll quickly get up and running using...
What Are All of the Possible Environment Keys in SwiftUI?
Sep 8, 2020, 1:11 AM
This is merely a breadcrumb for finding the Apple Developer documentation page where all of the possible SwiftUI Environment keys are listed.
Resources
Apple Documentation ➡️ SwiftUI ➡️ State and Data Flow ➡️ EnvironmentValues
WWDC - The Worldwide Developer Community
Jun 28, 2020, 8:00 PM
June is an invigorating time for iOS developers worldwide.
Invigorating… And exhausting.
Me personally? The flurry of new-ness often has me feeling overwhelmed.
WWDC - The Worldwide Developer Chase
When it comes time for WWDC,...
StoreKit Testing Swift Start
Jun 24, 2020, 8:00 PM
Manually Testing StoreKit Code
Development Workflow Changes
The previous workflow for setting up in-app purchases was a bit disjointed.
You’d have to create your app in Xcode… then jump out to App Store Connect to define...
Implementing In-App Purchases on iOS
Jun 9, 2020, 6:03 AM
Monetizing apps is challenging. In this course, Implementing In-App Purchases on iOS, you’ll learn to offer digital products and services directly within your app as in-app purchases.
Resources
Implementing...
iOS Receipt Validation: Understanding and Troubleshooting the Original App Version Field
Feb 4, 2020, 7:00 PM
Setting the stage with a use case for checking the original_application_version
The task appears to be simple. Suppose that…
You have an existing app on the app store that’s currently at version 1.2
You want to shift to...
Privacy Policy
Jan 27, 2020, 2:53 AM
Privacy Notice
This privacy notice discloses the privacy practices for and applies solely to information collected by the following websites and apps (SERVICE):
www.andrewcbancroft.com
Ten Read Ten Said
This page is used to inform...
4 Reasons Your iOS App Is Crashing
Jan 24, 2020, 7:00 PM
CPU cannot execute an instruction
Sometimes we developers don’t play fair with the CPU.
Suppose that I wrote some code that ended up telling the CPU to divide by zero.
That’s… impossible… for you and the...
4 Things You Should Never Do When Debugging iOS Apps
Jan 15, 2020, 7:00 PM
Never change code without reproducing the problem first
Reproducing the problem is a critical first step in debugging.
Before you start scouring your code…
Before you start setting breakpoints…
Before you start using tools...
What Is Debugging (And What Isn't)?
Dec 29, 2019, 10:11 PM
Does it ever help you to narrow the scope of overwhelming topics like “debugging”?
It helps me.
When you’re new to something like iOS development, you may find yourself stepping into a world of problems. Everyone...
iOS Debugging Fundamentals
Dec 26, 2019, 5:03 AM
Bugs are bound to happen. Getting rid of them is an essential skill if you want to keep your sanity when building apps.
In this course, you will learn a set of thinking skills to couple with the fundamental tools that Xcode provides you...
How to Use @FetchRequest in SwiftUI
Aug 2, 2019, 11:11 PM
Once you’ve passed an NSManagedObjectContext instance to your SwiftUI View, you’ll need to pull data out of your Core Data persistent store with a fetch request.
First Things First
The remainder of this how-to assumes that...
How to Pass NSManagedObjectContext to a SwiftUI View
Aug 1, 2019, 11:11 PM
Step one to using Core Data with SwiftUI is to initialize the Core Data stack and pass an instance of your NSManagedObjectContext to your view.
First Things First
The remainder of this how-to assumes that you’ve already got a way...
Using Core Data With SwiftUI - An Introduction
Jul 31, 2019, 12:40 AM
How does Apple intend for us to use Core Data with SwiftUI?
They gave us a path forward with the most recent beta release of iOS 13 (Beta 5 at the time of this writing)!
Resources
Blog Idea List SwiftUI Example Xcode Project
...
NSPersistentCloudKitContainer Buggy Behavior List
Jul 11, 2019, 12:40 AM
NSPersistentCloudKitContainer is brand new with Xcode 11 and iOS 13.
It works… kind of… sometimes…
I’m keeping this list of buggy behavior to help keep my head straight. I’ve also filed bug reports on...
Apple's SwiftUI Essentials Tutorial Series as Playgrounds
Jul 5, 2019, 11:11 PM
Resources
SwiftUI Essentials Tutorials as Playgrounds
Apple’s SwiftUI tutorials
Why Playgrounds?
I’ve been making my way through Apple’s SwiftUI tutorials.
If you’re anything like me, you learn by...
Why is Swift ABI Stability a Big Deal?
Jun 21, 2019, 12:40 AM
Imagine writing some Swift code. You want to share it across multiple apps, so you build a framework. You compile it with the Swift 4.0 compiler.
Now imagine Apple announces Swift 4.1. Sweet! You decide to build a new app and compile...
Make a Bash Script Executable
Jun 21, 2019, 12:40 AM
If you constantly run the same set of commands at the command line, why not automate that?
I found myself typing the same things over and over to deploy this website. Here’s how I encapsulated it into a script that saves me...
What is an ABI
Jun 20, 2019, 12:40 AM
“ABI” stands for “Application Binary Interface”.
The word “interface” means the same as it does in other places where you hear the word.
If a human wants to interact with a computer, s/he needs a way...
How Smart (Or Dumb?) Should NSManagedObjects Be?
Jun 19, 2019, 12:40 AM
Apps aren’t “dumb”. Apps do things. Smart things. The question is: Where do the “smart parts” go?
So how you smart or how dumb should NSManagedObject subclasses be?
What code should you write in one of...
On Core Data Object Fetching and Display Strategies
Jun 14, 2019, 12:40 AM
Setting the Stage
Suppose one of the NSManagedObject subclasses from your Core Data data model looked like this:
1
2
3
4
5
6
public class BlogIdea: NSManagedObject {
@NSManaged public var ideaTitle: String?
@NSManaged public...
Using SwiftUI in a Playground
Jun 13, 2019, 12:00 AM
If you’re looking for a quicker way to iterate while you’re building SwiftUI views, and you don’t have macOS Catalina installed, you might enjoy the Playground experience more than you enjoy pressing command + R every...
Getting Started With NSPersistentCloudKitContainer
Jun 11, 2019, 12:40 AM
First Things First
In order to use NSPersistentCloudKitContainer in your app, you need to be targeting iOS 13+.
The CloudKit syncing portion only works on physical devices (not in the simulator). That being the case, you’ll need...
Accessing the Root View Controller at Launch on iOS 13 with SceneDelegate
Jun 7, 2019, 2:20 PM
A new SceneDelegate was introduced for Storyboard-based apps in iOS 13, and with it came some changes in how you’re able to access your app’s root view controller at app launch.
The Old Way
AppDelegate Swift file used to be...
New Delights With Xcode 11
Jun 7, 2019, 12:21 AM
Capabilities Search
In your project settings, you can search for capabilities you want to add (instead of scrolling down the list and turning things “on” or “off”).
Editor Quick Actions
Holding the command key...
Resolving Failed to Load Model Named... with Core Data
Jun 6, 2019, 12:40 AM
You’ve done the work to get your Core Data model ready, but right when you hit run, wham. Your debug output log shows:
Failed to load model named ModelName
You you may experience one of these when you attempt to access your...
First Impressions of NSPersistentCloudKitContainer
Jun 6, 2019, 12:40 AM
Resources
Using Core Data With CloudKit - WWDC 2019 Session 202
Sample Project from Apple
How NSPersistentCloudKitContainer Helps
I suppose the first question everyone should ask is, “What’s the big deal? How...
SwiftUI is Declarative. What Does That Mean?
Jun 3, 2019, 11:11 PM
“Declarative” is one of Swift UI’s four core principles.
Aside from taking for granted that declarative is just “better” than whatever else, how about a visual to understand the declarative way of...
Taking First Steps With SwiftUI
Jun 2, 2019, 11:11 PM
Resources
Tutorial Reference
Enabling SwiftUI
Opting in to using SwiftUI is as easy as creating a new project with Xcode 11 and clicking the “Use SwiftUI” checkbox.
Starting Point
Xcode will give you two structs...
Displaying and Updating Currency in a UILabel
Jun 1, 2019, 12:31 AM
Resources
Right-click -> Save as…
Swift Playground
Setup
1import UIKit
2import PlaygroundSupport
3
4class MyViewController : UIViewController {
5
6 var currencyLabel = UILabel()
7 override func...