Extending NSCoding

NSCoding is used often through many iOS, macOS, watchOS and tvOS apps, and usually results in instances that conform being archived into data for transportation or persisting.

So lets extend NSCoding so we can easily archive that object. It’s very simple but very useful:

Now any type that conforms to Archivable will have to conform to NSCoding and will also be easily archived by calling instance.archivedData. Because we’ve extended the protocol itself, all types that declare they conform get this behaviour for free. Neat ?

Where Does Apple Watch Fit In?

After getting my grubby fingers all over an Apple Watch since the 24th April I’ve had a fair bit of time to use it, both for personal use and for development of MacID.

During that time I’ve been asked time and time again:

What does it do? Is it worth it?

The answers I give to that are “everything” and “yes”, but I think what people really want to know when they ask is, “what is it good for?”.

To answer that, lets have a look at where Apple’s other products fit in to our lives. (This, of course, is circumstantial and just a generalisation).

The Mac, nowadays, is ultimately for creating content. OS X is still the parent of all other Apple products, and it’s still usually the easiest way of doing multiple things at once when you’re working on a project. The iPad tries to be a content creator, but in reality it still fails in many aspects. Sure, it’s good for a quick edit of a Pages document, but if you want to create a website, code an app, do some detailed design work, or write an essay, you still need to use a proper operating system with much more accurate input.

iOS on the other hand, is amazing for consuming content and communication. Twitter, Instagram, messaging, iBooks, listening to Music; these are all far superior on iOS. Again, you can do all of this on your Mac now, but engagement is much higher on mobile devices for this sort of content.

So, what about Apple Watch? I personally think Apple Watch will excel with utility apps. Apps which allow you to unlock your Mac or hotel room, board a plane, check your car’s current charge, book a cab, control your TV, or check off a shopping list. These all take seconds of your time for each interaction, and are perfect for the small form factor.

Once developers stop seeing Apple Watch as something they have to get their current apps onto, and start understanding where it will excel, Apple Watch (and other wearables) will start to become integral in our lives just like laptops and smartphones.

iOS 8 Feature Rundown

I thought I would run through some of the new iOS 8 features to help people make the most of iOS 8 right from the start. This is by no means a comprehensive list, but since I’ve been playing with iOS 8 since the beta and it’s now released I’m no longer governed by my developer licence’s NDA with Apple and can share them with you publicly.

I really don’t care how many of these are already on other operating systems, or jailbroken iOS devices. I’ve purposely not pointed out where some of these features have been implemented better than specific competitors, I’m just pointing out that they now exist and are really cool.



The entirely unnecessary “missed” section in the Notification Centre has now been removed. RIP.

Widgets can be added to the Today view and reordered by tapping the button at the bottom. Widgets have to be bundled with a functional app from the App Store so expect them to be from the likes of eBay, weather apps and Google Now etc to start off with.

Notifications can be actioned (where implemented, like the Messages app) by either pulling down on the notification, or swiping left and tapping and action on a notification on the lock screen.


iOS has (thankfully) ditched Yahoo! Weather as the API for the built-in weather. Now the Weather Channel’s API is used which shows more data like a 9 day forecast, and an icon has been added to the weather widget in the Today section of the Notification Centre. In my experience it is more accurate in England, however BBC weather is still the best. That said, now that apps can make Today view widgets, there’s nothing stopping BBC making one themselves now.


The default iOS keyboard now has a text prediction bar along the top, which can be hidden by swiping down on it or holding down the keyboard change key.

iOS now allows 3rd party keyboards to be installed which can be bundled by developers as part of an app distributed to the App Store. Security has been taken into mind and there are two types of keyboards, ones that ask for access to the Internet and your location and ones that don’t. It’s your choice whether you trust a keyboard that asks for Internet connectivity with your keystrokes. That said, Apple don’t allow any keyboards to enter into secure fields like password fields; although slightly jarring to be forced back into the default keyboard it does mean your passwords can never be captured by malicious keyboard developers.

App Switcher

Not a huge change but the App Switcher now shows recent contacts, and if you swipe right shows your favourites. Tap on one to call, text or FaceTime them.


iOS 8 comes with a built in Health app that developers can link their apps to. This is designed to give you a central point to view comprehensive health data. Health also uses the motion coprocessor in the 5s and newer to display information like steps walked throughout the day (which is always being detected by iOS) and will take advantage of Watch’s health features too. With the iPhone 6, this is supposed to give you elevation information too, such as flights of steps climbed.

HealthKit – the set of APIs Apple has created for developers to integrate their apps into Health – not only allows iOS to aggregate health data from multiple apps but also to share that data with other apps. So your sleep monitoring app could let your distance tracker know when you woke up.

Possibly the most important thing (for me) to be added to iOS 8 is the ability to add a Medical ID card to the emergency call section of the lock screen. This means you can add emergency contacts, your allergies, important health information such as blood type, and whether you’re an organ donor. This sort of information was usually hidden if you lock your phone with a passcode (which pretty much anyone with Touch ID now does), and if you’re in an accident this could save your life and get emergency services in contact with your family much quicker.


There is now a built in Tips app which new iOS users can check each week for tips on how to make the most of their new iDevice.


Most notably, you can now activate Siri by saying “Hey Siri” and immediately asking what you want it to do. “Hey Siri” works either when your phone is connected to power or when Siri’s screen is already open. (In my experience you have to flip the switch in Siri’s settings before you can use this feature.) You get near-live feedback of what Siri’s hearing you say now, too.

Siri can also now  utilise Shazam for song recognition, although I’ve only managed to actually get this to work a handful of times.


Messages sees some of the biggest changes in iOS 8, some of which you can’t really miss. You can now send Snapchat-esque audio clips, video clips and photos straight from the message thread. Hold down either the camera or microphone button and slide your finger upwards to send straight away. Clips can be set to expire and you get notified if the recipient has chosen to keep it, which coupled with the new ability to automatically delete old messages means you won’t get Messages taking up precious gigabytes on your iDevices.

You can choose to “Raise to Listen” to audio clips, and can also reply in the same manner, which effectively means you can have a phone call with someone without having to be on the phone at the same time, and might save some embarrassment of having to listen to audio in public. Like other notifications you can also reply to audio messages from the lock screen without having to unlock your phone.

On each message thread there’s a new Details button at the top. This brings up your friends’ location (if you have them added to Find my Friends), allows you to send them your location, mute the thread, and see every single picture you’ve sent them right to when the thread first started. These features all work with both single-person messages and group messages.

If you want to send a regular image from your Photo Library you just tap on the camera button in the message and now it’ll give you a scrollable list of recent images, let you bring up your whole Library or let you take a new photo or video. Anyone who’s used Tweetbot will know this is similar to (and better than) the super useful “use last image” function when sending a tweet.

If you’re lazy you can mark all messages as read too, from the thread list view just tap Edit and then Read All.

You can now name group messages, and can easily add or remove people from it, also in the Details section.


Spotlight search results can now additionally show you inline Wikipedia, web search and App Store search results.


A feature that Chrome for iOS has had for some time is the ability to request the desktop version of a website, which you can now do natively in Safari by tapping on the address bar, and then pulling down on your favourites. You’ll get two options; Add to Favourites and Request Desktop Site. The way this feature works on both Chrome and Safari is by changing the user agent of the browser. For anyone that isn’t savvy to web development, this basically means its an identifier that your browser sends the server to say what version it is, and can easily be modified. Some websites check this first to decide what sort of website to show you, but if it’s a purely responsive website (one that just reshuffled the design based on screen size) then you will have to just hope they’ve implemented a way of viewing the full website in their own website.

Safari can also now show you a more in-depth “Top Hit” as you’re searching and also link to apps in the App Store related to your search.

When you first open a tab or tap the address bar, underneath your favourites you’ll also now get a view of frequently visited sites.

Private sessions in Safari have gotten a little more sensible in iOS 8. Previously, if you tapped Private it would ask you if you wanted to close all open tabs or make them private too. Similarly when turning it off. Now it just opens the Private view of Safari, and shows you all your private tabs currently open. Tapping the Private button again takes you back to your regular tabs, and hides your Private ones.

There’s now a “Quick Website Search” feature added to Safari, which enables you to search within certain sites using the address bar. For example, you can type “Amazon Kitchenaid” and Safari will give you the option of searching Amazon for Kitchenaid products instead of just Google. This seems to only work once you’ve already made an initial search on a site sometime in the past, which adds it to the Quick Website Search list in Safari’s settings.

According to the release notes, Safari now automatically blocks App Store auto-redirects from within websites.

Safari can now take a picture of your credit card and autofill payment information on websites too.

Also, on iPad you can now see all tabs that are open, like on iPhone.


Akin to Photo Stream introduced in iOS 5 which is limited to the last 1000 images, you can now choose to store your entire photo library in iCloud, which will sync to every other iCloud device. You also have the option of optimising your iDevice’s storage by downloading optimised (read: lower resolution) versions of photos, or you can choose to download and keep originals. At this time, Photo Steam is also still able to be used alongside it, but I wouldn’t expect that to stay forever.

You can choose to upload Burst photos too, or just to upload the one that iOS chooses to be the best out of each Burst.

Photos in your library can now be favourited, which provides a slightly easier way to save your gifs for quick access. Deleted messages now go into a “Recently Deleted” album which get automatically deleted after a set amount of days. Each photo states how many days it has left before it’s deleted permanently automatically or you can choose to delete permanently manually from here. Although more cumbersome, it does mean you are less likely to lose photos by accident.

Editing photos in iOS has always been great, especially as it’s non-destructive (meaning you can go back and change it back to the original at any time), but it’s been enhanced in iOS 8. If you tap on the crop button, iOS will now automatically attempt to straighten your image. If you don’t like it, just spin the dial until it snaps back to 0, or tap the reset button. Straightening photos with this dial is much easier than using two fingers to spin the image as before.

Unfortunately there haven’t been any extra filters added in iOS 8, but you have far greater control over Light, Colour or B&W. Initially when you tap on one of these you’ll get a simple slider with a live preview of the effect, however if you tap the expand button you’ll get even more control. For example, expanding the Light setting means you can edit exposure, highlights, shadows etc all individually.

Anyone who edits images regularly in iOS will notice that it also now shows you the entire image, whereas before it always seemed to obscure some of it which could be frustrating.

You can now also search photos in your library, but this seems limited to locations, dates, and album names.

A slightly less useful feature for some may be the ability to hide photos from Moments, Collections and Years but still be visible in Albums. I’m guessing this is to make your Moments less cluttered.


It’s now super easy to create a time-lapse with the built in Camera app. Although lacking any options, it’s simplicity is actually quite nice to use. Tap to start, tap when you’re done, iOS will stitch it together for you. Hopefully we’ll see some options for shots-per-minute etc in the future.

The standard Photo and Square modes of the camera now have a timer option, letting you choose between 3 seconds and 10 seconds. Apparently you’ll also be able to use an Watch to use as a remote shutter, too.

You now have greater control over exposure while taking a picture too, after tapping on your subject a yellow ☼ icon will appear; you can drag this up and down to further fine-tune exposure.

If you’re one of those super annoying people that take pictures of stuff on holiday with your iPad’s shitty camera (WHY?!) then you can also now take panoramas with it too. Just rest assured you’re being judged by everyone who can see you.


iOS 8 makes adding recurring events to the calendar much more useful for custom periods. You can now choose to repeat it Daily, Weekly, Monthly or Yearly, and then choose how often. For example you can choose to have a bi-annual event repeat every two years, or even choose to have it repeat your local Farmers’ Market on the second Sunday of every month.

New calendar events can also use your location or search Maps for places, and also estimate travel time. You can even choose for it to mark you as busy for the estimated travel time; useful for shared calendars.


While composing an email you can now pull it downwards to get back to your inbox, useful if you need to check another email to know what to reply with. Swipe back up to continue composing it.

Mail will try and check your emails for important information, and if it thinks it finds some it will give you a quick way of adding that information to your calendar or address book at the top of the email.

You can quickly mark a message as unread by swiping right on it in your inbox, or swipe left to quickly flag, archive/delete or choose more options.

Family Sharing

Not something that I will be using just yet (unless my cat learns how to use iOS), Family Sharing is designed to be an easy way to share purchases with your family. Presumably this can be used for friends too, but the idea is that all devices use the same account for billing, and kids have to request approval from a parent to buy things, which just pops up on your device to approve or deny.

It’s also a way of sharing content among your household, be that music, films, photos and calendars. You can also find out where anyone in your family is.

You never have to share your Apple ID or passwords with each other, and you can use it to create IDs for kids under 13.


If you have more than one iOS device or also have a Mac (running OS X Yosemite), continuity is a set of really cool features that help you seamlessly transition between devices.

Handoff means if you start writing an email on your phone, you can finish writing it on your Mac at exactly the point you were on your phone. Likewise if you’re viewing a website on a Mac at home, when you leave you’ll be able to finish viewing that page on iOS. It’ll even scroll you to the point in the page you were to make it even more seamless.

SMS and call relaying to other non-cellular iOS devices and Macs means that when you sign into the same iCloud account on your devices, when they’re all on the same WiFi network you’ll get a prompt asking you if you want to allow your other devices to use your iPhone to make and receive calls etc. This was all automatic for me, and I’ve been texting my mum from my non-cellular iPad, even though she doesn’t have iMessage.

Instant hotspot means that your iPad or Mac will automatically try and use your iPhone to connect to the internet when you’re out and about.

Extra Stuff

On the lock screen you’ll now get App Store app suggestions based on your location. If you’re near a Nando’s or Eurostar at St. Pancras, it’ll suggest the accompanying app for you to open or download.

Much like Siri’s new live feedback of your voice, dictation now types what you’re saying while you’re saying it; previously you had to wait until you’ve finished speaking for it to process your voice.

You can now see battery usage info app-by-app in Settings > Usage.

iOS will let you know if an app has been using your location in the background, and asks you if you want to continue to let it.

AirDrop now works from iOS to OS X Yosemite.

Touch ID has been given an API for developers to use, so you can expect apps like 1Password and PayPal to start using it. To reiterate, Touch ID never actually gives your fingerprint data to iOS or developers, it just encrypts it in a special enclave on your iPhone’s processor. When you touch your finger on the sensor, iOS asks Touch ID “is this a valid fingerprint”, and Touch ID replies with yes or no.

Developers can now make extensions for apps for the first time, which means that apps can make small useful extensions for their main app to be used in other apps. For example, Pinterest can make a  “Pin” extension to use in a photography app. Apple have made this as secure as possible and extensions still cannot modify iOS or any other app directly.

You can now choose to ask iOS to send its location to iCloud/Find my iPhone when the battery is low, so if it’s lost and the battery dies you can still find it.

There’s a selection of awesome new wallpapers to choose from and Control Centre has been redesigned slightly.

You can now delete whole albums at a time from Music, just swipe like you would on a single.

When you bring up the share/action sheet (for example when adding a bookmark in Safari), you can now reorder the apps which appear, and also choose to hide them altogether. Hold down to reorder (like on the Home Screen) or tap More to choose which ones to hide.

Reachability is a feature reserved for the soon-to-be-released iPhone 6 and iPhone 6 Plus, which makes it possible to still use them with one hand. As they have bigger screens, it’s not possible for everyone to reach the top of the screen with one hand (especially the Plus), but by double tapping (not pressing) the Touch ID/Home button it will bring the whole screen down. Once you’ve tapped/gestured on what you needed to (like answering a notification), it returns to normal.

Lastly, HomeKit is another new API that Apple have created, designed to make it really easy for MFi (Made For iPhone) home equipment to integrate with iOS, so things like Nest and Philips Hue can take advantage of these APIs, and it even integrates Siri into being able to activate MFi gadgets. I’m personally hoping this means the Dyson 360 Eye will take advantage of these APIs!

Bring Back Swift’s Old Half-closed Range Operator


If you’re one of the many (many) people who dislike the change Apple made to the half-closed range operator, then rejoice, because with this snippet of code you can bring it back:

[Edit: there’s a better version of this code at the end, see it now.]

And then you can use it just like before:

This really just shows the power of Swift, in that we can define a lot of how we want it to work ourselves.

Here’s an updated version which is more concise: