Initial Impressions with iOS and XCode

I was recently asked if I’d like to spend a couple of weeks working on a prototype iPhone application. Curious as to what the development experience is like for iOS I obliged and here are some of my impressions / thoughts from working with it for this short period of time. I’m sure some of my gripes are down to lack of knowledge so if you have any comments or suggestions please share them.

For some background I come mainly from .NET (predominantly C#) with most of my projects being web based and more recently I’ve done a fair amount of work with Silverlight and WPF. I have done a couple of Java projects and in my early days worked with Progress 4GL and completed a medium sized C++ project. For the prototype I have been running OS X Lion 10.7.3 with Xcode 4.3.3.

Using Xcode has been….OK. I’m often working on more than one project at a time so only being able to run one instance is a bit of a change for me, especially when trying to learn as I find it useful to go through samples as well as what I’m working on. I found the UI to be a bit cluttered but that’s in part due to the smaller screen estate I’ve been working with. I don’t really have too many gripes with the IDE though I found debugging to be a poor experience. I liked the ease of deploying to either the simulator or a connected device and things like being able to simulate GPS locations is a nice touch. It was also good to see local version control baked in from the start.

My favourite thing so far has to be storyboards. They’re a quick and easy way to visually layout and design your application including navigating through views. From searching around Google it seems that experienced iOS developers opinion on them is mixed but I found them very useful and was able to be fairly productive before even having to write a single line of code. It would be nice if it was easier to navigate around the storyboard using the mouse instead of scrolling or selecting a UI component from the side bar. I don’t usually use the design view in visual studio very often as I find it quicker to write directly to mark-up but this is something I enjoyed using. Having said that it would be nice to be able to add third party controls in the same way as the native objects rather than having to add them programmatically (I did this with the Tapku calendar control).

I also like the way that the MVC pattern is used though I found the model part, at least the controller model interaction to be lacking. As part of my prototype I was using a wizard style UI for entering data so the model was used on a number of views. I decided to use prototypes and delegates to pass the model around which works fine though I’m not sure of the best approach. I’d seen people using the NSNotificationCenter or using a singleton in the AppDelegate though they seemed less attractive. This was one of the few things I couldn’t find a decisive answer on as generally there was a plethora of useful information on stackoverflow, github, the apple developer site and various blogs. To persist the data I opted to use core data. This was nice and easy to use and I didn’t encounter any major issues though the NSManagedObject generation seemed a tad flaky.

One of the things that surprised me was some of the inconsistency with the UI controls. I expected things like the keyboard to automagically show / hide and to be able to set the accessory in the designer but apparently not. Gestures are also opt in generally, I guess it’s credit to some of the apps out there that I expected this default behaviour. This meant that I ended up writing more code than I expected to get some basic functionality working such as showing a picker on a button click rather than showing the picker (I hate that control, takes up way too much space) or populating a table view with the detail of a selected item.

Overall I’d say I’m still undecided. Maybe with a shiny new MacBook Pro I’d have more fun ☺. One of the biggest hurdles when working with something new is productivity. I know I’d be way more productive using familiar tools but it’s also fun to learn new things and I think I managed to achieve a fair amount in the short time I was given so I’ll definitely be on the lookout for more opportunities to work with the iOS platform in the future.