Check UISwitch status on viewDidLoad
<p>I am having problem with status of <code>UISwitch</code> at start. Why is my <code>switch</code> always in the <code>on</code> state?</p>

<pre><code>@IBOutlet  weak var switch: UISwitch!

override func viewDidLoad() {
    super.viewDidLoad()

    if let sw = switch {
        if sw.on  {
            print("on")
        } else {
            print("off")
        }
    }
}
</code></pre>