How to call non-escaping closure inside a local closure? [duplicate]
问题 This question already has answers here : Why do closures require an explicit `self` when they're all non-escaping by default in Swift 3? (2 answers) Closed 3 years ago . I have a function which looks something like this: func test(closure: () -> ()) { let localClosure = { closure() } localClosure() } This is only an example and does not fully reflect the problem I encountered, obviously here I could have just called closure directly! It should be clear that in the above code, closure cannot