I saw this answer How to enumerate an enum with String type?
Now I'm trying to create method that will return array of strings with the raw values of the enum.
So I did :
class func enumValues<T>(from array: AnyIterator<T>) -> [T] where T:RawRepresentable, T:Hashable {
var tempArray = [T]()
for item in array{
tempArray.append(item.rawValue)
}
return tempArray
}
But, i get this error :
Argument type 'T.RawValue' does not conform to expected type 'Hashable'
Argument type 'T.RawValue' does not conform to expected type 'RawRepresentable'
How can i fix this problem? thanks