enum cannot conform to protocol

Several days earlier I worte the code,I imported the library of Alamofire.

I defined one enum,let it confirm to StringConvertible protocol.

But the error told me enum cannot StringConvertible protocol.Actually Struct,enum and class both can conform to protocols.I confirmed the issue,possibly it has relationship with Xcode.My version of Xcode is 7.2...Hope later modify the bug of Xcode.

Replies

There is no "StringConvertible" protocol.

Why Qui

Maybe you want to use CustomStringConvertible ?


h ttps://developer.apple.com/reference/swift/customstringconvertible


May also have a look here (conforming an enum to a protocol is more tricky than for class or struct):


h ttps://stackoverflow.com/questions/24011170/how-to-make-an-enum-conform-to-a-protocol-in-swift