iOS Developer Library

Developer

UIAApplication Class Reference

Options
Deployment Target:

On This Page

UIAApplication

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable Not Applicable

Availability


Available in iOS 4.0 and later.

The UIAApplication class allows access to, and control of, app-level user interface elements.

For an explanation of how to use this and related classes, see Automating UI Testing in Instruments User Guide.

  • Returns the action sheet.

    Declaration

    JavaScript

    (UIAActionSheet) actionSheet()

    Availability

    Available in iOS 4.0 and later.

  • Returns the alert.

    Declaration

    JavaScript

    (UIAAlert) alert()

    Availability

    Available in iOS 4.0 and later.

  • Returns a string containing the app’s bundle ID in reverse-DNS format.

    Declaration

    JavaScript

    (String) bundleID()

    Availability

    Available in iOS 4.0 and later.

  • Returns the app’s edit menu.

    Declaration

    JavaScript

    (UIAEditingMenu) editingMenu()

    Availability

    Available in iOS 4.0 and later.

  • Returns the interface orientation.

    Declaration

    JavaScript

    (Number) interfaceOrientation()

    Discussion

    Interface orientation represents the rotation required to keep the interface right-side up upon device rotation. Note that in landscape mode, device orientation and interface orientation are opposite, because rotating the device requires rotating the content in the opposite direction.

    Availability

    Available in iOS 4.0 and later.

  • Returns the app’s keyboard.

    Declaration

    JavaScript

    (UIAKeyboard) keyboard()

    Availability

    Available in iOS 4.0 and later.

  • Returns the object that represents the app’s main window.

    Declaration

    JavaScript

    (UIAWindow) mainWindow()

    Availability

    Available in iOS 4.0 and later.

  • Returns the app’s navigation bar.

    Declaration

    JavaScript

    (UIANavigationBar) navigationBar())

    Availability

    Available in iOS 4.0 and later.

  • Gets the value of a specified app user preference.

    Declaration

    JavaScript

    (NotTyped) preferencesValueForKey(key)

    Parameters

    key

    The key representing the preference to be set.

    Availability

    Available in iOS 4.0 and later.

  • Sets the value of a specified app user preference.

    Declaration

    JavaScript

    (undefined) setPreferencesValueForKey(NotTyped value, String key)

    Parameters

    value

    The new value to set for the specified preference.

    key

    The key representing the preference to be set.

    Availability

    Available in iOS 4.0 and later.

  • Returns the app’s status bar.

    Declaration

    JavaScript

    (UIAStatusBar) statusBar()

    Availability

    Available in iOS 4.0 and later.

  • Returns the app’s tab bar.

    Declaration

    JavaScript

    (UIATabBar) tabBar()

    Availability

    Available in iOS 4.0 and later.

  • Returns the app’s toolbar.

    Declaration

    JavaScript

    (UIAToolbar) toolbar()

    Availability

    Available in iOS 4.0 and later.

  • Returns a string representing the build version number of the app.

    Declaration

    JavaScript

    (String) version()

    Discussion

    The build version is represented by a string comprising three period-separated integers.

    Availability

    Available in iOS 4.0 and later.

  • Returns an array of objects representing the app’s windows.

    Declaration

    JavaScript

    (UIAElementArray) windows()

    Availability

    Available in iOS 4.0 and later.