Type Property

isMainThread

Returns a Boolean value that indicates whether the current thread is the main thread.

Declaration

class var isMainThread: Bool { get }

Return Value

true if the current thread is the main thread, otherwise false.

See Also

Working with the Main Thread

var isMainThread: Bool

A Boolean value that indicates whether the receiver is the main thread.

class var main: Thread

Returns the NSThread object representing the main thread.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software