Many of the frameworks listed below are written in the C++ language. C++ is an object-oriented superset of C, much like Objective-C is. It is one of the most popular programming languages and can be used directly in your iOS programs.
- Source code header files always use the
- Source code implementation files written in pure C and Objective-C use the
- Source code implementation files written in C++ use the
- Source code implementation files written in in both Objective-C and C++ use the
C++ is a very powerful language that is less abstracted than Objective-C. This means that it will generally be more complicated but offer better performance. One of the main differences you might notice is that you’ll have to manually manage your memory (allocations and deallocations). However, most of the frameworks listed below include some type of reference counting.
openFrameworks is an open source C++ toolkit for creative coding. Its design is heavily influenced by Processing, which should make many of the functions familiar to you. openFrameworks was originally created for high-performance graphics and video processing, but can be used for a variety of applications.
A few years ago, openFrameworks was ported to iOS, allowing desktop applications to run on mobile devices without changing a single line of code. Many successful iOS apps are built with openFrameworks, such as SpellTower.
One of the strengths of openFrameworks is its large user base and their dedication to open source software. You can find a long list of contributed addons which can help you perform a variety of tasks. If you’re stuck on a problem, you can browse through the forum or post a new question, and it will most probably be answered within the hour.
You can download the iOS version of openFrameworks here and follow the setup guide to get started. This solution will create an app that is “openFrameworks driven”, meaning that most of your code (if not all) will be part of the openFrameworks project. Alternatively, you can use the ofxiOS addon, which treats openFrameworks projects similarly to other views, and keeps your app “Objective-C driven”.
Cinder is another creative coding library for C++. The main difference with openFrameworks is that it uses more specific system libraries instead of opting for cross-platform open-source solutions. This will usually result in better performance but is more complex to use and code. Cinder also makes heavy use of C++ namespaces, which can be confusing and hard to read. Cinder is aimed and experienced developers, so it’s harder to get into if you don’t know what you are doing.
The Mac version of Cinder can be downloaded here and includes compilation targets for iOS.
pocode is yet another C++ library for interactive media. Whereas openFrameworks and Cinder are all about high performance graphics, pocode’s strength lies in interface design. It borrows a page from Flash where every object has spatial properties (position, rotation, scale), built-in event handlers, and a cascading parent-child relationship.
pocode for Mac can be downloaded here and includes iOS templates and compilation targets.
C4iOS is the newcomer to the game, having only been released a few months ago. It is also a creative coding toolkit, but unlike the frameworks listed above, C4iOS is written in Objective-C. Instead of having to switch in and out of a special C++ view, you can simply use C4iOS objects directly in your code. As the name implies, C4iOS is also iOS specific and works seamlessly with multitouch interactions and gestures.
Although C4iOS still does not have a very large user base, it has very clear and complete documentation, including examples and tutorials. It’s also Canadian, so +1 for that
C4iOS can be downloaded from here.
Cocos2D is an open source game engine that has been ported to many different languages and platforms, including Objective-C for iOS. It only supports 2D, meaning that it’s a great toolkit to build a puzzler or platformer, but not ideal for a shooter.
Cocos2D simplifies the process of creating scenes in apps (for example a menu scene, a game scene, a high score scene, etc.) It uses OpenGL ES for rendering and can easily incorporate one of two robust and popular physics engines: Box2D and Chipmunk.
Cocos2D can be downloaded from here.
Unity is a multi-platform game engine with a port for iOS. It is the industry standard for developing high performance, complex games, and its $1500 price reflects that. You can however download a limited version free-of-charge, but will still need the $400 iOS plugin.
Unity projects are built in C#. It can be used to build 2D and 3D environments and includes a multitude of plugins for animation, modeling, physics, etc.