Skip to content

Instantly share code, notes, and snippets.

@ozgur
Created May 12, 2017 06:53
Show Gist options
  • Save ozgur/43491c4e8ca8d352391b41b9e7b17465 to your computer and use it in GitHub Desktop.
Save ozgur/43491c4e8ca8d352391b41b9e7b17465 to your computer and use it in GitHub Desktop.
Simple generic protocol definition
protocol EnumProtocol {
associatedtype T
var rawValue: T { get }
}
enum MyColor: Int, EnumProtocol {
typealias T = Int
case red = 0
case yellow = 1
case black = 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment