I'm trying to initialize parameters for an Alamofire request. For some reason, the value for one of the parameters always ends up with a value of "Optional()", even when I'm unwrapping it.
Here is what I've tried...
var params : [String : Any] = [:]
params["facility_id"] = facility.facilityId ?? 0
if facility.email != nil {
params["email"] = facility.email!
}
if let url = facility.facebookUrl {
params["facebook_url"] = url
}
The value for params["facebook_url"]
ends up as "Optional(Facebook.com)"
I've tried (just for testing)
params["facebook_url"] = facility.facebookUrl!
and I still get the word "Optional(" in my value.
How do I get the "Optional()" to go away?