I've tried to troubleshoot this warning but have had no success. Since upgrading to swift3, I am receiving a warning message in my Facebook Graph Request completion handler.
The error message is specifically, "Expression of type 'FBSDKGraphRequestConnection?'is unused."
graphRequest?.start(completionHandler: { (connection, result, error) in
if error != nil {
//do something with error
} else if result != nil {
//do something with result
}
})
I've tried adding (in the completion handler) lines of code like below to see if the warning would disappear but the warning is persistent.
connection.start()
connection.timeout = 30
if connection != nil {
}
The completion handler I have worked fine in swift2 and gave me no such warning. Am I not properly using the completion handler?