That is not a Swift method, it's an Objective-C method on NSString, which Swift String can be silently converted to.
This is why I was careful to say that Swift's API is the best in terms of its fundamental design. It still has a lot of missing functionality compared to other languages right now.