Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alessandro-martin/9fa91e3e7106cc30779a0df682287477 to your computer and use it in GitHub Desktop.
Save alessandro-martin/9fa91e3e7106cc30779a0df682287477 to your computer and use it in GitHub Desktop.
New in Xcode 9,  has fixed this bug I filed last February
// Up until Xcode 8.3.2
// switching over a type's static properties required full namespace qualification
// This wouldn't compile
// Fixed in Xcode 9 :D
extension String {
static let firstSection: String = "firstSection"
static let secondSection: String = "secondSection"
}
let message: String = .firstSection
switch message {
case .firstSection:
print("First")
case .secondSection:
print("Second")
default:
print("Default")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment