Changing UISwitch place

Is there a way to change UISwitch from right to left? Because in the app the UISwitch is on the right side. I want to place it on the left side.

You don't say what the context is, but if this something like a vertical list of controls, you could try using a horizontal UIStackView to place the UISwitch (without a label) on the left, followed by a UILabel on the right.

Accepted Answer

What is exactly the question ?

Do you mean the position of title ?

Or the ON/Off state to have On on the left ?

If so, you can subclass UISwitch and rotate 180°:

@IBDesignable
class MirroredSwitch: UISwitch {

    override func draw(_ rect: CGRect) {
        self.transform = CGAffineTransform(rotationAngle: .pi)
    }
}
Changing UISwitch place
 
 
Q