Yes it is possible. Just use this code in your SKScene class:
override func didMoveToView(view: SKView) { let switchDemo = UISwitch(frame:CGRectMake(150, 300, 0, 0)) switchDemo.on = true switchDemo.setOn(true, animated: false) switchDemo.addTarget(self, action: "switchValueDidChange:", forControlEvents: .ValueChanged) self.view!.addSubview(switchDemo) }
Helper Method:
func switchValueDidChange(sender:UISwitch!) { if (sender.on == true){ print("on") } else{ print("off") } }
Result:

Dharmesh
source share