Obsolete String.contains(_:) of Swift runtime
Starting with iOS 10, macOS 10.12, tvOS 10.0 and watchOS 3.0, Foundation contains its own definition of String.contains(_:), which conflicts with the extension provided by antlr.
This commit is contained in:
parent
de4d129921
commit
79eb3721e4
|
@ -32,6 +32,10 @@ public extension String {
|
|||
return self.replacingOccurrences(of: from, with: replacement, options: NSString.CompareOptions.literal, range: nil)
|
||||
}
|
||||
|
||||
@available(iOS, obsoleted: 10.0)
|
||||
@available(macOS, obsoleted: 10.12)
|
||||
@available(tvOS, obsoleted: 10.0)
|
||||
@available(watchOS, obsoleted: 3.0)
|
||||
func contains(_ find: String) -> Bool {
|
||||
return self.range(of: find) != nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue