One Logo Pool Ball
UIKit · IOS API REFERENCE

UISwitch

class · iOS 2.0+ · SDK 27.1

@MainActor class UISwitch

Members (18)

init · iOS 2.0+

init

TypeScript
static initCoder(coder: _Foundation_NSCoder): Promise<(UISwitch) | null>
Swift declaration
init?(coder: NSCoder)
init · iOS 2.0+

init

TypeScript
static initFrame(frame: { x: number; y: number; width: number; height: number }): Promise<UISwitch>
Swift declaration
init(frame: CGRect)
method · iOS 2.0+

setOn

TypeScript
setOn(on: boolean, animated: boolean): Promise<void>
Swift declaration
func setOn(_ on: Bool, animated: Bool)
get · iOS 6.0+

offImage

TypeScript
get offImage(): Promise<(UIImage) | null>
Swift declaration
var offImage: UIImage? { get set }
set · iOS 6.0+

offImage

TypeScript
setOffImage(value?: (UIImage) | null): Promise<void>
Swift declaration
var offImage: UIImage? { get set }
get · iOS 2.0+

isOn

TypeScript
get isOn(): Promise<boolean>
Swift declaration
var isOn: Bool { get set }
set · iOS 2.0+

isOn

TypeScript
setIsOn(value: boolean): Promise<void>
Swift declaration
var isOn: Bool { get set }
get · iOS 6.0+

onImage

TypeScript
get onImage(): Promise<(UIImage) | null>
Swift declaration
var onImage: UIImage? { get set }
set · iOS 6.0+

onImage

TypeScript
setOnImage(value?: (UIImage) | null): Promise<void>
Swift declaration
var onImage: UIImage? { get set }
get · iOS 5.0+

onTintColor

TypeScript
get onTintColor(): Promise<(UIColor) | null>
Swift declaration
var onTintColor: UIColor? { get set }
set · iOS 5.0+

onTintColor

TypeScript
setOnTintColor(value?: (UIColor) | null): Promise<void>
Swift declaration
var onTintColor: UIColor? { get set }
get · iOS 14.0+

preferredStyle

TypeScript
get preferredStyle(): Promise<UISwitch_Style>
Swift declaration
var preferredStyle: UISwitch.Style { get set }
set · iOS 14.0+

preferredStyle

TypeScript
setPreferredStyle(value: UISwitch_Style): Promise<void>
Swift declaration
var preferredStyle: UISwitch.Style { get set }
get · iOS 14.0+

style

TypeScript
get style(): Promise<UISwitch_Style>
Swift declaration
var style: UISwitch.Style { get }
get · iOS 6.0+

thumbTintColor

TypeScript
get thumbTintColor(): Promise<(UIColor) | null>
Swift declaration
var thumbTintColor: UIColor? { get set }
set · iOS 6.0+

thumbTintColor

TypeScript
setThumbTintColor(value?: (UIColor) | null): Promise<void>
Swift declaration
var thumbTintColor: UIColor? { get set }
get · iOS 14.0+

title

TypeScript
get title(): Promise<(string) | null>
Swift declaration
var title: String? { get set }
set · iOS 14.0+

title

TypeScript
setTitle(value?: (string) | null): Promise<void>
Swift declaration
var title: String? { get set }

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

UISwitch.init()

inherited init: cannot prove legal (class declares 1 custom initializer)

All UIKit types →