ios
The iOS Developer’s Guide to Updating an App to iOS14
Each year, like clockwork, for better or worse — sometimes, in my opinion, very much for worse — Apple releases a new version of iOS. We’re all used to the forced march of the calendar by now. In June, WWDC is held, and the new version appears in beta. In September, it goes final. And …
The iOS Developer’s Guide to Updating an App to iOS14 Read More »
Control, Target, and Action in iOS 14
The target–action pattern is one of the oldest in Cocoa, and it’s used with some of the most important interface objects, namely controls (UIControl). That includes buttons (UIButton), switches (UISwitch), segmented controls (UISegmentedControl), and many others. It is also used with UIBarButtonItem because it’s button-like even though it isn’t a control (or even a view). …
Improvements in Testing in Xcode 12
Xcode 12, iOS 14, and Swift 5.3 bring with them a number of significant improvements in testing. If you live and die by tests — or even if you just wish you did — you’re going to be very happy to hear about these. Some of these changes actually appeared earlier, in Swift 5.2, Xcode …
Xcode 12 — What a Pane
As iOS programmers, we live and breathe and have our being within Xcode, so it makes sense to be as familiar as possible with its capabilities, and to take advantage of whatever innovations allow us to get work done. But, ironically, as a new version of Xcode is released, exactly when noteworthy new features are …
Swift 5.2: Object References as Functions in Swift
Here’s a Swift language feature that you may not have noticed when it arrived in Swift 5.2. The following syntax can now be made legal: let p = Person(firstName: “Matt”, lastName: “Neuburg”) let s = p() print(s) // Matt Wait, what just happened? I treated an instance as a function, and it worked (in the …
Swift 5.2: Object References as Functions in Swift Read More »
Swift 5.2: No More Unsafe Pointer References
When people upgraded to Xcode 11.4, a lot of complaints started to appear on StackOverflow that code of the following form was giving trouble (this is an odd way to write this, but just bear with me): let color = // some UIColor var r = 0 as CGFloat var g = 0 as CGFloat …
Swift 5.2: Keypaths Get a Promotion
When you’re busy programming, it’s easy to sleep through changes in the Swift language, especially minor changes; and Swift 5.2 (which emerged as part of Xcode 11.4) was definitely minor, especially in comparison with Swift 5.1. Still, this is an interesting little improvement worth knowing about. Suppose that a Person has a firstName and a …
Testing Forward Compatibility in Xcode
At the time of this writing, we are in that betwixt-and-between period leading up to the release of iOS 14; Xcode 12, Big Sur, and iOS 14 itself are still in beta, but things could start to go final any day now. If you’ve got existing apps, there are various ways to prepare for that …