title: optional closure and check if it is nil
body: <p>So what I want to have is a class that may get a closure passed to it in a function, it may also at some point want to disregard a that closure. How can I check if the closure variable is set and hwo can I delete it when I am done with it?</p>
  
  <blockquote>
    <p>Cannot invoke '!=' with an argument list of type '(@lvalue (sucsess:
    Bool!, products: [AnyObject]!) -> ()?, NilLiteralConvertible)' Type
    '(sucsess: Bool!, products: [AnyObject]!) -> ()?' does not conform to
    protocol 'NilLiteralConvertible'</p>
  </blockquote>
  
  <pre><code>class someClass{
      //typealias completionHandlerClosureType = (sucsess:Bool!, items:[AnyObject]!)-&gt;()
      var completionHandler:(sucsess:Bool!, items:[AnyObject]!)-&gt;()?
      var hitpoints = 100
      var someset = ["oh no!","avenge me!"]
      init(){}
  
      func getHitFunc(impact:Int, passedCompletionsHandler:(sucsess:Bool!, items:[AnyObject]!)-&gt;()){
          completionHandler = passedCompletionsHandler
          hitpoints = hitpoints - impact
      }
  
      func checkIfDead{
          if hitpoints&lt;=0 {               // The error received
              if completionHandler != nil{// Cannot invoke '!=' with an argument list of type 
                                          //'(@lvalue (sucsess: Bool!, products: [AnyObject]!) -&gt; ()?, NilLiteralConvertible)' 
                  //run the handler if dead
                  completionHandler(sucsess: true, items: someset)
                  //do not run it again
                  completionHandler = nil     //Type '(sucsess: Bool!, products: [AnyObject]!) -&gt; ()?' does not conform to protocol 'NilLiteralConvertible'
              }
          }
          else{
              completionHandler = nil      //Type '(sucsess: Bool!, products: [AnyObject]!) -&gt; ()?' does not conform to protocol 'NilLiteralConvertible'
          }
      }
  }
  </code></pre>