im using parse in my project, put i faceing issue here is my code :
func getIdByItemName (name:String) -> String
{
let Query = PFQuery(className: "Class")
.whereKey("name", equalTo: name)
var QueryObject = Query.findObjects()
var findId:String = "????"
for quer in QueryObject!
{
findId = String(quer.objectId)
}
print("The object id id : \(findId)")
return findId
}
my issue is the returned values will be like this :
Optional("l7wpt4slip")
my question is how can i remove optional and keep only object id as String like this ?? :
l7wpt4slip