It seems like a forever ago since I released my last open source code, and, it is. Today, I’m happy to finally change that. I built a small UIPickerView subclass that lets users pick time the same way as UIDatePicker in countDownTimer mode does, but allows you as a developer to limit the input. It wasn’t terribly hard to implement but it did take some time, and since I believe that limiting the input is something a lot of people need, I decided to share it. I’ve been itching to open source something for a long time, and this seemed like a good fit. You can find the code on GitHub here.
App Previews were introduced at WWDC’14 as a new App Store feature on iOS 8 that will allow developers to include 30 seconds video showcasing their app in action, right on the App Store. I believe it’s a great way to really show off your app to your potential customers right in the moment when they are considering the purchase or download. In this tutorial, I will show you how to make those previews even better.
App extensions were introduced a couple of weeks ago during WWDC 2014 Keynote as a way to extend the reach of your app to some parts of iOS (8), for example by creating a widget that will show up in Notification Center, or a custom sharing action. It’s no doubt a huge opportunity for iOS/Mac developers, so if you have an idea for a widget/extension, I suggest you start working on it as soon as you can.
If you are a registered iOS/Mac developer, definitely watch the WWDC Sessions Creating Extensions for iOS and OS X, Part 1 and 2 here. You will have a pretty good idea of what extensions are, how do they work and what you can do with them. The first part briefly explains how you can share data between your extension and containing app using NSUserDefaults, but neglects to point out some ‘pitfalls’ that you need to avoid in order to get it working. That’s where this tutorial comes in.
Warning: as of writing this (end of June’14), the Xcode 6 beta 2 (that you need to use to build your extension) has some bugs that might cause you some annoyance, but you can generally track down and then avoid the certain actions/scenarios that make problems.
What are you going to build
We are going to build a simple Today extension (that’s the name for iOS 8 widgets in Notification Center) that shows a number that can be set from the containing app (and changes made in the app will be reflected in the widget in real time). We’ll use shared NSUserDefaults to accomplish this.