title: The use of singleton class in objective c and swift
body: <p>I have a project implemented in both Objective C and Swift classes and I need to have global variables to be shared among these classes . 
  I have two variables <code>currentUsername</code> and <code>currentUsernumber</code> , I need to use these two in each view in the project, what is the best way to implement that ?</p>
  
  <p>I have tried to implement singleton class and here is my code :</p>
  
  <pre><code>    class curentUserSingleton {
  static var instance: curentUserSingleton!
  var currentUsername: String = ""
  var currentUsernumber: String = ""
  
  // SHARED INSTANCE
  class func sharedInstance(Name : String , Number : String) -&gt; curentUserSingleton {
      self.instance = (self.instance ?? curentUserSingleton(uName: Name , uNumber: Number))
      return self.instance
  }
  
  // METHODS
  init(uName : String , uNumber : String) {
      self.currentUsername = uName
      self.currentUsernumber = uNumber
  }}
  </code></pre>
  
  <p>But I don't know how to use this class safely in the OC and Swift and I am a little confused since I get declaration errors when I use the class in my code!
  Is this the right way to write a singleton class and how to call it in both languages ?</p>