Software

Building and Publishing an iOS App with your iPad for real

Building and publishing an app for the iOS App Store all from an iPad Pro is possible! I was able to do it for my 36Exp camera app, don’t believe me take a look at the proof.

For my app idea, I wanted to build a film camera experience app. This meant handling camera data, image processing, custom UI, and much much more!

https://apps.apple.com/us/app/36exp-lite/id6451005279

Who is this post for?

This post is not meant to be a how-to or a guide but a list of notes and helpful hints I found along the way. Most of this knowledge can be found by googling around a bit but I thought I should put this together for myself and anyone else that might want to build an app using their iPad.

Hardware

First and foremost you will benefit from a newer iPad Pro, one with at least an M1 chip. Second, get a keyboard! This is necessary for writing code and getting more screen space for development. I have an Amazon link below for the one I use and it’s about 10x cheaper than the Apple Magic Keyboard… https://www.amazon.com/10-9-inch-Keyboard-Arteck-Bluetooth-Protection/dp/B09KLVL2DB

SwiftUI

When using the iPad to create apps you won’t be able to use Xcode. There is a special app on the App Store that you will need to install called Swift Playgrounds. This is a self-contained app where you can program test and push to Apple’s app connect for publishing, more on that last piece later.

https://apps.apple.com/us/app/swift-playgrounds/id908519492

Swift Playgrounds has come a long way since its conception starting out as just a simple scratch pad for learning swift code to now a full developing environment for iOS. I started using the app from a camera app example provided by Apple. So take a look at the available examples, there just might be something to help you get coding right away!

Learning Swift will help you program your app effectively, I am not a Swift expert but using a few online sources I was able to muddle my way through. Here are just a few general ones I learned from.

https://www.hackingwithswift.com

https://www.simpleswiftguide.com

https://sarunw.com/tags/swiftui/

Swift vs SwiftUI? Swift is just a general-purpose programming language, but SwiftUI is a language used to create and manage user interfaces. Think of SwiftUI as the code to describe what and where to place a button on the screen and Swift as the language to describe what to do when that button is pressed. This is an oversimplification but each language should be used together to create useful and interesting apps.

Take Advantage of the iPads io! This is the most interesting thing about programming iOS apps on the iPad is that you can instantly build and test your app on the device for its intended use. This is critical when making apps that use the camera, microphone, accelerometers, and other sensors. When building my camera app I was able to quickly tell if the code was working as intended. Changing camera settings and options instantly, without the need to build on a Mac transfer and then test.

The other thing is that app build is insanely fast, I credit this to the M1 chip and native os not having to go through a translation layer that was needed on intel Macs. This means super fast iterations. One issue though is that it drains the iPad battery like no other app I have seen before!

Simplify, the iPad is still limited. For how powerful the iPad is there are still a few downsides. First, the only language you can use is Swift and swiftUI, you can’t use advanced debugging features in Xcode, and you can’t override orientation, forcing you to design for all layouts. And lastly the most frustrating is that the app is RAM-constrained, making very long conditional statements, especially in SwiftUI, difficult or impossible to compile. I had to rework loops several times to get them to build without throwing unable-to-build errors.

Test Test Test

Basic testing while developing can happen locally within the Swift Playgrounds app environment, but what if you want or need to test on other iOS devices? You can’t just connect an iPhone and send the app over (would be cool if you could). This is where Apple’s App Store Connect website and Test Flight come into play!

First, if you have not done so already you will need an Apple Developer Account. Sorry, this is the one sticking point that you won’t be able to get around. This means shelling out $99 for the year. So develop what you can for as long as you can just on your iPad for free. Then once you have a proof of concept start this process.

App Store Connect

The App Store Connect website is where you will be managing your app and where you will need to fill all the requirements for its release to the App Store itself. When developing on an iPad you will also be using it to send the app to your other iOS devices for testing. You will get access to this website after you have your developer account.

The first thing that you will need to do to upload your app is set up your developer account in Swift Playgrounds. Then you can go and upload to the cloud, but to start testing you need to wait till the build gets verified and you manage the build. You just need to inform Apple if your app uses encryption algorithms.

Once you do that the app should be available for download in the TestFlight App. From there you can begin testing

Permissions

If your app accesses things like the camera or the camera roll you will need to set up asking for permissions. This can be done in the Swift Playgrounds app but it’s not enough to just have a generic string. You need to specifically state why you want your app to have access to those protected features.

App crash investigations

Your app will crash and you may not know exactly what was the cause. Unfortunately, Swift Playgrounds cannot read the app crash logs that iOS collects so you will need to parse them manually. There is a lot you do not need and the cause may be hidden in the text but if you hunt around enough you can sus it out. To get the crash logs from an iOS device go to settings, privacy and security, analytics and improvements, then analytics data.

Getting testers

Reaching out to people is hard and thankfully I had a few photography friends with iPhones that were able to help out. Use your connections be brave and reach out, and be honest about your product. Most people will be chuffed that you are asking for their input or you just won’t hear back from them at all!

The Review Process

There are a lot of steps necessary to get to the review and I am not going to go over all of them, but you should start by logging into App Store Connect and setting up your account for the new app.

You need to create assets for the App Store in a variety of screen sizes (this is a headache). The screenshots have to be exactly the correct size for various devices. On Xcode it’s pretty easy to create these by selecting a different device to simulate under. On the iPad swift playgrounds you cannot do this so you need to use physical devices like your iPhone and iPad, then you need to scale the images for any devices you do not own.

I used this app-mockup website that allows you to create screenshots of the correct sizes. It also has some nice templates and color ways to get you started. Its free and I found it really useful.

https://app-mockup.com/

Setting Pricing, I can’t tell you how much to charge for your app. Most apps now use the free plus in app purchase model that allows the user to try out the app and only pay if they want more features. With swift playgrounds on the iPad you can’t add the in app purchase options so I went with a pro purchase app and a stripped down lite app that was free.

You need a website to host your app usage agreement as well as terms and conditions. There are services that will host it for you but a dedicated website or your personal website looks a bit more professional.

Notes

Find your target audience, admittedly I am not great at marketing and barely know the basics. I try and build things I would want to use that way at least you know you want to use them haha!

Conforming to the apple expectation (ux expectations) is really hard. Apple pays huge salaries to amazing engineers and the usability of apple products is one of their top strengths. When you build an app for that ecosystem your users will expect things to conform to the apple standard. So if for example you show and image users will expect to able to swipe to the next one just like in the photos app. So just be cognizant of what users with expect to be functional.

Swift has a really cool way of adding libraries of code to your app called packages. Thankfully you can do this on swift playgrounds. Adding a swiftpm in swift playgrounds is as easy as including a link to the GitHub. Just hit the ass file then select swift package.

Laying out custom views and handling orientations can be quite difficult. On swift playgrounds you cannot force orientations you have to expect all of them. This makes camera applications difficult since the orientation and placement of the view you want to remain consistent.

Image processing is also surprisingly easy with apis even though a bit confusing and there are some great blog posts and code to help you get started. Make sure to experiment though since some of the functionality is not very well documented.

Code examples are very prevalent for almost any hurdle so just google around for help.

And finally shared resources are hard, like the camera, you need to handle lots of exceptions. This is because your code just asks the device to be able to use it or set its settings you can’t just force things as other apps may be in the background might want to access it as well when you switch apps.

Conclusions

I think the iPad has started to become more of a full fledged computer. I regularly pick it up over my laptop for most tasks, and with the amazing battery life it lasts me all day as well. I have used the iPad for so much more and I think it’s a great way to start learning about swift, apps, and more!

As with all good things, as you progress in app complexity, you will eventually bump into the ceiling of limitations of swift playgrounds. But it’s quite easy to port the swift code into an Xcode project when the time comes.