You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Xcode 12 beta 4 and finding multiple trailing closures to be broken when omitting the last optional closure.
// Demonstrate single and multiple trailing closures.// 1. Using the built-in UIView.animate()// (same example used on SE-0279)letview=UIView()// Single trailing closure argument (works)UIView.animate(withDuration: 0.3){
view.alpha =0}// Multiple trailing closure arguments (works)UIView.animate(withDuration: 0.3){
view.alpha =0} completion:{ _ in
view.removeFromSuperview()}// 2. Using a faked animate() with the same method signature// as UIView.animate().func animate(withDuration duration:TimeInterval, animations:@escaping()->Void, completion:((Bool)->Void)?=nil){}// Single trailing closure argument (does not work)animate(withDuration:1.0){// << ERROR
view.alpha = 0.0
}// Multiple trailing closure arguments (works)animate(withDuration:1.0){} completion:{ _ in}
Error: Contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored
Error: Missing argument for parameter 'animations' in call
The text was updated successfully, but these errors were encountered:
Environment
Xcode 12 Beta 4
Additional Detail from JIRA
md5: 8a3fd5dca0fa0876e0c341c46f1d080c
Issue Description:
I am using Xcode 12 beta 4 and finding multiple trailing closures to be broken when omitting the last optional closure.
Error: Contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored
Error: Missing argument for parameter 'animations' in call
The text was updated successfully, but these errors were encountered: