I have a object called message.body of type Any
The object returns nil but if I do some test equals nil, it says that message.body ALWAYS been true.
How I solve this?
EDIT
Thank you for all answers
This is my code:
extension FirstViewController: WKScriptMessageHandler {
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
if message.name == "jsHandler" {
print( "Value: " )
if message.body != nil {
print( message.body )
}
}
}
}
Really is a strong type this Any of message.body.
Thank you very much @vacawama, I really researched the subject but did not find anything the way I researched.