Skip to content

Instantly share code, notes, and snippets.

@TerryCK
Created December 26, 2017 15:03
Show Gist options
  • Save TerryCK/17e12c55f21307a383cc36598646a03d to your computer and use it in GitHub Desktop.
Save TerryCK/17e12c55f21307a383cc36598646a03d to your computer and use it in GitHub Desktop.
String+Extension in playground
extension String {
static var txtLocoal: String {
return "txtLocoal".localized()
}
func localized() -> String {
return "localized String \(self)"
}
}
func methods(with string: String) -> String {
return string
}
//: ## Usage
let result = methods(with: .txtLocoal)
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment