title: How to Create Singleton Object in swift
body: <p>I am learning about Singleton pattern in swift and efficient way to create a Singleton class and found out the best way to create as below.</p>
  
  <pre><code>class SingletonClass{
      static let sharedInstance = SingletonClass()
  }
  </code></pre>
  
  <p>Since i have use the <code>let</code> statement it is read only property and has to be thread safe so there is no need of dispatch_once() as of Objective C.And <code>static</code>  is used to make the <code>sharedInstance</code> variable as a <code>class</code> variable i guess.</p>
  
  <p>But how does this guarantee there is only one instance created throughout the application?is there a small thing i am missing?</p>