title: Swift variable declaration with closure
body: <p>I saw a declaration which confuses me. ( the grammar here)</p>
  
  <pre><code>static var dateFormatter: NSDateFormatter = {
      var formatter = NSDateFormatter()
      formatter.dateFormat = "yyyy-MM-dd"
      return formatter
  }()
  </code></pre>
  
  <p>To declare a variable, it looks like it uses a function(initializer) to create one. 
  Since I am not familiar with closure in Swift, I found some useful tutorial. However, the example above seems to not fit in any of them.
  ref: <a href="http://fuckingclosuresyntax.com/" rel="nofollow">http://fuckingclosuresyntax.com/</a>
  Any suggestions, references, or tutorial will be appreciated.</p>