👩💻 Join our community of thousands of amazing developers!
When calling optional delegates, the regular pattern is to check using respondsToSelector:, then actually call the method. This is straightforward and easy to understand: 1 2 3 4 id<PSPDFResizableViewDelegate> delegate = self.delegate; if ([delegate respondsToSelector:@selector(resizableViewDidBeginEditing:)]) { [delegate resizableViewDidBeginEditing:self]; } Now, this used to be three lines and now it’s four lines, because delegate is usually weak, and once you enable the relatively new Cl...