Checking state of NSButton Checkbox on Xcode for macOS apps swift 3 -


i have nsbutton checkbox on xcode using swift 3 making macos applications. i'm trying check state (whether on or off). options have found, such : if ([switch1 state] == nsonstate) { //code} when this, tells me inout comma after "switch 1". right, or version of code old swift 3?

`@iboutlet weak var switch1: nsbutton!  override func viewdidload() {     super.viewdidload()     if ([switch1 state] == nsonstate) {         print("on")     }     }` 

update: looking @ later reference, correct line if (switch1.state == nsonstate) {//code}


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -