 <p>I was having an issue with the same error when converting an Int to a custom enum: </p> <pre><code>switch MyEnum(rawValue: 42) { case .error: // Enum case `.error` not found in type 'MyEnum?' break default: break } </code></pre> <p>The issue is that <code>MyEnum(rawValue: 42)</code> returns an optional. Force unwrap it with <code>!</code> to allow switching on the enum:</p> <pre><code>switch MyEnum(rawValue: 42)! { case .error: // no error! break default: break } </code></pre>