Enum case '...' is not a member of type '...'

Solution 1:

This way It will work fine :

if true {
    previousState = stateForConversionView

    switch previousState! {
    case .FullOpen:
        stateForConversionView = .HalfOpen
    case .HalfOpen:
        stateForConversionView = .FullOpen
    case .Closed:
        stateForConversionView = .HalfOpen
    default:
        break
    }
}

You need to add !.

For more info refer THIS.

Solution 2:

If the condition variable is in a different type of the "State". You should use rawValue property.

var previousState:String
previousState = stateForConversionView
 switch previousState {
        case State.FullOpen.rawValue:
            stateForConversionView = .HalfOpen
        case State.HalfOpen.rawValue:
            stateForConversionView = .FullOpen
        case State.Closed.rawValue:
            stateForConversionView = .HalfOpen
        default:break

        }