Swift - which types to use? NSString or String

后端 未结 9 1023
死守一世寂寞
死守一世寂寞 2020-12-23 00:06

With the introduction of Swift I\'ve been trying to get my head round the new language

I\'m an iOS developer and would use types such as NSString, NSInteger, N

9条回答
  •  太阳男子
    2020-12-23 01:01

    String is a struct

    // in Swift Module

    public struct String

    {

    }

    NSString is a class

    // in Foundation Module

    open class NSString : NSObject

    {

    }

提交回复
热议问题