Voice of Cricket app for iOS

Why update this app?

A few years ago I created an app for iOS called Voice of Cricket.  It’s a sport app that reads out cricket scores – it’s pretty cool and the old version still worked on iOS 12 but I wanted a couple of new features.  So seeing as it is the Cricket World Cup in England and Wales in 2019 and the last update was in 2016 I thought it was time to give it a small update!

So my thoughts went a bit like this:

  • I’ll need to update Swift versions – how hard is that going to be?
  • I need to update the defunct iAd framework to Admob (Google)
  • I want to add an in-app purchases (IAP)

I’m a bit rusty with XCode and Swift so I figured it would take two days or so to upgrade the app and then a day or so to change the adverts and get the IAPs in place.  I also remembered that the Xcode app signing and app store submission process used to be quite a challenge so I further estimated an extra day or two for tidying up, bug fixing and app submission.

Automatic app updating with Xcode

One thing you’ll know if you’re a veteran of updating iOS apps is that Xcode doesn’t support very (and by that it’s usually over a year) old versions of the programming language for upgrade purposes.  So you’ll be able to upgrade Swift 2 to 3, or 2 to 4 but mine was Swift 2 or Swift 3 and I wanted to go up to Swift 5.  You can sometimes work around this by installing a bridging version of Xcode to do the conversions – and I tried this – but I didn’t have much success with this process so in the end decided to create a new app and copy the code across in piecemeal fashion upgrading as I went.  I could do this as the app is really simple.

Upgrading to a new Swift version

Swift 5 has some nice features and seems somewhat inspired by javascript frameworks when it comes to handling in particular shown by the use of closures.  These work well and can tidy up your code if you’re used to working with asynchronous callbacks. However before I got to the joy of using closures I quickly got annoyed by a number of things – firstly the number of Apple API changes which had of course happened in the last few years, secondly the way that the new method calls had changed how Swift interacts with them (and the amount of boilerplate required), and also how much boilerplate code was required with all sorts of method stubs including closures.   A lot of these is down to the way that the Xcode editor handles it rather than the language itself per se but it can be very frustrating.

XCode 10.2

XCode in 2019 appears to be in a holding pattern.  It’s got a lot of bugs in the text editor – cut/copy and paste doesn’t work well at all and the editor regularly gets confused and complains about extra hidden characters. The IntelliSence (or Apple equivalent) works well for new functions but with existing functions (for example when you’re updating an old app) it gets horribly confused and can completely screw up your code. On the plus side the integration with iTunes/iTunesconnect is now much improved – previously there could be many issues with certificates, developer profiles and assigning devices for development work or testing.  These now seem completely fixed and working with devices, provisioning profiles, publishing your app to the store goes a lot more smoothly than previously.  The Interface Builder in Xcode 10.2 is much the same as it ever was – twitchy, sensitive and prone to making mistakes for you.  Additionally adding constraints to UI items is as difficult and error prone as ever – now I’m no expect with Interface Builder, I can get something working but not brilliantly but I think that this thing could be easier to use!  All in all – Xcode is a tool you usually have to work around rather than work with.  It does some nice stuff but sometimes the basics are woefully lacking.  You’ve been warned!

Going to AdMob and Using Pods

Back in 2016 Apple killed their own add platform – iAd. My app used iAd and I never got around to updating it to another advert platform – nicely losing out on all potential revenue for the intervening few years!.  To replace it I decided to use Admob from google.  Integration is pretty simple – although it would have been simpler but the pod file way of working with AdMob didn’t want to work with me so I had to use the manual installation.  After that it’s pretty simple to integrate.

In App Purchases (IAP)

I wanted a single IAP that would allow the user to remove the adverts.  The IAP process for iOS12 is complicated and there are no short cuts.  This took me a single day of effort by itself but thanks to some great resources from Ray Wenderlich and the Swifty Store Kit on GitHub it wasn’t too hard from a technical point of view.  The real trick is to get the Test Users setup in iTunes connect – you’ll need unique email addresses or aliases in order to set up your test account and then you’ll require some patience and perseverance to get this working on your test device.  Not for the faint hearted!

Finishing Up

So finally it’s all working and tested – fully converted and the new features are in place.  As per usual with an Apple App Store submission you need to add some screenshots at as many resolutions as you can – the UI and the new (to me) Media Manager helps you with this.  Additionally you’ll of course need to build and upload your IPA file archive and then ensure it conforms to all the necessary requirements for store submission.  This work is also a lot of boilerplate clicking and typing but it soon becomes second nature after you’ve done it a few hundred times 😉

Now the app is submitted and we wait to see what happens next.. and how long this will take?  Sometimes in the past it would take up to four or five days to even get to review, nowadays it’s seemingly a lot quicker.  I’ll update this post with the results once it’s out there.

A Final Note

So I estimated maybe four to five days to get the app upgraded and pushed into the store – how long did it actually take me?  Well it so happened the ICC Cricket World Cup started around the same time as I started working on the app.  I started on Friday 31st May 2019 and submitted the update on June 5th.  So that was pretty much 6 days effort for an old, simple, Swift 2.x/3.x app to be upgraded and essentially rewritten.  If you were working with a more complex app and had more experience with this upgrade path (knowing what I know now) I think I could take a day or two off that time.  So I’d say not completely impossible but you need to be organised, be patient and be ready to be confused all over again by Xcode and some of the things that Swift has turned into.  Hopefully going forwards future updates will be a lot quicker and simpler but let’s see if it gets accepted for sale first!  Next challenge is porting the whole thing to Android on Kotlin…