Initialize with positional constants
suggest changelet mySwitch: UISwitch = {
view.addSubview($0)
$0.addTarget(self, action: "action", forControlEvents: .TouchUpInside)
return $0
}(UISwitch())
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents