ahmed ahmed - 1 year ago 231
Swift Question

Swift String Error

I get a "Enum element checked cannot be referenced as an instance member error". Please help

}else if self.ByOwner.checkState = .Checked{

self.performSegue(withIdentifier: "ToProductOwnersNameViewController#2", sender: nil)

Error image

Answer Source

As @MartinR mentioned, == is a comparison operator and single = (equal to) is assignment operator so if in any conditional statement you should state the statement like

if(self.ByOwner.checkState == Checked)


//work to be done 

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download