How to destroy a singleton in Swift

后端 未结 3 1494
情书的邮戳
情书的邮戳 2020-12-28 17:38

How to destroy a singleton in Swift?

I create a singleton like this:

class MyManager  {
    private static let sharedInstance = MyManager()
    cla         


        
3条回答
  •  孤城傲影
    2020-12-28 17:49

    You don't destroy a singleton. A singleton is created the first time anyone needs it, and is never destroyed as long as the application lives.

提交回复
热议问题