title: Swift closure in protocol extension
body: <p>I want to Decorate UIViewController with the ability to adjust it's interface when <code>setInteractionEnabled</code> method is called from another class (ex. Network State Manager). All changes (if any) should be provided in the concrete controller by overriding <code>onInteractionChanged</code>. Here is my code:</p>
  
  <pre><code>import Foundation
  
  typealias InteractionClosure = ((enabled: Bool) -&gt; Void)
  
  protocol Interaction: class {
  
      var onInteractionChanged: InteractionClosure? { get set }
  
      func setInteractionEnabled(enabled: Bool)
  
  }
  
  extension Interaction where Self: UIViewController {
  
      // Default: Do nothing
      // Throws: - Extensions may not contain stored properties
      var onInteractionChanged: InteractionClosure? = nil
  
      func setInteractionEnabled(enabled: Bool) {
          onInteractionChanged?(enabled: enabled)
      }
  
  }
  
  extension UIViewController : Interaction {}
  </code></pre>
  
  <p>How to add default implementation for <code>onInteractionChanged</code>?</p>