Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-1199] Trailing Closures with Multiple Closure Parameters #43807

Closed
swift-ci opened this issue Apr 9, 2016 · 1 comment
Closed

[SR-1199] Trailing Closures with Multiple Closure Parameters #43807

swift-ci opened this issue Apr 9, 2016 · 1 comment
Assignees
Labels
code completion Area → source tooling: code completion improvement source tooling Area: IDE support, SourceKit, and other source tooling

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Apr 9, 2016

Previous ID SR-1199
Radar None
Original Reporter Infinity-James (JIRA User)
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s CodeCompletion
Labels Improvement
Assignee @nkcsgexi
Priority Medium

md5: ff91fff5f7b36b0fe8973652f8a47315

Issue Description:

Some functions have 2 closure parameters, such as:

UIView.animateWithDuration(_:animations:completion:)

With Xcode's auto fill you end up with:

UIView.animateWithDuration(1.0, animations: { 
            
            }) { (success) in
                
        }

The completion parameter is auto completed as a trailing closure, but this makes less sense when following a previous closure parameter. For clarity I think that functions that have 2 closures should not treat the last closure as a trailing closure and should instead look like this:

UIView.animateWithDuration(1.0, animations: { 
            
            }, completion: { success in
                
        })
@nkcsgexi
Copy link
Member

This is resolved by:

09a19bb

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the source tooling Area: IDE support, SourceKit, and other source tooling label Feb 6, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code completion Area → source tooling: code completion improvement source tooling Area: IDE support, SourceKit, and other source tooling
Projects
None yet
Development

No branches or pull requests

3 participants