I would like to include a switch in my 3 cases, but I get an error that I cannot solve:
Error: expected member name or constructor call after type name
I must have missed something because I already used the same code. But now I have an almost empty project and I canβt understand what happened?
import UIKit class ViewController: UIViewController { enum MyStateStatus { case Ready case Running case Stopped } @IBAction func actionPressed(sender: UIButton) { switch MyStateStatus { case MyStateStatus.Ready: print("I'm ready") default: print("other") } }
I am using Swift, Xcode 6.3.2
UPDATE: Replace println() with print() for Swift 2.2 and Xcode 7 compatibility.
source share