UIKit Constants

Overview

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

Symbols

Constants

let NSAttachmentAttributeName: Stringlet NSBackgroundColorAttributeName: String
let NSBackgroundColorDocumentAttribute: String

The value of this attribute is an NSColor object representing the document-wide page background color.

let NSBaselineOffsetAttributeName: String
let NSCharacterEncodingDocumentAttribute: String

The value of this attribute is an NSNumber object containing integer specifying NSStringEncoding for the file; default for plain text is the default encoding. This key in options can specify the string encoding for reading the data. Upon return, the document attributes can contain the actual encoding used. For writing methods, this value is used for generating the plain text data.

let NSDefaultAttributesDocumentAttribute: String
let NSDefaultTabIntervalDocumentAttribute: String

The value of this attribute is an NSNumber object containing a float. Represents the document-wide default tab stop interval.

let NSDocumentTypeDocumentAttribute: Stringlet NSExpansionAttributeName: Stringlet NSFontAttributeName: Stringlet NSForegroundColorAttributeName: String
let NSHTMLTextDocumentType: String

Hypertext Markup Language (HTML) document.

let NSHyphenationFactorDocumentAttribute: String

The value of this attribute is an NSNumber object containing a float; 0 = off, 1 = full hyphenation.

let NSKernAttributeName: Stringlet NSLigatureAttributeName: Stringlet NSLinkAttributeName: Stringlet NSObliquenessAttributeName: Stringlet NSPaperMarginDocumentAttribute: String
let NSPaperSizeDocumentAttribute: String

The value of this attribute is an NSValue object containing NSSize.

let NSParagraphStyleAttributeName: String
let NSRTFDTextDocumentType: String

Rich text format with attachments document.

let NSRTFTextDocumentType: String

Rich text format document.

let NSReadOnlyDocumentAttribute: String

The value of this attribute is an NSNumber object containing an integer. If missing or 0 or negative, not read only; 1 or more, read only.

let NSShadowAttributeName: Stringlet NSStrikethroughColorAttributeName: Stringlet NSStrikethroughStyleAttributeName: Stringlet NSStrokeColorAttributeName: Stringlet NSStrokeWidthAttributeName: String
let NSTabColumnTerminatorsAttributeName: String

The value is an NSCharacterSet object.

let NSTextEffectAttributeName: String
let NSTextEffectLetterpressStyle: String

A graphical text effect giving glyphs the appearance of letterpress printing, in which type is pressed into the paper.

let NSTextLayoutSectionRange: String

An NSValue object containing an NSRange representing a character range. The default value is a range covering the entire string.

let NSTextLayoutSectionsAttribute: Stringlet NSUnderlineColorAttributeName: Stringlet NSUnderlineStyleAttributeName: String
let NSUserActivityDocumentURLKey: String

Key in the NSUserActivity object’s userInfo dictionary. Its value is the URL of the document associated with the user activity.

let NSVerticalGlyphFormAttributeName: String
let NSViewModeDocumentAttribute: String

The value of this attribute is an NSValue object containing an int; 0 = normal; 1 = page layout (use value of @"PaperSize").

let NSViewSizeDocumentAttribute: String

The value of this attribute is an NSValue object containing NSSize.

let NSViewZoomDocumentAttribute: String

The value of this attribute is an NSValue object containing a float. 100 = 100% zoom.

let NSWritingDirectionAttributeName: Stringlet UIAccessibilityAssistiveTechnologyKey: Stringlet UIAccessibilityFocusedElementKey: Stringlet UIAccessibilityNotificationVoiceOverIdentifier: Stringvar UIAccessibilityTraitTabBar: UIAccessibilityTraitslet UIAccessibilityUnfocusedElementKey: String
let UIApplicationBackgroundFetchIntervalMinimum: TimeInterval

The smallest fetch interval supported by the system.

let UIApplicationBackgroundFetchIntervalNever: TimeInterval

A fetch interval large enough to prevent fetch operations from occurring.

let UIApplicationOpenSettingsURLString: String

Used to create a URL that you can pass to the openURL(_:) method. When you open the URL built from this string, the system launches the Settings app and displays the app’s custom settings, if it has any.

let UIApplicationOpenURLOptionUniversalLinksOnly: Stringlet UIApplicationStateRestorationBundleVersionKey: Stringlet UIApplicationStateRestorationSystemVersionKey: Stringlet UIApplicationStateRestorationTimestampKey: Stringlet UIApplicationStateRestorationUserInterfaceIdiomKey: String
let UIApplicationStatusBarFrameUserInfoKey: String

A key whose value is an NSValue object that encapsulates a CGRect structure expressing the location and size of the new status bar frame. This key is used with UIApplicationDidChangeStatusBarFrame and UIApplicationWillChangeStatusBarFrame notifications.

let UIApplicationStatusBarOrientationUserInfoKey: String

A key whose value is an NSNumber object that encapsulates a UIInterfaceOrientation value indicating the current orientation (see UIInterfaceOrientation). This key is used with UIApplicationDidChangeStatusBarOrientation and UIApplicationWillChangeStatusBarOrientation notifications.

let UIBackgroundTaskInvalid: UIBackgroundTaskIdentifier

An token indicating an invalid task request. This constant should be used to initialize variables or to check for errors.

let UICollectionElementKindSectionFooter: Stringlet UICollectionElementKindSectionHeader: Stringlet UICollectionViewFlowLayoutAutomaticSize: CGSize
let UIContentSizeCategoryNewValueKey: String

A key whose value is an NSString object reflecting the new value of the preferredContentSizeCategory property.

let UIFloatRangeInfinite: UIFloatRange

A range whose range is minus infinity to infinity.

let UIFloatRangeZero: UIFloatRange

A range whose minimum and maximum are both 0.0.

let UIFontDescriptorCascadeListAttribute: String

An NSArray instance—each member of the array is a sub-descriptor. The default value is the system default cascading list for user's locale.

let UIFontDescriptorCharacterSetAttribute: String

An NSCharacterSet instance that represents the set of Unicode characters covered by the font. The default value is supplied by the font.

let UIFontDescriptorFaceAttribute: String

An optional NSString object that specifies the font face.

let UIFontDescriptorFamilyAttribute: String

An optional NSString object that specifies the font family.

let UIFontDescriptorFeatureSettingsAttribute: String
let UIFontDescriptorFixedAdvanceAttribute: String

An NSNumber instance containing a float value that overrides the glyph advancement specified by the font. The default value is 0.0.

let UIFontDescriptorMatrixAttribute: String

A CGAffineTransform instance that specifies the font’s transformation matrix. The default value is the identity matrix.

let UIFontDescriptorNameAttribute: String

An optional NSString object that specifies the font name.

let UIFontDescriptorSizeAttribute: String

An optional NSNumber object, containing a float value, that specifies the font size.

let UIFontDescriptorTextStyleAttribute: String
let UIFontDescriptorTraitsAttribute: String

An NSDictionary instance instance fully describing font traits. The default value is supplied by the font. See Font Traits Dictionary Keys for dictionary keys.

let UIFontDescriptorVisibleNameAttribute: String

An optional NSString object that specifies the font’s visible name.

let UIFontFeatureSelectorIdentifierKey: String

An NSNumber object specifying a font feature selector such as common ligature off, traditional character shape, and so on.

let UIFontFeatureTypeIdentifierKey: String

An NSNumber object specifying a font feature type such as ligature, character shape, and so on.

let UIFontSlantTrait: Stringlet UIFontSymbolicTrait: Stringlet UIFontWeightBlack: CGFloatlet UIFontWeightBold: CGFloatlet UIFontWeightHeavy: CGFloatlet UIFontWeightLight: CGFloatlet UIFontWeightMedium: CGFloatlet UIFontWeightRegular: CGFloatlet UIFontWeightSemibold: CGFloatlet UIFontWeightThin: CGFloatlet UIFontWeightTrait: Stringlet UIFontWeightUltraLight: CGFloatlet UIFontWidthTrait: String
let UIImagePickerControllerCropRect: String

Specifies the cropping rectangle that was applied to the original image.

let UIImagePickerControllerEditedImage: String

Specifies an image edited by the user.

let UIImagePickerControllerLivePhoto: String

The Live Photo representation of the selected or captured photo.

let UIImagePickerControllerMediaMetadata: String

Metadata for a newly-captured photograph.

let UIImagePickerControllerMediaType: String

Specifies the media type selected by the user.

let UIImagePickerControllerMediaURL: String

Specifies the filesystem URL for the movie.

let UIImagePickerControllerOriginalImage: String

Specifies the original, uncropped image selected by the user.

let UIImagePickerControllerReferenceURL: String

The Assets Library URL for the original version of the picked item.

let UIKeyInputDownArrow: Stringlet UIKeyInputEscape: Stringlet UIKeyInputLeftArrow: Stringlet UIKeyInputRightArrow: Stringlet UIKeyInputUpArrow: String
let UIKeyboardAnimationCurveUserInfoKey: String

The key for an NSNumber object containing a UIViewAnimationCurve constant that defines how the keyboard will be animated onto or off the screen.

let UIKeyboardAnimationDurationUserInfoKey: String

The key for an NSNumber object containing a double that identifies the duration of the animation in seconds.

let UIKeyboardFrameBeginUserInfoKey: String

The key for an NSValue object containing a CGRect that identifies the start frame of the keyboard in screen coordinates. These coordinates do not take into account any rotation factors applied to the window’s contents as a result of interface orientation changes. Thus, you may need to convert the rectangle to window coordinates (using the convert(_:from:) method) or to view coordinates (using the convert(_:from:) method) before using it.

let UIKeyboardFrameEndUserInfoKey: String

The key for an NSValue object containing a CGRect that identifies the end frame of the keyboard in screen coordinates. These coordinates do not take into account any rotation factors applied to the window’s contents as a result of interface orientation changes. Thus, you may need to convert the rectangle to window coordinates (using the convert(_:from:) method) or to view coordinates (using the convert(_:from:) method) before using it.

let UIKeyboardIsLocalUserInfoKey: String

The key for an NSNumber object containing a Boolean that identifies whether the keyboard belongs to the current app. With multitasking on iPad, all visible apps are notified when the keyboard appears and disappears. The value of this key is true for the app that caused the keyboard to appear and false for any other apps.

let UILayoutFittingCompressedSize: CGSize

The option to use the smallest possible size.

let UILayoutFittingExpandedSize: CGSize

The option to use the largest possible size.

let UILayoutPriorityDefaultHigh: UILayoutPrioritylet UILayoutPriorityDefaultLow: UILayoutPrioritylet UILayoutPriorityFittingSizeLevel: UILayoutPrioritylet UILayoutPriorityRequired: UILayoutPriority
let UILocalNotificationDefaultSoundName: String

Identifies the default system sound to play when a notification alert is displayed. You assign this value to the soundName property.

Deprecated
let UIMinimumKeepAliveTimeout: TimeInterval

The minimum amount of time (measured in seconds) an app may run a critical background task in the background.

let UINavigationControllerHideShowBarDuration: CGFloat

This variable specifies the duration when animating the navigation bar. Note that this is a constant value, so it cannot be set.

let UINibExternalObjects: String

The replacements for any proxy objects in the nib file. The value for this key is an NSDictionary object. The keys of the dictionary are the names of any proxy objects in the nib file, and the value for each key is the actual object to use in place of the proxy.

let UIPasteboardChangedTypesAddedKey: String

With the notification named UIPasteboardChanged, use this key to access the added representation types. These types are stored as an array in the notification’s userInfo dictionary.

let UIPasteboardChangedTypesRemovedKey: String

With the notification named UIPasteboardChanged, use this key to access the removed representation types. These types are stored as an array in the notification’s userInfo dictionary.

let UIPasteboardNameFind: String

The Find pasteboard is unavailable starting in iOS 10. (The name identifying the Find pasteboard, which, prior to iOS 10, was used in search operations. In such operations, the most recent search string in the search bar was put in the Find pasteboard.)

Deprecated
let UIPasteboardTypeAutomatic: String

An array of pasteboard-item representation types with automatically-determined uniform type identifiers (UTIs).

var UIPasteboardTypeListColor: NSArray

An array of pasteboard-item representation types for colors. Related UIPasteboard properties are color and colors.

var UIPasteboardTypeListImage: NSArray

An array of pasteboard-item representation types for image-type uniform type identifiers (UTIs), including kUTTypePNG and kUTTypeJPEG. Related UIPasteboard properties are image and images.

var UIPasteboardTypeListString: NSArray

An array of pasteboard-item representation types for string-type uniform type identifiers (UTIs), including the kUTTypeUTF8PlainText and kUTTypeText types. Related UIPasteboard properties are string and strings.

var UIPasteboardTypeListURL: NSArray

An array of pasteboard-item representation types for URL-type uniform type identifiers (UTIs), including kUTTypeURL. Related UIPasteboard properties are url and urls.

let UIPrintErrorDomain: String

The string constant defining the UIKit printing error domain.

UIRectEdge

Constants that specify the edges of a rectangle.

let UIScrollViewDecelerationRateFast: CGFloat

A fast deceleration rate for a scroll view.

let UIScrollViewDecelerationRateNormal: CGFloat

The default deceleration rate for a scroll view.

let UISplitViewControllerAutomaticDimension: CGFloat

The default value to apply to a given dimension.

let UIStateRestorationViewControllerStoryboardKey: String
let UITableViewAutomaticDimension: CGFloat

Requests that UITableView use the default value for a given dimension.

let UITableViewIndexSearch: String

If the data source includes this constant string in the array of strings it returns in sectionIndexTitles(for:), the section index displays a magnifying glass icon at the corresponding index location. This location should generally be the first title in the index.

let UITextFieldDidEndEditingReasonKey: String
let UITextInputTextBackgroundColorKey: String

The background color of the text. The value of this key is a UIColor object.

Deprecated
let UITextInputTextColorKey: String

The color of the text. The value of this key is a UIColor object.

Deprecated
let UITextInputTextFontKey: String

The font of the text. The value of this key is a UIFont object.

Deprecated
UITextItemInteraction

Constants that indicate the type of interaction the user expects to have with a URL or text attachment.

let UIUserNotificationActionResponseTypedTextKey: String

The response text selected by the user. The value of this key is an NSString containing the user’s text response.

let UIUserNotificationTextInputActionButtonTitleKey: String

The key for specifying the title of the text input button. The value of this key is an NSString object. When the user chooses to provide a text response to a notification, UIKit displays an interface for entering that response. The value of this key is used on the button that the user taps to accept that text and attach it to the notification.

Deprecated
let UIViewNoIntrinsicMetric: CGFloat

The absence of an intrinsic metric for a given numeric view property.

let UIWindowLevelAlert: UIWindowLevel

The level for an alert view. Windows at this level appear on top of windows at the UIWindowLevelNormal level.

let UIWindowLevelNormal: UIWindowLevel

The default level. Use this level for the majority of your content, including for your app’s main window.

let UIWindowLevelStatusBar: UIWindowLevel

The level for a status window. Windows at this level appear on top of windows at the UIWindowLevelAlert level.