The Swift team has added raw identifiers, making writing more descriptive and natural names for your code easier. Raw identifiers allow names that include spaces, special characters, or even numbers—delimited with backticks (`).
The Swift team has added raw identifiers, making writing more descriptive and natural names for your code easier. Raw identifiers allow names that include spaces, special characters, or even numbers—delimited with backticks (`).
When performing string searches, we often write the following:
$0.name.lowercased().contains(searchPhrase.lowercased())
Instead, we can:
$0.name.localizedStandardContains(searchPhrase)
Why is this better?
More Readable, Localization-Friendly, Built-In Case Insensitivity
When performing string searches, we often write the following:
$0.name.lowercased().contains(searchPhrase.lowercased())
Instead, we can:
$0.name.localizedStandardContains(searchPhrase)
Why is this better?
More Readable, Localization-Friendly, Built-In Case Insensitivity