Skip to content

Instantly share code, notes, and snippets.

@stleamist
Created July 16, 2020 10:21
Show Gist options
  • Save stleamist/87c9bdd1bfb53d64f5898809ea19f1d1 to your computer and use it in GitHub Desktop.
Save stleamist/87c9bdd1bfb53d64f5898809ea19f1d1 to your computer and use it in GitHub Desktop.
import Swift
extension CaseIterable where Self: Equatable {
var index: Self.AllCases.Index {
return Self.allCases.firstIndex(of: self)!
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment