Compares strings as sorted by the Finder.
- iOS 4.0+
- macOS 10.6+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
The string to compare with the receiver.
The result of the comparison.
This method should be used whenever file names or other strings are presented in lists and tables where Finder-like sorting is appropriate. The exact sorting behavior of this method is different under different locales and may be changed in future releases. This method uses the current locale.
Identifying and Comparing Strings
func isEqual(to: String) -> Bool
Returns a Boolean value that indicates whether a given string is equal to the receiver using a literal Unicode-based comparison.
var hash: Int
An unsigned integer that can be used as a hash table address.
This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.Learn more about using Apple's beta software