How do I create delegates in Objective-C?

后端 未结 19 2580
一整个雨季
一整个雨季 2020-11-21 04:48

I know how delegates work, and I know how I can use them.

But how do I create them?

19条回答
  •  渐次进展
    2020-11-21 05:08

    Delegate :- Create

    @protocol addToCartDelegate 
    
    -(void)addToCartAction:(ItemsModel *)itemsModel isAdded:(BOOL)added;
    
    @end
    

    Send and please assign delegate to view you are sending data

    [self.delegate addToCartAction:itemsModel isAdded:YES];
    

提交回复
热议问题