Make an app for iOS - Easily

Could we have a show of hands for those that are looking for making a mobile app, Robust and Easy. Many of the developers have been through the Objective-C path and found the light at the end of it in lua based frameworks. I must admit that having a lua based framework to work with is in-fact much more easy than many of the C based languages. So how can a developer make apps that are easy and robust?

I must say that amongst choice of languages, C++ is perhaps the most difficult beast of them all but if used correctly can offer the maximum power and performance. Now wouldn't it be nice to have the speed, performance of C++ but not the overheads of learning the language and it's nuances? When I started off with developing for the iOS, I had to embark upon using objective-C and I will be entirely honest that though I had a mac about a year prior to creating my first app and having downloaded the Mobile SDK on Tiger, I never got around to doing anything, the reason being... I just could not understand or rather read an objective-C program. I had worked with C++, C, Visual Basic, Clipper, Pascal, etc but I still could not understand why did the code have a + or a - and square brackets and colons. Having said that, When I did bite the bullet and start with Objective-C, I found a pattern, It was almost that I had to have some code for particular routines and that would take care of stuff, I learned where to write what to make it work. Now that was not enough to actually make applications. Plus when I took help in learning Objective-C, I was told everything is an UIView, so if I wanted to write Tic-Tac-Toe, I had to have several UIViews. Later did I learn that there are other options that can be used like Layers and Drawing on the UIView. This was not enough to really write an app that was not UIKit based, and my first few apps were game type apps. When I look back on my code from RoboRun, I can see that I was finding it difficult to get sequential execution, which means that a function is called only after it finishes to execute. There were no in-line blocks available at the time either. UIBuilder is an amazing app that comes with xCode but since it did not really connect automatically to the code, it was just too much to drag lines from UIBuilder to the code, etc. Connecting the UI elements to code was perhaps a bit too much. I was so used to building my own via code, so I did not really use the UIBuilder as much.

Every so often I would look for an alternative to xCode and Objective-C, during this quest I came across several alternatives that offered a free trial and somewhere down the line I got hooked on to a Lua based framework. I must say how exciting it was to work with Lua, one of the biggest advantage was there was no more memory management, I did not have to allocate and retain or release the same. I could just work with what I wanted. Plus Lua being a scripting type language offered a bit of relaxation even in the coding and the more I have been working with it, the more I find it growing on me in terms of ease of use. However there is always a good thing and a not so good thing. In terms of a specific Lua based framework, the not so good thing is that it is very slow in terms of adding new features, features that work or are core features. I will have to give them that it could be also due to the fact that their framework is based on OpenGL and that is what might be posing issues for them in providing new features. However having said that, the question in my mind was, can I harness the power of Objective-C or C++ and use Lua to write the code?

I came across Wax, I guess I have had an article a while ago on HowTo and Wax, well, first I'd like to highlight a few very important changes that have taken place with xCode. Apple has *maybe* understood that the developers are shying away from xCode and objective-C as not every one is a developer and not every one has studied computer science. So surprisingly, in xCode 4.x they have added some amazing features like segues and storyboard, they also have ARC (Automatic Reference Counting) and in-line functions that are also called lambda functions of as Apple calls them, Blocks. So the point that I am trying to make here is that it is infact easier to develop a business-y app for the iOS range of devices using xCode and objective-C than it was a while ago. And if you use the Wax libraries, you can even have it scripted via Lua which makes things very easy. If you are also looking to create graphical apps, not physics based ones, just the ones where you might want to layer images and graphics, it is quite easy to do so using objective-C. I am looking for some time to write up a tutorial on how to use xCode to build a graphical app similar to using it when working with a Lua based gaming framework.

If you still feel feel that you might have the need to have a native Lua based development then there are a couple of options in the form of CoronaSDK, Gideros and MoaiSDK all of these are Lua based frameworks.

Lastly, while I am writing this book on using a Lua based framework, I found how much pleasurable it is to work with Lua and how powerful it can actually be, but the one thing that actually makes a difference while writing code is the way the code is structured. While Gideros and Moai use and promote the use of classes and objects, code written in CoronaSDK is more spaghetti type code, and I must admit that I am also guilty of the same. Maybe it stems from the fact that Lua is a scripting language and the sample code available for the platform is generally findings from another user that had been hard at finding something for their own personal problems. I personally feel that it makes a great deal of a difference in coding based on principles as in C++ (object-based) as compared to a flat structure.

Lastly comes the bit on pricing, It is surprising that despite everyone wanting to make a buck off creating frameworks, there is a wide bouquet of options available for developing for the iOS platform, if you are specifically looking for a framework that cater to multi-platforms, even with those options, there are a couple of offerings and oh, I forgot to mention, these are FREE offerings that I am talking about not the paid ones.

So what can we take from this article, what am I trying to suggest here?
It is quite simple, I am suggesting that there are plenty of options for developing for Mobile devices. Many of these are offered for Free. Of these there are a fair few that make it really easy to develop and use scripting languages, some use JavaScript while some others use Lua. My only qualm with JavaScript is that it is not compiled into bytecode and I shy away from HTML. I am also suggesting that while writing your code, it is better to write it a bit more structured than the flat spaghetti code style that has been suggested and made popular by one of the offerings. It may be easy for a beginner to pick up on this, but then the beginner will unfortunately always be stuck in that stage and might rise maximum to an intermediate level developer if they are really lucky. Lastly, I am also suggesting that if you are exclusively concentrating on iOS apps only, then xCode is a very viable option plus it is from Apple and there are tons of videos from Apple on how to use it and the various features offered. If you want something that will take away the objective-C factor and would like to work with something that is more Lua like, then there is a solution in the form of Wax, if you are writing games then there is a Lua+Cocos2D based library Kobold2D, these are all free and there is a community and support from the developer(s)

It's a new year, how about a little adventure and exploring a few possibilities, your interest in development might have been piqued by some, how about taking it another level and trying on xCode? Think of it as moving from Primary School to High School, not easy at first but then you are awaiting graduation to go to University.

It would be nice to hear stories of how many developers have actually started with trying to read on Objective-C and then giving up and taking to alternatives and how many actually either persisted or returned to Objective-C. Also keep an eye for a series of articles on how to use xcode to create apps, specially if you are coming from a background of using Lua based frameworks and on how to use Wax to write your code in Lua with xcode.


  1. Thanks for this article.

    In response to oyur last paragraph, I started with Obj-C and then another programmer said why not use something easier if it's available and suggested Corona. So after trying out other SDK's I did try Corona and it is easy. So I've been using that almost a year but out of frustration have stopped on a couple of occasions and looked back and at other SDK's (Gideros, I2TD) -- because of the limitations of Corona and because of some of the issues you described in another article. I too am wary of becoming dependent on one tool. I understand they're still young, but that's not really my problem is it? ;)

    I'll be keeping a close eye on your xcode tutorials!

    Thanks for all your contributions and help.



Post a Comment

Popular Posts