title: How to have multiple instances in singleton class?
body: <p>There is a class declared as singleton in Swift. An instance called A is declared inside this singleton class.</p>
  <p>Originally, there is only one instance of this A in memory.
  Is there any way to make multiple instances of this A instance in a singleton class?</p>
  <p><strong>A class</strong></p>
  <pre><code>protocol ADelegate{
      func onSuccess()
      func onFail()
  }
  
  // I want to create multiple instances of this
  class A{
      var delegate: ADelegate!
      // ...
      func requestCallback(){
          //...
          // success response 
          delegate.onSuccess()
      }
  }
  </code></pre>
  <pre><code>class ModuleA: ADelegate{
      var aInstance = A(delegate: self)
      func req(){
          aInstance.requestCallback()
      }
  
      func onSuccess(){
          // ModuleA do something
      }
  
      func onFail(){
      
      }
  }
  
  class ModuleB: ADelegate{
      var aInstance = A(delegate: self)
      // ModuleB do something
  }
  </code></pre>
  <p><strong>singleton class(Main)</strong></p>
  <pre><code>class Main{
      static var shared = Main()
      // Using ModuleA, ModuleB
  
  }
  </code></pre>