Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 16th, 2018 88 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. func main_old()
  2. {
  3.   // cannot construct database directly
  4.   //let mydb = SingletonDatabase()
  5.  
  6.   let db = SingletonDatabase.instance
  7.   var city = "Tokyo"
  8.   print("\(city) has population \(db.getPopulation(name: city))")
  9.  
  10.   let db2 = SingletonDatabase.instance
  11.   city = "Manila"
  12.   print("\(city) has population \(db.getPopulation(name: city))")
  13.   print("SingletonDatabase has \(SingletonDatabase.instanceCount) instance(s)")
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top