[swift-evolution] [Proposal]: support disable to trailing closure syntax

Michel Fortin michel.fortin at michelf.ca
Mon Jan 4 11:50:15 CST 2016


Le 4 janv. 2016 à 7:45, QQ Mail via swift-evolution <swift-evolution at swift.org> 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



More information about the swift-evolution mailing list