After I updated Xcode 7 beta and convert my swift code to Swift 2, I got these two errors that I can't figure out..
Call can throw, but it is not marked with 'try' and the error is not handled
Binary operator '==' cannot be applied to operands of type '()?' and 'Bool'
My code is here.
if self.socket?.connectToHost(host, onPort: port, viaInterface: interfaceName, withTimeout: 10) == true {
// connecting
} else {
// error
let delay = 1 * Double(NSEC_PER_SEC)
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay))
dispatch_after(time, dispatch_get_main_queue(), {
self._connect()
})
}
Any idea what can be the problem?
Snapshot: