Search code examples
iosclassbuttondelegatesibaction

How to get a button press in one class to call a method in another class (iOS)


I am having difficulties wrapping my head around this. I have a MyCollectionViewController class that has a method called 'someMethod'. I also have MySupplementaryView class that has a button called 'aButton'. The SupplementaryView is a footer in the UICollectionView.

How can I get the IBAction for aButton to call someMethod?

Thanks in advance for your response.


Solution

  • I think I found it.

    [delegate someMethod];
    

    Silly me.