Ben Dodson

Freelance iOS, Apple Watch, and Apple TV Developer

The Divide #12 - Reboots

The 12th episode of The Divide podcast is now available in which we have a lengthy discussion on reboots, particularly in movie franchises like Spiderman, Batman, and that film by that director we’re not allowed to mention in front of Chris. In addition, we address some board game follow-up, tell you how to test a HTC Vive in the UK, and get all excited at the prospect of a new Red Dead Redemption game!

You can get The Divide from these fine outlets:

Don’t forget to leave a review on iTunes and follow us on Twitter via @PodcastDivide.

Emoji flags from ISO 3166-1 country codes (in Swift)

I’m working on a personal project currently that works heavily with country codes and the selection of countries. To make it look better, I wanted to use a flag icon for each country in the list. In the past, this would have been done with a load of imported images named something like “gb.png” but luckily there is a modern solution; emoji!

As of iOS 9.0, every ISO 3166-1 country now has a corresponding emoji flag1. The way to build them is also incredibly simple as you basically put the two letters together as joined Unicode characters. Benjamin Esham explains it like this:

What they did is both crazy and genius. Instead of assigning a codepoint to each flag, which is the obvious way to do it (and the way the rest of the emoji are encoded), the standard defines twenty-six “regional indicator symbols”, from U+1F1E6 REGIONAL INDICATOR SYMBOL LETTER A to U+1F1FF REGIONAL INDICATOR SYMBOL LETTER Z. In order to include a country’s flag in your text, you first look up the country’s two-letter ISO 3166-1 code and then write the two regional indicator symbols corresponding to those letters. A font with support for that flag treats the two-codepoint sequence as a ligature, replacing the combination with a single pictogram.

Let’s take the United States as an example. Its ISO 3166-1 two-letter code is “us”, so we need to use the codepoints U+1F1FA REGIONAL INDICATOR SYMBOL LETTER U and U+1F1F8 REGIONAL INDICATOR SYMBOL LETTER S. Combining these gives a symbol that renders in your browser as 🇺🇸.

Armed with this information, it is easy to write a basic function to turn a code like “us” into the corresponding flag emoji:

func emojiFlag(countryCode countryCode: String) -> String {
    var string = ""
    var country = countryCode.uppercaseString
    for uS in country.unicodeScalars {
        string.append(UnicodeScalar(127397 + uS.value))
    }
    return string
}

A great way of testing this is with an Xcode Playground which will allow you to quickly see the output like such:

If you use an incorrect code such as “en”2 then you’ll be given back the letters within boxes.

You can download my example playground from GitHub.

  1. Most were supported in iOS 8.3 but hidden from the emoji keyboard; iOS 9.0 added an extra 40 to complete the set including such places as Antarctica and Taiwan. They also added support for the EU flag. ↩︎

  2. England is not an iOS 3166-1 country and so there is no “en” code. There is a proposal for subdivisions to be supported so something like “gb-eng” would work but it is not accepted yet and iOS has no flags for places like England, Wales, or Scotland. ↩︎

iPhone 7 headphone predictions

I don’t tend to make many Apple predictions but I’ve been meaning to write about the rumour of the lack of a headphone port on the iPhone 7 for some time. It seems almost certain that the iPhone 7 will drop the 3.5mm headphone jack in favour of using the proprietary lightning port and this has caused a lot of consternation in the tech press. This is understandable as there are several issues with doing this:

  1. You wouldn’t be able to use headphones you already own (potentially very expensive headphones).

  2. If you were using lightning headphones, you wouldn’t be able to charge your phone at the same time.

  3. Whilst Bluetooth is an option, it can have lag (only annoying on video) and you have to remember to charge them.

The solution to the first problem is very simple; there will be an adapter accessory1 to allow you to plug 3.5mm headphones into the lightning port. I personally don’t have a problem with this; if you have expensive headphones and an expensive phone, the cost of buying an adapter is negligible really and it is unlikely to add any bulk as it’ll just be extending the cord that you’ll already be using. You are unlikely to buy an adapter to use the existing bundled EarPods as it is certain that Apple would bundle in some lightning powered EarPods so really the adapter is for those with existing expensive 3.5mm based headphones.

However, the other two issues are more problematic. There is an issue that you may very well want to charge your iPhone whilst listening to music via headphones and Bluetooth does suck when you are watching video as it is often out of sync by a few milliseconds. I own a pair of Beats Studio Wireless which connect either via Bluetooth or via a 3.5mm cable; I regularly use the cable when watching Netflix in bed as I find the lag incredibly irritating2. In addition, I can charge my phone at the same time.

Some people have proposed that the iPhone 7 could get conductive charging much like the Apple Watch but this seems highly unlikely to me; the amount of space required to do that is huge (compared to a 3.5mm jack) and it charges very slowly, especially with an iPhone 6 Plus sized battery.

I have two predictions which I believe solve these issues:

  1. The bundled headphones will be lightning but will have some sort of lightning passthrough so you can continue to power your device or use any other lightning accessory at the same time.

  2. There will be wireless headphones that will work with some new proprietary sync method3 but can also work with a lightning cable for both listening and charging. They would be called “AirPods” and would either be bundled as the lightning headphones or be available separately for something like £79 / $99. A recent patent that was unearthed would seem to indicate this as a solid option. Extra points to Apple if it is a custom wireless solution and it works with the Apple Watch 2.

Both of these proposals get around the charging issue and the Bluetooth lag issue. I think it more likely that we’ll get basic lightning headphones included and then have to pay for the fancier lightning / wireless ones but it isn’t outside the realm of possibility that they could be bundled. That said, I also wouldn’t put it past Apple to say “you can use headphones or you can charge your phone” similar to the “charge or use peripheral” attitude to the solo USB-C port on the MacBook4.

The only thing that seems certain is that the 3.5mm port will not be available; you’ll need to use either an adapter or whatever new headphones Apple release.

  1. Likely priced at $29.99 / £24.99 because they can. You’ll get a cheap version on Amazon for $9.99 / £6.99 within a month. ↩︎

  2. I couldn’t care less about audio lag for listening to music or podcasts as it really doesn’t matter and isn’t noticeable; it only affects video as 50ms of lag will mean that the actors lips don’t move precisely with their voice which is offputting. ↩︎

  3. They would probably use the “AirPlay” brand. ↩︎

  4. Which I own and have had no issues with. Interesting that it retains a 3.5mm jack though when a USB-C port on both sides would make more sense to my mind. ↩︎

Clinix

An iPhone app I worked on throughout 2015 has finally gone live in the App Store today; Clinix:

I worked with Clinix throughout 2015 as the exclusive iOS developer on their medical app. Clinix is a doctor-patient video consultation platform targeted primarily at the NHS. It provides patients with an Electronic Medical Records system that syncs automatically with their GP records. You can view and update allergies, medical history, and medications as well as make video appointments with your GP.

The app was built using Swift and interfaces with the OpenTok video APIs. I helped with the initial design of the PHP-based API and was integral in making UX decisions throughout the app.

Clinix is a free app and is available on the App Store.

Connecting To Host

I’m very happy to announce that a new podcast I’ve been working on with John Wordsworth has gone live today; Connecting To Host.

Connecting To Host is a (mostly) weekly podcast where we discuss video games from a strictly co-op / multiplayer point of view. We’ve released three episodes today:

  • FORCED: Specifically built for co-operative action, FORCED is an arcade RPG which takes you through a number of challenging arenas. Join us and find out more about “The Orb” and “Marking up Enemies”, two strong mechanics that make FORCED a fun little online game.

  • Torchlight II: Join us as we talk about our co-operative experience working through Torchlight II, an action RPG developed by Runic Games that was originally released at the end of 2012.

  • Titanfall: With the recent announcement of Titanfall 2 for Xbox One, PC, and PS4, we thought we would go back in time and talk about the original Titanfall and what it brought to the multiplayer shooter genre.

I’m really excited about this podcast and think it’ll be a great way for people to get co-op specific reviews from two long time game players who spend several hours a week playing online together.

You can get Connecting To Host from these fine outlets:

If you enjoy the podcast, please consider leaving a review on iTunes or letting us know on Twitter via @CTHCast; you can also suggest games you’d like us to review!

Our next episode will be on Saturday 23rd April 2016 and is all about Offworld Trading Company

Thoughts on ringtones

Today I spent a little bit of time making a new iPhone message tone1 and it reminded me of how terrible the entire ringtone system is on iOS. I have a number of specific issues:

Overpriced - most ringtones cost the same as a full song despite the fact they are shorter than the free preview on iTunes or they are a couple seconds of audio from a TV show or film. The pricing hasn’t changed since the ringtone store was launched in iOS 3 but the quality has definitely deteriorated with a number of dubious looking alert tones ripped from TV shows or YouTube videos.

DRM - as well as being shorter than a full song for the same price, they are subject to DRM whereas music is not. They’re also in a proprietary format so you can’t re-use them on non-Apple devices.

iTunes - you can create your own ringtones using GarageBand2 but the only way to get them onto your iPhone or iPad is to do a sync with iTunes. Eugh! We were supposed to have moved away from this when iOS 6 cut the iTunes cord but I couldn’t find any other way to get the *.m4r file over to iOS (I tried messaging it to myself and using Dropbox but neither option allowed you to then save it to your settings).

iCloud - for some bizarre reason, ringtones are not synced via iCloud in the UK so if you haven’t backed them up you’ll lose them when setting up a new device. There is no option to redownload them from iTunes and if you purchase one you’ve previously downloaded you will be charged (you don’t even get a “you’ve previously purchased this” dialogue like you do with music, tv shows, and movies). I’ve purchased a few tones in the past3 but none of them are available to me unless I pay again.

I don’t have a solution to this (apart from killing the ringtone store and allowing you to just use MP3 files) but it is an area of the iOS ecosystem that is definitely showing it’s age. At the moment, you either have the expense and DRM protected (with no redownloads) way of purchasing or you can jump through hoops making your own and trying to get them onto your device. I’m not sure how either is seen as acceptable.

  1. It’s Han Solo shouting ‘BEN!!’ from Star Wars: The Force Awakens ↩︎

  2. I’m specifically referring to GarageBand on the mac although I believe it is also possible with GarageBand for iOS. ↩︎

  3. I used to have the T-Rex Roar from Jurassic Park as the alert for my wife but she didn’t care for it; I now have Lando Calrissian saying “Hello, what have we here?” ↩︎

'Start Me Up' Interview

I was recently interviewed by Start Me Up about my work as a freelance app developer. You can read the full article on their website but I’ve also put their questions and my answers below:

What do you do for work?

I’m a freelance app developer for my own company, Dodo Apps.

In which country are you based?

The UK.

How long have you been doing what you’re doing?

Around 8 years.

How did you make the transition from full-time education to working in your sector?

My degree was in Politics and Philosophy so it shouldn’t have been a straightforward transition into the development industry. However, a few months after graduating, I found an advert for a job on Gumtree, interviewed in London, and then was given the job the day after.

Describe your career progression to date. How did you make progress after getting your foot in the door?

My first job in the industry was as a Junior Developer for a digital agency in London and I worked on website code (HTML, PHP, and JavaScript). Within a few months, I was promoted to Senior Developer and then Development Manager in charge of the entire department due to a combination of constant learning (I read a ton of coding and management books) and people leaving the company. A year or so later, I moved to basically the same job at a different agency but I didn’t enjoy it - too many meetings, not enough actual work!

It was around that time (early-2009) that the App Store was gaining traction and I was starting to tinker with iOS development in my spare time. I made the decision to quit my job and go freelance and I’ve been doing it ever since. The actual step of going freelance was as simple as buying 2 books on app development (which were leaving presents from my previous job) and updating my website where I was already doing a bit of web development freelance on the side. My “big break” happened a few weeks later when Channel 4 asked me to appear on the Gadget Show and build an app for them - I agreed (despite having no clue what I was doing) and that helped me get more hits to my website and pick up some big clients like Sainsburys.

Since leaving full-time education, have you pursued any professional qualifications? Do you need to in order to succeed in your sector?

I’m often keen to go out and get some more qualifications but I don’t need them. My degree is in Politics and Philosophy but I’ve never lost a client because I wasn’t qualified - a good portfolio to show you have the skills is worth more than any qualification.

Describe a typical day in your job.

I work from home, so my day tends to vary massively depending on my mood so I’ll describe the ideal I shoot for.

My wife has to head off to work at around 7am, so we typically get up just after 6am. As soon as she’s gone and I’ve finished clearing up breakfast, I’ll head into my home office and try and get a few development tasks done for my current client before checking email. I’ll typically break at around 9-10am to check email and update my todo list for the day and then I’ll continue on coding until lunchtime.

I like to get out of the house every day and so I’ll usually go for a walk after lunch and then do any non-development tasks that need doing; I tend to be tired in the afternoons so I get easier stuff done like replying to emails, doing my accounts etc - it’s not a good idea to do coding when you’re tired! My wife will get home around 5pm so I typically stop work at 4pm and play on the Xbox for a bit before she gets back.

When I had an online game that I managed (WallaBee), I used to work pretty much every evening and at weekends as most of my players were based in the US. Since I sold that business, I strictly do work from 7am-4pm on weekdays and I rarely check or reply to email outside of those hours. It has been a huge improvement to have that work/life balance back and means I typically get more done in my working hours as I’m refreshed.

What qualities are needed to succeed in your sector?

There are two key things in my opinion; creativity and good time keeping. Developers need to be incredibly logical, but I find that you’ll do better the more creative you are, as you’ll typically find solutions to problems more quickly (and the majority of development work is problem solving). Good time keeping is essential, especially as a freelancer, as you need to be able to accurately say how long something will take so you can get paid fairly but also so you don’t end up with more work than you can actually do.

Do you have any experience interviewing candidates for roles? What do you look for when employing people?

As a Development Manager, I interviewed around 150 people (70 of them for one job). I only look for one thing in an interview; potential. Development is a rapidly evolving business and so the way that things are done can change quickly; I always wanted to hire people who could adapt and that wanted to learn rather than those that looked good on paper but then were stuck doing something a certain way. In 3 years, I don’t think I ever hired someone with a degree in Computer Science for that reason.

What qualifications do people in your sector typically have?

Most people will have a degree in Computer Science (or similar) but I think this is pointless. Most institutions will be teaching something that is already several years old and buy the time you come to get a job the technology will be outdated. I personally prefer to hire interesting people that have a lot of extra-curricular activity on their CV than someone with a degree. The best thing I did at university was to join lots of societies and start learning coding to build their websites; that gave me a portfolio I could get an actual job with.

In terms of app development, more and more people are self-learning and so you don’t need a degree at all, especially if you are going to freelance.

How rigid is the hierarchy in your sector? Is it possible to accelerate your career with hard work and initiative?

Absolutely - my own progression from Junior Developer to Development Manager (in the space of a year) was nothing to do with time at the company or ticking boxes, it was purely based on demonstrating I could do the job.

One of my favourite anecdotes is something I started doing after my promotion to Senior Developer. The kitchen in our office was on the top floor next to the Sales Team and so whenever I’d go and get a cup of tea I’d chat to them and ask how their deals were going. One guy was showing me all his stats and pipeline deals and then stopped and said “wait, you’re not my boss!” - I smiled and said “not yet”.

The point was that after a short period of time, I was able to appear more like a manager and this ended up with me getting a management job relatively quickly. Another important factor was that I used to spend a lot of time reading books about management whilst commuting. This helped as, once I had a team to manage, I already had a lot of systems to put in place to demonstrate I could do the job.

Does your sector allow a healthy lifestyle, with time for family, exercise and relaxation?

It really depends on the company you work for. As a freelancer, I have an awful lot of time as I choose when I work (and if I decide I want the day off, I just do it). When I worked for a company, there was no reason you couldn’t do all of these things but I had a fairly long commute which limited my free time.

Does your job involve travel? If so, list some of the places you’ve visited.

It can do although I prefer not to do too much; I rarely meet my clients in person as I find that working in their office or travelling for meetings is a waste of my time. Most of my current clients are based in the US which is great as then I only have to do the occasional Skype call - my favourites are the ones that I just speak with via email.

That said, I have travelled to Norway, Sweden, and Spain in order to meet with clients or do presentations at conferences. There is a lot of potential for travel in the industry especially to the US.

How do you regard earning potential in your sector, relative to other sectors that require similar levels of expertise? Are people in your industry underpaid, overpaid, or fairly paid?

I think most people in my industry are overpaid. It’s very easy to drag a project out for a very very long time and get paid a large daily rate, especially when working for a large client. I had a lucrative contract with a big brand that was being paid at £500 per day and after 3 days of nothing but meetings I quit. They hired someone else and after 8 months they released an app that was utterly terrible and would take a developer around 1 week to build. Nice work if you can get it, but it’s not for me, which is why I won’t take on a project longer than 2 months.

Describe the outlook for your sector? Is it growing or struggling?

There’s actually two sides to it, depending on if you are working for a client or building your own apps. If you are doing client work, business is booming; everybody wants an app at the moment and so there are plenty of contracts available. However, if you want to build your own apps, it’s incredibly difficult to get recognised and very hard to charge the right price so you can recoup your development costs. It can be a real struggle.

Have you had a mentor? If so, explain how you’ve benefited.

Nope.

List any books that have influenced your career.

I started off doing app development thanks to the Apress series of development books - they were excellent at the time but I feel you’d be better off using online tutorials nowadays. Getting Things Done was a big influence for me in time management and my fairly ruthless approach to dealing with clients can be traced back to The Prince by Machiavelli, one of my favourite philosophy books.

List any online articles or videos that have influenced your career.

I don’t think I have any, apart from my own blog which seems a bit egotistical even for me.

What are your “go to” websites for news and information on your sector?

I follow a lot of websites via RSS. I’d say my top ones are Daring Fireball, 9to5Mac, MacRumors, and MacStories. I tend to get a general feel for the sector via Twitter, either in the few other developers that I follow or from people messaging me about interesting stuff.

One piece of advice for someone seeking to break into your sector?

Ignore everyone and do what excites you. There is no point in getting into an industry if you’re not passionate about it - if you are adaptable and willing to learn, you’ll succeed. Also, don’t use a recruiter (they’re awful) - apply for a position directly and demonstrate a lot of knowledge about the business.

The Divide #11 - 3D Printing

The 11th episode of The Divide podcast is now available in which we discuss 3D printing with a focus on John’s experience of the Da Vinci AIO 1.0. In addition, Chris has some updates on DC Rebirth, John is interested in the Xbox One development kit, and I propose an experiment in the measurement of canine happiness…

You can get The Divide from these fine outlets:

Don’t forget to leave a review on iTunes and follow us on Twitter via @PodcastDivide.

HomeKit, Wink, and Canary

A couple of weeks ago I took the plunge and bought a Canary, an internet-connected personal security camera and air quality monitoring system. It has been working great so far and comes with a decent iPhone app that allows you to control the camera and have it activate automatically based on location. There are three different operating modes; armed, disarmed, and privacy. Whilst armed, you’ll get a notification when any activity is detected whereas disarmed will still record and store any video when there is motion but it won’t notify you1. Privacy completely shuts off the camera and microphone.

For the simple reason that I don’t want everything that happens in my living room whilst I’m in it to be streamed to a 3rd party server, I have set the iPhone app to switch between armed and privacy modes; this means that if nobody is in the house, it automatically arms itself but will shut off the camera and microphone as soon as a family member gets back home. The problem with this is that the camera is then in privacy mode when we go to bed as obviously our phones are still in the house; if somebody breaks in, we won’t have any video evidence. I can open the iOS app and manually arm the Canary but Sod’s Law means I’ll probably get an intruder on the night I forget to do that2.

My first thought was a scheduling system could be put in place to automatically arm and disarm the Canary if I’m in the house but the app doesn’t have that functionality and there is no public API. I then discovered that Canary have partnered with Wink, a platform that allows multiple devices to connect together so you can do things like have the lights turn on when motion is detected. This is really useful and does allow for the sort of scheduling I’d envisioned, but then I came up with a better solution; tying it into my existing HomeKit routine.

I’ve blogged about HomeKit before and specifically about Homebridge which allows you to get non-HomeKit enabled devices to work with the system. Canary is not a HomeKit enabled device and with no open API it wasn’t possible for me to write a plugin. However, Wink does have an existing Homebridge plugin allowing you to control most devices connected to Wink via HomeKit. Unfortunately, HomeKit doesn’t support cameras and so neither does that Wink plugin. Back to the drawing board!

After a bit of tinkering, I realised I could just re-purpose an existing supported HomeKit protocol; locks. In HomeKit, locks are basic binary operators that are either “secured” or “unsecured”. This works perfectly for my Canary as I could denote it as a doorlock and then have “secured” equal “armed”, and “unsecured” equal “privacy”. After a few minutes, I managed to fork the existing plugin and create a new version with this hack in place. Once downloaded, you just need to add the following platform in your Homebridge config file:

{
    "platform": "homebridge-wink.Wink",
    "name": "Wink",
    "client_id": "quirky_wink_android_app",
    "client_secret": "e749124ad386a5a35c0ab554a4f2c045",
    "username": "YOUR-WINK-USERNAME-HERE",
    "password": "YOUR-WINK-PASSWORD-HERE",
    "hide_groups": [],
    "hide_ids": []
}

(Sidenote: most of my time tonight was spent trying to find a client_id and client_secret to use for the config. To get these, you usually have to email Wink with response times being around 7-10 days. I decided to rip it out of the Android app instead…)

Once you restart Homebridge, any of your Canary devices in Wink should show up in HomeKit automatically. You can then say something like “Hey Siri, lock the living room” to arm the Canary. I personally like to use HomeKit scenes which allow me to control the Canary automatically with my existing “good morning” and “good night” Siri phrases. I find this much more reliable than a schedule as I already use these phrases every time I go to bed and wake up in order to turn my lights on and off (whereas a schedule might turn the camera on whilst we’re still awake or turn it off before we get up).

Hopefully in the future we’ll see a public API for Canary and support for cameras in HomeKit so I can make this slightly less hacky but it works for now and means I’ll no longer forget to disable privacy mode at night. If you’re interested in trying this setup yourself, check out the plugin on GitHub.

  1. The use case for this is things like capturing a babies first steps, the sort of thing you could easily miss but can easily find in the 12-hour log of a practically always-on camera. ↩︎

  2. And I often forget to turn it off when I get up which means my wife and I get a notification of me groggily letting the dogs out every morning. ↩︎

The Divide #10 - Let us loop you in. Again.

The 10th episode of The Divide podcast is now available in which we discuss Apple’s ‘Let us loop you in’ event1. Chris has a rant about his internet provider (before promptly being disconnected), I talk about Twilight Princess HD, and John gets excited about a box of replacement Apple Pencil nibs…

You can get The Divide from these fine outlets:

Don’t forget to leave a review on iTunes and follow us on Twitter via @PodcastDivide.

  1. Where my big prediction of “there will be an updated processor for the Apple Watch” proved utterly incorrect. ↩︎

« Older Entries Newer Entries »