Instance Method

setOn:

Sets the state of the switch to the specified value.

Declaration

- (void)setOn:(BOOL)on;

Parameters

on

A Boolean value indicating whether the switch should be set to the On or Off state. Specify YES to set the switch to the On state.

Discussion

Use this method to set the value of a switch. If you want to know the value of a switch, use a local variable to track that information.

See Also

Configuring the Switch

- setColor:

Changes the tint color of the switch when it is on.