I like this syntax, but I don't like that it could be ambiguous with successively calling animateWithDuration then some function called completion.
Other than that, I think that developers should be smart enough to exercise self-restraint with trailing closures when they're not appropriate. I don't understand what you (QQ Mail) mean with "you have to write it manually". Félix > Le 4 janv. 2016 à 12:50:15, Michel Fortin via swift-evolution > <[email protected]> a écrit : > > Le 4 janv. 2016 à 7:45, QQ Mail via swift-evolution > <[email protected]> a écrit : >> I would like to write like this: >> >> UIView.animateWithDuration(0.3, >> >> animations: { () -> Void in >> // animation code here >> }, >> completion: { Bool -> Void in >> // completion code here >> } >> ) > > Maybe, instead of disallowing trailing closures, we could allow consecutive > closures to be expressed like that: > > UIView.animateWithDuration(0.3) { > // animation code here > } completion { success in > // completion code here > } > > -- > Michel Fortin > https://michelf.ca > > _______________________________________________ > swift-evolution mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-evolution _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
