TwitterKit v3 - Crash when optional composerDidCancel is not implemented



This appears to be new behavior with v3.

When loading a TWTRComposerViewController, a delegate should be supplied.

However, if composerDidCancel is not implemented, then the app will crash with: “unrecognized selector sent to instance” exception.

The problem is that this function is declared optional - as are all the functions declared in the TWTRComposerViewControllerDelegate.

So, TwitterKit should first check to see if the app has implemented before attempting to call it. This is pretty much standard practice for delegate protocols.

I did not check if all the functions must be implemented; I’m suspecting they do.

The biggest problem here is that if the app developer does not test these flows, then the app will crash.


You are right. All the functions in TWTRComposerViewControllerDelegate has to be implemented in order to compose/cancel a Tweet.
Thank you for pointing out. We will add this change in future release.