swiftstringnsstringnsmutablestring

What is the difference between String and NSMutableString?


What is the difference between String and NSString?


Solution

  • String is a Swift native type, and uses value semantics.

    NSMutableString is a Foundation Class object that is "toll-free-bridged" with the Swift String type. As a Class object it uses reference semantics.

    The NSMutableString class has a few methods that the Swift String type does not.