IOS
Tips for Getting Started with iOS
I’ve had quite a few developers ask me for tips on getting started with iOS. The following are the tips and resources I wish I knew about before starting my own journey with iOS.
C99 Initializer Syntax in Objective C
This week a colleague sent me a snippet of Objective-C syntax I had never seen before.
Mobile Web versus Native Apps
The topic of mobile web versus native apps comes up quite often. The typical scenario is that of a company who already has a web presence and wants to bridge the gap to be more engaging to mobile users. The challenge is then to decide which platform (or platforms) to support.
The Problem with Interface Builder
Most iOS developers seem to have a love-hate relationship with Interface Builder: they will either use Interface Builder for everything or completely avoid it and do everything in code.
Using Multiple ViewControllers on a Single Screen in iOS
In the world of iOS we usually stick with a single ViewController per screen. In fact, this is so common that many developers are not even aware that it’s possible to use more than one ViewController on a single screen. I’m going to run through a quick example and then highlight some of the benefits and gotchas of using multiple ViewControllers.
Record and Playback Audio in iOS
On my last iPad project we needed the ability to record a sound clip and then play it back to the user with some visualizations. This is relatively easy with AVFoundation, but – as with many things in iOS – it takes quite a bit of boilerplate code to get it working.
Thoughts on Parse
Parse is a cloud-based storage framework for iOS applications. Parse supplies an SDK for your application that allows you to easily push and pull data from the cloud-based platform that they provide for you – it’s all included. With any kind of persistence on a mobile device comes the obvious problem of offline support – Parse solves this problem with delayed syncing and query caching.
Automated iOS Testing with Zucchini
This week I was looking for an appropriate testing framework for the iPad app I’m working on. I say ‘appropriate’ because the app is rather unique in that it’s very content driven and therefore it’s difficult to write tests that catch regression bugs. We had already integrated Frank and Kiwi into our app with limited success, but it’s rather difficult to write tests to see that animations are firing in the correct way or that a certain page has the correct background.
Literals in Objective C
Objective C is not a pure Object-Orientated language, which means you often need to convert between primitive/basic types (like char or int) and objects (like NSValue or NSNumber). This is usually rather tedious and results in large amounts of boilerplate code.
Extending classes in Objective C using Categories
Yesterday I had to perform the simple task of shuffling an array in Objective C. There is unfortunately no built-in method to do this (which is a bit strange) which meant I really wanted a way to add a shuffle method to the NSArray class. In C# I would use an extension method to do this, in Ruby I would use Open Classes and in Objective C we can use Categories.
Perform an action after a delay in iOS
Today I had to perform an action (play a sound file) when a user touches a button, but only do so after half a second had passed. Luckily iOS has very good support for this.
Logging a Frame in iOS
It happens quite often that you need to log the dimensions of a frame in iOS (which is a CGRect struct). Because you need to log 4 different values, it’s quite clunky.
Playing video in iOS
This week I had the interesting challenge of having to play a video in an iPad app. I basically needed to explore having a full-screen video play in the background while still allowing the user to interact with other controls rendered on top of the video.
Storing Data with NSUserDefaults
NSUserDefaults is a quick and easy way to store small amounts of data for you app. It basically acts as a key-value persistent store and is straighforward to use.
Doing callbacks with blocks in iOS
Callbacks are a very commonplace construct in the world of iOS. Today I was trying to pass a callback to a delegate class (which is another common occurence) and tried to explore the different options available.
Scrolling hides content on Mobile Safari
Over the past 3 weeks I’ve been working on a mobile website for a hybrid iPhone app. This has been quite a learning experience, both from the technology point of view (we used Spine.js mobile) and from the User Experience point of view.