Difference between returning Void and () in a swift closure

前端 未结 4 1441
灰色年华
灰色年华 2020-12-25 12:53

Whats the difference between these closures?

let closureA: () -> ()

and

let closureB: () -> Void
4条回答
  •  北荒
    北荒 (楼主)
    2020-12-25 13:26

    There is no difference at all

    Void is an alias for ():

    typealias Void = ()
    

提交回复
热议问题