Category Archives: iPhone

WWDC 2019 Wishlist

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.

SwiftFest

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.

If you are going to be there, contact me here or on twitter.

App-o-Mat updates

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).

You can subscribe to the mailing list there if you want to get updates. If you have requests for topics to write about, let me know.

Here are the latest posts:

How do I pass values from a VC back to the VC that presented it?

Ok, so you have a view controller that brings up another view controller. Let’s call the first one FirstVC and the second one SecondVC. FirstVC either presents SecondVC or there is some segue that it uses to bring it up.

How do you keep Storyboards from causing merge problems later?

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.

How do you pass values to a VC in a segue?

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.

 

Introducing 3D-o-Mat

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:

This gist shows a better way to do it that preserves the color in the original photos.

GamePlayKit Rule Systems on Smashing

I wrote a 2-part series on GamePlayKit’s Rule Systems framework for Smashing Magazine.

Part 1 is the basic idea and shows how to replace conditional logic that might be strewn around a project into a GamePlayKit rule-system.

In Part 2, I show the support for fuzzy logic rule-systems (logic values ranging from 0.0 to 1.0 instead of strictly true and false). It covers a little more of the features of rule-systems and how to implement NOT, OR, and AND for fuzzy values.

Both articles are supported by Swift Playgrounds in GitHub so that you can play with the concept and try different rules.

NerdSummit 2017 Talk: Introduction to iOS Development through Apps

On March 18th, I’ll be giving a presentation to teach iOS development by looking at completed apps and customizing them.

If you are planning to attend and want help after the talk to set up your machine and get started on the exercises, here’s what you’ll need:

  1. To do the exercises, you need a Mac with Xcode 8.2+ installed. If you don’t have access to a Mac, I think we’ll have enough people with one and can pair you with someone.
  2. We’re going to be forking apps on GitHub, so having a GitHub account already would be good.
  3. You don’t need a device — we’ll be able to use the simulator for all of the examples, but if you want help getting apps on devices, sign up for a free Apple Developer account.

It’s a beginner talk, so anybody with an interest in programming will get something out of it. It will help if you have some programming experience (in any language).

Here’s the plan

  1. Basic Swift (enough to be able to read the apps)
  2. The MVC pattern as implemented in UIKit
  3. Interface Builder (connecting outlets and actions)
  4. Then, we’ll fork an app and make some customizations
  5. Based on the group’s questions, we’ll cover as much iOS Development and Swift as we need.

The idea is that the apps we’ll fork are generally useful apps that people might want a custom version of. All of the code is open-source, and you’ll be able to continue to develop them after the workshop if you wish and release them to the App Store.

I’ll introduce the apps in subsequent blog posts here (I have to make them).

There will be handouts so you can work on your own after the talk.

Handling Pluralizations Correctly in Strings

Earlier this year, Trello launched in 21 languages. I worked on the i18n effort of the iOS apps, and I have been collecting thoughts for a series of blog posts. The first one, about plurals, was published today on the Trello Tech Blog. It begins

On page 52 of my copy of K&R, in a discussion of the ?: operator, is this line of code

printf("You have %d item%s.\n", n, n==1 ? "" : "s");

And thus began my decades-long proliferation of plural-unfriendly strings.

To see why, read the rest of Lessons from Internationalizing Trello, Part I: Plurals on iOS

As a follow-up, I found a Russian translation of K&R. Here is how that line of code is translated

printf("Вы имеете %d элемент%s.\n", n, (n%10==1 && n%100 ! = 11) ?
    " " : ((n%100 < 10 || n%100 > 20) && n%10 >= 2 && n%10 <= 4) ?
    "а" : "ов");

Which is another way to do it, I guess.