             // - we use an inline closure for the test predicate with shorthand argument names
             // - we also use the "trailing closure" syntax of Swift for convenience
             // - we don't care about the 'request' parameter in the trailing closure so we use '_'
-            textStub = OHHTTPStubs.stubRequestsPassingTest({$0.URL!.pathExtension == "txt"}) { _ in
+            textStub = OHHTTPStubs.stubRequestsPassingTest({ObjCBool($0.URL!.pathExtension! == "txt")}) { _ in
                 let stubPath = OHPathForFile("stub.txt", self.dynamicType)
                 return OHHTTPStubsResponse(
                     fileAtPath: stubPath!,


        NSURLConnection.sendAsynchronousRequest(req, queue: NSOperationQueue.mainQueue()) { (_, data, _) in
            sender.enabled = true
            self.imageView.image = UIImage(data: data)
        }
    }
    


        NSURLConnection.sendAsynchronousRequest(req, queue: NSOperationQueue.mainQueue()) { (_, data, _) in
            sender.enabled = true
            if let receivedData = data, receivedText = NSString(data: receivedData, encoding: NSASCIIStringEncoding) {
                self.textView.text = receivedText as String
            }
        }
    }

