iOS Developer Library — Pre-Release

Developer

UIKit Framework Reference UIKit Constants Reference

Options
Deployment Target:

On This Page
Language:

UIKit Constants Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import UIKit

Objective-C

@import UIKit;

This document describes constants that are used throughout the UIKit framework.

Constants

  • Defines a set of edge insets where all of the values are 0.

    Declaration

    Swift

    let UIEdgeInsetsZero: UIEdgeInsets

    Objective-C

    extern const UIEdgeInsets UIEdgeInsetsZero;

    Constants

    • UIEdgeInsetsZero

      UIEdgeInsetsZero

      A UIEdgeInsets struct whose top, left, bottom, and right fields are all set to the value 0.

      Available in iOS 2.0 and later.

  • Defines an offset where all of the values are 0.

    Declaration

    Swift

    let UIOffsetZero: UIOffset

    Objective-C

    extern const UIOffset UIOffsetZero;

    Constants

    • UIOffsetZero

      UIOffsetZero

      A UIOffset struct whose horizontal and vertical fields are set to the value 0.

      Available in iOS 5.0 and later.

  • Constants that specify the edges of a rectangle.

    Declaration

    Swift

    struct UIRectEdge : RawOptionSetType { init(_ rawValue: UInt) init(rawValue rawValue: UInt) static var None: UIRectEdge { get } static var Top: UIRectEdge { get } static var Left: UIRectEdge { get } static var Bottom: UIRectEdge { get } static var Right: UIRectEdge { get } static var All: UIRectEdge { get } }

    Objective-C

    typedef enum : NSUInteger { UIRectEdgeNone = 0, UIRectEdgeTop = 1 << 0, UIRectEdgeLeft = 1 << 1, UIRectEdgeBottom = 1 << 2, UIRectEdgeRight = 1 << 3, UIRectEdgeAll = UIRectEdgeTop | UIRectEdgeLeft | UIRectEdgeBottom | UIRectEdgeRight } UIRectEdge;

    Constants

    • None

      UIRectEdgeNone

      No edge.

      Available in iOS 7.0 and later.

    • Top

      UIRectEdgeTop

      The top edge of the rectangle.

      Available in iOS 7.0 and later.

    • Left

      UIRectEdgeLeft

      The left edge of the rectangle.

      Available in iOS 7.0 and later.

    • Bottom

      UIRectEdgeBottom

      The bottom edge of the rectangle.

      Available in iOS 7.0 and later.

    • Right

      UIRectEdgeRight

      The right edge of the rectangle.

      Available in iOS 7.0 and later.

    • All

      UIRectEdgeAll

      All edges of the rectangle.

      Available in iOS 7.0 and later.

    Discussion

    You can add these constants together to specify multiple edges at the same time.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • Type qualifiers used by Interface Builder to enable connection points between user experience elements and app code. For more information, see Connect User Interface Objects to Code.

    Declaration

    Objective-C

    #define IBAction void #define IBOutlet

    Constants

    • IBAction

      IBAction

      Type qualifier used by Interface Builder to expose a method as a connection point between user interface elements and app code. Used instead of a void return type in a method declaration. For examples of how to use this identifier, see Send Action Messages from a Control to Your Code.

      Available in iOS 2.0 and later.

    • IBOutlet

      IBOutlet

      Type qualifier used by Interface Builder to expose a symbol as a connection point for sending messages from app code to a user interface element. Used immediately before an object type in a property or instance variable declaration. For examples of how to use this identifier, see Send Messages to a User Interface Object Through an Outlet.

      Available in iOS 2.0 and later.

    Discussion

    For more information about how to use these constants, see Communicating with Objects. For information about defining and using actions and outlets in Interface Builder, see Interface Builder User Guide.