Shark Deng

Interactive Designer @Shanju Design in Shanghai

touched caffe / mxnet / python / wordpress / bootstrap / Arduino / Raspberry Pi / webgl / three.js / PIXI / 3dMax

Email

Github

swift-单例

2019-11-13 00:27:13

class S_ShaderManager: NSObject {
    static let sharedInstance: S_ShaderManager()
}

检查单例
let a = S_ShaderManger.sharedInstance
let b = S_ShaderManger.sharedInstance
print(a)
print(b)
a,b内存地址一样,单例成功。

 



——By SharkDeng
如果你喜欢我的文章,欢迎红包赞赏

Leave a Reply

Your email address will not be published. Required fields are marked *