I have been beavering away in hostingireland.ie on a native iOS app for our clients to use for managing their accounts, ordering new domains, sending support tickets and so on. And now its live an up on the app store and has been covered by silicon republic read it here and will also quite possibly be at least mentioned in the Sunday Business Post. I hope that in the future, we will see lots of people using this app and also that we can add and improve on its features.

I was quite excited about this app as it gave me the opportunity to build something that I knew would be useful and also that would definitely end up on the App Store. With a pre built audience, I also knew it would see use.
As my friends know, I have built several apps for iOS but have decided for one reason or another not to publish them to the app store, well at least not yet anyway. Seeing this app on the App Store has given me a lot of confidence to complete some of my own projects and get them up on the store too. Watch this space :)

Now for some boring programming stuff

For any interested, I am going to run through some of my thoughts and decisions made while creating this app.
Web Api

The first steps to building the app, after planning out its features, was to build the web api.I used PHP for this as this is the language used in the company for most programming tasks.

This app required strong security and also easy extensibility. The app makes each request via https and uses two layers of authentication and validation. Easy extensibility was achieved by creating a set of abstract class which took care of a lot of the common business logic but left the variables and base implementation up to its concrete children by forcing the override of several abstract methods. The abstract api method controller also implements a method controller interface. This means I can easily extend the Api to add new features/methods in the future.

The App

Often when building apps with lots of options and data, you feel the need to have UITabBarController as well as a UINavigationController. This isn’t a template in Xcode but can be easily achieved by creating a RootViewController that extends UINavigationController for each tab option and then adding this controllers as the UITabBars controllers. Maybe an example would be good.

RootViewController * accountView = [[[RootViewController alloc]initWithNibName:nil bundle:nil] autorelease];
accountView.tabBarItem.title = @"Account";
accountView.tabBarItem.tag = TAB_CONTROLLER_ACCOUNT;
accountView.tabBarItem.image = [UIImage imageNamed:@"111-user.png"];

//Add as tabbar view controllers

NSArray * controllers = [NSArray arrayWithObjects:accountView,domainRegView,supportView,productsView,moreView,nil];
self.tabBarController.viewControllers = controllers;

In the root view controller you then have a switch which would look at the tag of the tabbaritem and push on to the stack the appropriate UIViewController.

Other difficulties I faced in the app itself included allowing the app to cache certain api call responses and deciding how and when an api call response should be refreshed. To achieve this I created a cache manager which exposed several methods to allow a cache to be checked, set to refresh or a new cache to be created. The aim of the cache was to reduce the potential number of requests being sent to the web server and to reduce any latency in the app wherever possible.

Another important factor was allowing multiple web requests to be made from the app simultaneously and without locking up the UI. To do this I created an extension of NSOperation which performed the calls on background threads rather than the main UI thread. I also created a protocol with methods it would call on a delegate based on the type of response sent back by the api. To allow easy use, I created an api method factory class which which was a singleton and had a handle to a shared NSOperationQue.

Overall it was a great experience building this app

Sorry, the comment form is closed at this time.

© 2012 Craig Brookes Suffusion theme by Sayontan Sinha