CosmicMind / Graph

Graph is a semantic database that is used to create data-driven applications.

Home Page:http://cosmicmind.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove optionals on accessing GraphJSON properties

OrkhanAlikhanov opened this issue · comments

let json = GraphJSON(...)
guard let firstName = json.user?.name?.first?.asString else {
  return
}

Above can be reduced to:

guard let firstName = json.user.name.first.asString else {
  return 
}

We can continue to use asX anyways which returns Optional

Fixed in #146