I'm writing an app that uses bridgeToObjectiveC() on a String object. Since Beta 5 this is no longer available.
I'm trying to do this:
self.myList.filter{($0 as MyClass).name.bridgeToObjectiveC().localizedCaseInsensitiveContainsString(searchText)}
Which gives me the error:
'String' does not have a member named 'bridgeToObjectiveC'
What is the equivalent code in Beta 5?
try
_bridgeToObjectiveC()
instead of
bridgeToObjectiveC()
as follows:
Use
as
to cast toNSString
for the same effect:Or like this with optional chaining: