General information when developing for iOS
In this tutorial a general development information for the iOS environment will be presented, covering topics such as project structure, accessing native capabilities using Apache Cordova, environment-specific & design resources and deployment.
An iPhone/iPad application that is developed by using IBM MobileFirst Platform comprises the following components:
- An Objective-C ("native") Main App Delegate is provided, and hosts an instance of a UIWebView component
- All application components, including the web code that the developer provides, are packaged into a single universal iOS application
If a source control management system is used (such as Rational Team Concert, Git, Subversion and so on...), see the user documentation topic: "Integrating with source control system".
Designing for iOS
Starting iOS7, the design language of the operating system has changed drastically.
It is therefore highly encouraged and useful for developers to consult the Apple iOS Human Interface Guidelines at https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/.
When developing for iOS, it is also useful to consult the iOS Developer Library at https://developer.apple.com/library/ios/navigation/.
iOS devices have various screen resolutions:
- iPhone 1/2/3/3GS – 320 x 480
- iPhone 4/4S – 640 x 960
- iPhone 5/5s – 640 x 1136
- iPhone 6 - 1334 x 750
- iPhone 6 plus - 1920 x 1080
- iPad 1/2/mini – 768 x 1024
- iPad 3/4/5 – 1,536 x 2,048
When displaying graphical elements on wider screens, iOS automatically scales images and fonts to the appropriate ratio.
For example, on a 640-pixel wide screen, a 100-pixel wide image is scaled by 640/320 (= 2) to 200 pixels in width, and the text that is displayed with an 18-pixel font is displayed with a 36-pixel font.
The following then falls under the responsibility of the developer:
- Ensure that images look good at all resolutions:
- Provide images for the environment with the highest resolution requirements.
- In the CSS, scale the image width to the lower resolution.
- In the previous example, provide an image with a width of 200 pixels, and in the CSS, scale it to 100 pixels. iOS scales it back by a factor of 2 to be 200 pixels wide.
- Make sure that text is displayed appropriately at all resolutions
- Consider specifying font sizes in ems, rather than in pixels.
Image file sizes differ depending on your iDevice. For more information, see the Apple iOS UI Development Guidelines for icon and image sizes.
The Apache Cordova framework can be used in iOS applications to access the native elements of a device, such as contacts, geo-location services, media services, or the accelerometer.
For more information about Apache Cordova development, see the Apache Cordova overview tutorial.
iOS application deployment is done through the Apple App Store.
Important: Before you build a production version of your application, make sure that the
worklightSettings property inside the application's application-descriptor.xml file is set to
Go through the App Store approval process.
Manage your apps on the App Store.