How to simplify callback logic with a Block?

前端 未结 3 1446
一生所求
一生所求 2020-11-29 17:30

Let\'s say I need to communicate with a class that provides a protocol and calls delegate methods when an operation is complete, as so:

@protocol SomeObjectD         


        
3条回答
  •  失恋的感觉
    2020-11-29 18:21

    The below link explains how the call backs using delegates could be easily replaced with blocks.

    The examples includes UITableview,UIAlertview and ModalViewController.

    click me

    Hope this helps.

提交回复
热议问题