Preparing your application for iOS

The big benefit of using Cinder is the resulting multiplatform code. In most cases, your application can be compiled on Windows, Mac OS X, and iOS without significant modifications.

Getting ready

If you want to run your applications on iOS devices, you will need to register as an Apple Developer and purchase the iOS Developer Program.

How to do it...

After registering yourself as an Apple Developer or purchasing the iOS Developer Program, you can create an initial XCode project for iOS using Tinderbox.

  1. After running Tinderbox you have to set Target to Cocoa Touch.
    How to do it...
  2. It will generate a project structure for you, supporting iOS events that are specific for multitouch screens.

    We can use events for multiple touches and for easy access to accelerometer data. The main difference between touch and mouse events is that there can be more than one active touch points while there is only one mouse cursor. Because of that, each touch session has an ID that can be read from TouchEvent object.

    Method

    Describe

    touchesBegan( TouchEvent event )

    Beginning of a multitouch sequence

    touchesMoved( TouchEvent event )

    Drags during a multitouch sequence

    touchesEnded( TouchEvent event )

    The end of a multitouch sequence

    getActiveTouches()

    Returns all active touches

    accelerated( AccelEvent event )

    Vector 3D of the acceleration direction

See also

I recommend you take a look at the sample projects included in the Cinder package: MultiTouchBasic and iPhoneAccelerometer.

Apple Developer Center

You can find more information about the iOS Developer Program here: https://developer.apple.com/

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.28.80