Lessons from Developing an App on the iPad in Swift Playgrounds from Start to Finish (Including Publishing on the App Store)

I didnā€™t know entirely what I was getting myself into by making an app on the iPad.

I went in aware of its limitations and tried to think of a little something I could make for myself that would be useful and extremely simple.

Thus I settled on the love song of so many developers, the thing that there is plenty of in the world, and yet which is close enough to our souls that we always find ways to make it our own.

I mean, of course, the to-do app.

Iā€™m an odd bird, so I thought it would be fun to load a to-do app with lots of random and silly things to NOT do, so that I could have a giggle, and check it off for that tiny dopamine hit.

And thus my to-do app ToDonā€™t was born.

I have a large set of code and videos of actually making the app here: https://twitter.com/wattmaller1/status/1472263788233641988?s=20

As a whole though, letā€™s start with the limitations:

Limited ā€¦

  1. In-app purchases (not what you think!): Early reports mistakenly thought it wasnā€™t possible to use in-app purchases with Swift Playgrounds. What I found out was that they in fact work, but they only become testable in TestFlight, which is annoying since we just got such amazing support of testing configurations and such in Xcode. What you need to do instead, if you want to test in-app purchase scenarios multiple times, is to logout of iCloud on your device and login with a sandbox test account. This is because TestFlight wonā€™t use the sandbox account that you can use in the App Store settings area of your device. Itā€™ll use the iCloud account your device is logged in with overall. (Feedback Id: FB9830444)

  2. CloudKit: CloudKit is one of those really nice ways to get scalable, first-party, out-of-the-box syncing and such right in your app. Itā€™s what my app Pearl uses. And dang, I really wish I couldā€™ve used it in ToDont. There is, however, Swift Package support, so if you find persistent storage with some drop-in syncing, that should probably do the trick for you. Probably will have the friction of needing to sign the user into something, and create an account. Dang it, I miss CloudKit. (Feedback Id: FB9830450)

  3. No Built-In Git: I needed to install a separate app to drag in my playground file and upload it to GitHub from my iPad. Built-in source control would be an excellent addition to Swift Playgrounds as an educational feature as well! (Feedback Id: FB9830486)

  4. Limited Debugging: Very limited, in fact. You get print statements and thatā€™s about it. No stepping through code. (Feedback Id: FB9830492)

  5. No direct to iPhone: This is something I was missing. I could only test on the iPhone after I uploaded to TestFlight, so it took a good while to smooth out some animation bugs that appeared only on an older iPhone and not on the iPad. (Feedback Id: FB9830494)

  6. Widgets & extensions: No widget support is a bummer, along with other extensions, like keyboard extensions, and so forth. (Feedback Id: FB9830498)

  7. Miscellaneous: There are a bunch of things here and there that folks have mentioned: you can import images but canā€™t clarify sizes with an asset catalogue (Feedback Id: FB9830500), you canā€™t edit json files from Playgrounds (I guess itā€™s called SWIFT Playgrounds, eh?). Reading them and parsing them is fine, theyā€™ll just be under ā€œResourcesā€. However, it would be great to edit these files even if itā€™s only as basic text files (Feedback Id: FB9830502). There arenā€™t device previews within Playgrounds previews the way there are for Xcode (Feedback Id: FB9830505).

    A few more things: it would be nice for the validation of the length of the app name to happen before submitting to App Store Connect (Feedback Id: FB9830509). I havenā€™t found a way to jump to the definition of a class, struct, etc. Been missing that (Feedback Id: FB9830513). Also refactoring, like renaming all references (Feedback Id: FB9830510). And being able to search an individual file would be good.

    Also, it would be nice if we could specify ITSAppUsesNonExemptEncryption for smooth uploading to TestFlight, so that I donā€™t need to update the security settings every time on the web. Although that might be in the works. (Feedback Id: FB9830517)

    Also, as a heads up, youā€™ll need to make sure you donā€™t have references to developing on iPad in your metadata. Specifically, I got rejected for my iPad App Store screenshots including the little orange Swift logo in the corner since I took a screenshot while Playgrounds was running.

ā€¦ And Yet Delightful

  1. Fast previews: Weā€™re running right on the hardware. Previews happen very quickly.

  2. Nice code completion: Not everyone reported success with this, and indeed, for myself, code completion stopped a couple of times, and it came back when I restarted the app and hasnā€™t gone away since. And the code completion Iā€™ve gotten is very fast even with massive files, so no complaints from me there.

  3. Versatile: I mean, Iā€™ve got Core Data going, I can build AR apps, games, all of the standard things you want from apps that are essentially smooth web portals are here, weā€™ve got Bluetooth, microphones, speech recognition, core motion, and of course the camera. Itā€™s all there!

  4. Perfect prototyper: If you want to do some work on UI especially, and do a bunch of prototyping, this is a wonderful tool. Itā€™s my go-to code machine around the house lately. Obviously because of ToDonā€™t, but I find myself thinking, could I just use the iPad? Because Playgrounds are just so light and responsive. Combined with my little magnetic Magic Keyboard, this little thing is a fun, no distractions machine.

  5. Ease of publishing: I named my app, gave it it an identifier, and it just uploaded. I canā€™t tell you how much of a headache it was to get an app I worked on to the App Store. Provisioning profiles, amiright? Uploading the app is just, really nice. And you can create the app record from Playgrounds as well! It makes it all for you.

  6. A gateway: I remember working on my iMac and just getting absolutely hooked on how cool it was to create an app when I first started 9 years ago. And to get it running on my phone especially! (I really want that ease of getting apps on the phone). Itā€™s all so much fun. And the fact that it can now be done on a relatively inexpensive machine in a high-quality way is also just great.

Conclusion

In the end, this is exactly what it says it is: Swift Playgrounds. Itā€™s a playground! Itā€™s a place that is primarily great to figure things out. Itā€™s certainly not Xcode on the iPad, nor is it a brand new App Composer app or anything like that. It will shine mostly as a great educational and prototyping tool.

And heck, itā€™s pretty great as a sideproject engine so far. I say that because there is a sweet spot where constraints enable creativity, like the limitations of a sonnet. Iā€™ll be interested to see if any masterpieces emerge.

Previous
Previous

How to create in-App Purchases in Apps made on iPad w/ Swift Playgrounds

Next
Next

Build an App on iPad with Swift Playgrounds and Core Data