Avi Tsadok
avitsadok.bsky.social
Avi Tsadok
@avitsadok.bsky.social
iOS Developer l Book author | Public speaker
A nice Swift tip!
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
December 17, 2024 at 1:02 PM