Difference Between Completion Handler and Blocks : [iOS]

前端 未结 4 1277
遇见更好的自我
遇见更好的自我 2020-12-08 14:34

I am messed with both completion handler and blocks while I am using them in Swift and Objective-C. And when I am searching blocks in Swift

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 15:31

    In short : Completion handlers are a way of implementing callback functionality using blocks or closures. Blocks and Closures are chunks of code that can be passed around to methods or functions as if they were values (in other words "anonymous functions" which we can give names to and pass around).

提交回复
热议问题