guard let json = try? NSJSONSerialization.JSONObjectWithData(data!,
options: []) as? [String: AnyObject] else {
print("Nil data received from fetchAllRooms service")
return
}
In the above code I am unable to understand what is the significance of
"try?": Is the "try?" here means the whole code after try will be under try block (same as try catch as in other language?)
"as?" : It is for typecasting I guess. but why this "?", after as?
How can I replace the above code with if-let?