I am starting a new series of articles about Appium on my iOS content site, App-o-Mat.
In the first one, I cover the first step of getting the most out of GUI Testing: setting accessibility identifiers.
Yesterday, I wrote that books should get you to write code, not just read it. I’ve been working on a companion to Apple’s Swift Programming Language book that helps you do that by offering exercises for each chapter.
I just published the companion to the Methods chapter on App-o-Mat. If you want to start from the beginning, go to the outline of Section 1. If you understand the content of the corresponding chapter, the exercises are meant to be very easy. If you are having trouble with them, it would be a good idea to review the chapter again before moving on.
I recently started working with Typescript and VSCode on an open-source project that needs a Swift and TypeScript version of the same functionality. I wrote a Swift version, and then did a very faithful (almost line-by-line) port to Typescript, which I did not know at all before starting. I never used VSCode (or Atom) before starting.
Microsoft makes excellent developer tools.
My project is admittedly very small, but luckily I can see how it works with with a large project because a minimal React site with Typescript has 48k files of dependencies. VSCode has nearly instantaneous code-completion and real-time error reporting. A minimal app in Xcode isn’t nearly as fast or reliable.
The combination of VSCode and Typescript makes Xcode and Swift look a decade behind. It’s comparable to Apple’s lead in chip design and the advantage that gives to its products — that’s the kind of lead Microsoft has in developer tools. Luckily for Apple, that advantage mainly flows to in-browser and server-side development, where Swift has effectively no usage.
let x = (anOptional != nil) ? funcExpectingNonNil(anOptional) : fallback
anOptionalis not nil in the call to
funcExpectingNonNil, but Swift does not.
Like previous years, my wishlist is highly influenced by what I’m working on and is not a prediction — just stuff I have needed in the past year.
I Just released a new watchOS app, Sprint-o-Mat that helps me in outdoor running workouts. I had actually started it before WWDC 2019, but completely started over to do it as an independent watch app on SwiftUI.
Here’s what I’d like from watchOS
Allow the user to control location privacy in the watch’s settings app
You can already control HealthKit authorizations on the watch, but changing location authorization makes you use the iPhone. This is impossible to link to, and very hard to explain.
Make some SwiftUI equivalent to
This view is what makes showing a timer easy and performant. You can update it with elapsed time at a low frequency, but it updates its view in between so that it looks like a running timer.
Unfortunately, you can’t even host
WKInterfaceTimer in a SwiftUI
View (via interop) because it doesn’t have a default
init (and can only be constructed via a Storyboard)
Allow workout apps to keep showing on the display when a workout is running
When you run the built-in Workouts app, the display stays on and shows the UI of the app. For 3rd party workout apps, when you lower your wrist, the display shows the time and a frozen UI under a blurred overlay.
This means that 3rd party workout apps require the pre-always-on wrist movements if you want to see their updated UI.
Add the APIs that the Workouts app uses to send data to the Activity app
The built-in Workouts app appears to have private APIs (or private metadata) that the Activity app uses to enhance the workout display (e.g. custom icons, per-segment data). I’d like to see those, and even new ones, publicly available to any workout app.
Make some canonical way to base font-sizes on display size
There isn’t a good way that I can see to make a single
View for 38mm and 44mm watches that look good without hardcoding or hacks.
There are a lot of other issues that I ran into, but the general idea of an independent watch app coupled with SwiftUI and the simplified app architecture more than makes up for it. If Apple just keeps moving this forward in big steps, I’ll be pretty happy.
Parameters in SiriKit custom intents & Fine-grained Shortcut integration (apps provide blocks): Parameters are definitely in and I believe (from the SOTU demos) that the Shortcuts app can directly call into intents with parameters, thus enabling more fine-grained interactions. This is great news, and even if you don’t think Siri as a voice-assistant would be useful for your app, you should want this for Shortcuts integration.
On-device transfer learning in CoreML: This is also in and unlocks all kind of on-device ML applications. There is also a new category of “easy” ML integration (voice/sound analysis) along with a ton of other improvements. CreateML is now a Mac app instead of being integrated into Playgrounds.
HKLiveWorkoutBuilder (from watchOS) in iOS: I don’t see any mention of HealthKit or workouts at all in the release notes, so no luck here.
Web->AppStore->App ad attribution (w/o user tracking): Even though this was not announced, I have some hope that this could happen. The WebKit announcement of an privacy preserving ad click tracking mechanism is evidence that this problem is on their radar.
The App Store story is even worse, because there is no official way to pass some kind of data through your App Store URL that the App gets on first start. The normal attribution mechanism, IDFA, is not available to websites (only apps), so the only way to do a website-ad -> AppStore -> App attribution is for the web site and App to “fingerprint” the user somehow. One simple way is a correlation with time and an IP address, but that isn’t perfect. Unfortunately, many apps (and 3rd party ad trackers) do not stop there.
The last few years have been a cat-and-mouse game between Ad Tech firms finding loopholes in iOS (e.g. shared Pasteboards) and Apple closing them. It would be much better if Apple provided a privacy preserving mechanism and then explicitly forbade anything else in the developer agreement.
Multi-select image picker: No luck this year.
Today I tweeted
Here’s a quick elaboration
Parameters in SiriKit custom intents: The custom intents that were introduced last year do not support recognition-time parameters. All of the parameters of the intent must be baked into the intent. SiriKit calls this “resolving parameters” and the built-in intents all support this, but custom ones do not.
On-device transfer learning in CoreML: Transfer learning allows you to build a new model from an existing one by providing more examples. CoreML added that last year, but you still need to train and build the new model off-device. I’d like a way to build new models this way on-device from device gathered examples (which would preserve privacy).
HKLiveWorkoutBuilder (from watchOS) in iOS: This class is only available for watch workout apps, but a simpler version would be nice for iOS workout apps. It obviously can’t gather heart rate, but it could automatically build the route and perhaps use a less sophisticated algorithm for guessing calories burned.
Web->AppStore->App ad attribution (w/o user tracking): The WebKit team just announced a privacy preserving ad attribution system for websites. I want the same thing to work for an ad for an app that appears on the web, App Store, or in another App. No need to attribute to a user — just the ad source is sufficient.
Fine-grained Shortcut integration (apps provide blocks): The Workflow team integrated the x-callback-urls of a bunch of popular apps into blocks — and Shortcuts still has them, but as far as I know, there’s no API for apps to provide small bits of functionality for Shortcuts to use as a building block. Even with the ones they have, the app comes up, does a bunch of stuff and then returns. A more streamlined experience would be nice.
Multi-select image picker: The current UIImagePickerViewController doesn’t support multi-select of photos. If you want to do this, you can build your own VC, but then you need to ask the user permission to their entire photo library in order to show them the photos. Since iOS 11, you have been able to bring up a picker without permission since it runs out-of-process and doesn’t give your app any access to the photos–just the one the user picked.
I will be speaking about my experience with RxSwift at SwiftFest 2019 in Boston on July 29-30. Last year, I spoke there about how to sketch iOS UIs in Playgrounds — unfortunately the talks are not available online, but I’ll be putting together a video shortly that covers the material I spoke about.
I highly recommend this conference — it’s two-track and has about 300 attendees. I went to talks every chance I got and learned a ton. It will also be a good time to discuss the ramifications of WWDC as we’ll all have add a couple of months to absorb iOS 13.
I started App-o-Mat as an iOS tutorial site back when I was consulting. It mostly had cordova screencasts. I’m going to be doing more writing about iOS there (native and possibly cordova-based).
Here are the latest posts:
Ok, so you have a view controller that brings up another view controller. Let’s call the first one
FirstVCand the second one
SecondVCor there is some segue that it uses to bring it up.
There’s this myth in the iOS community that “professional” iOS developers never use Interface Builder. It’s meant to imply that coding your interfaces is always better, and if you don’t do it, you are somehow less of a programmer. The myth perpetuates the idea that IB is a crutch, a toy, something that only newbies use.
I call BS.
A theme I see a lot on StackOverflow is a developer makes a View Controller that collects some information from a user and wants to use it on a VC that they bring up in a segue.
3D-o-Mat is a simple app that creates the type of 3D photos that you view with red/cyan glasses.
I have been writing apps that do this for a while. It was one of the first things I wrote with DotImage back when I joined Atalasoft in 2006 and ported their image processing commands to WPF. Then, I wrote a simple version for iOS that I showed to middle-schoolers when I was a volunteer for DIGITS.
I was recently invited to speak at a Smith College Python programming summer program for HS girls and I decided to make this app more real.
PS: here’s a tweet sized version of the app in Python that I shared with the class the last time I spoke:
from PIL import Image as I
— Lou Franco (@loufranco) July 17, 2015
This gist shows a better way to do it that preserves the color in the original photos.
I wrote an article for Smashing Magazine summarizing the updates from WWDC 2017 that would interest iOS Developers (with code samples).
As part of that article a wrote a very simple face detector app using the new Vision framework in iOS 11. The source code for that app can be found here: