Contents

setOn(_:animated:)

Sets the state of the switch to the on or off position, optionally animating the transition.

Declaration

func setOn(_ on: Bool, animated: Bool)

Parameters

  • on:

    True if the switch should be turned to the on position; False if it should be turned to the off position. If the switch is already in the designated position, nothing happens.

  • animated:

    True to animate the “flipping” of the switch; otherwise False.

Discussion

Setting the switch to either position doesn’t result in an action message being sent.

See Also

Setting the on/off state