What is type context?
<p>I'm currently stuck to understand which variables are considered to be local, and which are global.</p>

<p>In <a href="https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Properties.html" rel="nofollow">docs</a> we can read that:</p>

<p><code>Global variables are variables that are defined outside of any function, method, closure, or type context.</code></p>

<p>I'm guessing that: variables defined in type context <code>==</code> type/instance variables defined inside class/struct?</p>

<p>For example:</p>

<pre><code>var foo = "foo" // global variable

class Foobar {
  static var foo = "foo" // local variable -&gt; declared inside Foobar type context
  var bar = "bar" // local variable -&gt; declared inside Foobar type context

  func foobar() {
    var foo = "" // local variable -&gt; declared inside method
  }
}
</code></pre>