Is there an import or something I have to use? In my macOS app, I'm trying:
let hello = "Hello"
let emptyRange = hello.firstRange(of: "")
Which is an example from swift evolution proposal 0357 , which is included in swift 5.7 according to: swift.org 5.7 release notes
I've confirmed that I am using swift 5.7 by running:
xcrun swift -version
and in code via
#if swift(>=5.7)
print("on swift>=5.7")
#endif
the error I get when I try to compile the emptyRange code above is:
Value of type 'String' has no member 'firstRange'
It seems like from the example it should just work - any tips to what I'm missing would be appreciated.