我正在编写
一个在String对象上使用bridg
etoObjectiveC()的应用程序.自Beta 5以来,这不再可用.
我试图这样做:
self.myList.filter{($0 as MyClass).name.bridgetoObjectiveC().localizedCaseInsensitiveContainsstring(searchText)}
哪个给我错误:
'String' does not have a member named 'bridgetoObjectiveC'
Beta 5中的等效代码是什么?
用于转换为N
sstring同样的
效果:
("string" as Nsstring).localizedCaseInsensitiveCompare("other string")
或者喜欢这个可选链接:
("string" as Nsstring?)?.localizedCaseInsensitiveCompare("other string")