devxoul / Then

✨ Super sweet syntactic sugar for Swift initializers
MIT License
4.18k stars 290 forks source link

Strange issue after updating to version 1.0.0 #19

Closed tuyendv2 closed 8 years ago

tuyendv2 commented 8 years ago

I got compiling error Cannot convert value of type '_ -> ()' to expected argument type 'inout WKWebView -> Void' with this code

webView.then {
    $0.navigationDelegate = self
}

However, the error's gone when there are two assignments in the block

webView.then {
    $0.navigationDelegate = self
    $0.tag = 1
}
devxoul commented 8 years ago

Hi @tuyencoder, it seems to be an Xcode issue.

Possible workaround is to put return.

webView.then {
    $0.navigationDelegate = self
    return
}
tuyendv2 commented 8 years ago

It works now. Thank you!

devxoul commented 8 years ago

:smile: