I get the β Type of expression ambiguous without context β in this part of the code from the project that I am trying to upgrade to the latest version of Swift. I don't seem to understand. I tried different things, but I can not get it to work.
The problem is the syntax of this line
let imageToDeleteParameters = imagesToDelete.map { ["id": $0.id, "url": $0.url.absoluteString, "_destroy": true] }
Full code:
extension TutorialCreationRequest: WebserviceParametrable { func toParameters() -> [String: AnyObject] { let imageParameters = images.map { ["url": $0] } let imageToDeleteParameters = imagesToDelete.map { ["id": $0.id, "url": $0.url.absoluteString, "_destroy": true] } return [ "title": title, "is_draft": isDraft, "difficulty": difficulty, "duration": duration, "cost": cost, "user_id": userId, "description": description, "to_sell": toSell, "images": [imageParameters, imageToDeleteParameters].flatMap { $0 } ] } }
source share