Share Tweet crashes on ipad iOS 8.3


I just started experimenting with TwitterKit. It all works nice but when i tap share in the TWTRTweetView the application crashes on the ipad (not iphone).


*** Terminating app due to uncaught exception ‘NSGenericException’, reason: ‘UIPopoverPresentationController (<_UIAlertControllerActionSheetRegularPresentationController: 0x12a412800>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.’

Crash sharing images on iPad
Crash on iPad when sharing images

Yes, this is definitely a bug. I’ve added it to the internal bug tracker for the team.

Thanks for reporting.


not fixed yet ? still crashes in TwitterKit 1.7.0


Hi @stevenhepting, is there any workaround for this crash for now?


my workaround is to scan the subviews and find the UIButton then remove the target action associated and add your own


I used workaround you suggest, works fine for me.
Also i’ve pulled out format string from original TwitterKit bundle and now sharing looks exactly as it supposed to be in case if current issue would be fixed :blush:

 let subject = String(format: NSLocalizedString("tw__share_tweet_subject_format", bundle: frameworkBundle, comment: ""),,
 //Body text
 let text = String(format: NSLocalizedString("tw__share_tweet_generic_template_format", bundle: frameworkBundle, comment: ""),, tweet.permalink)


This issue has been fixed and will ship with the next release of TwitterKit.

Thanks for the bug post and the workarounds in the meantime!


still happens to me on TwitterKit 1.8.1!


oh sorry I just noticed it was 4d ago… This interface is kinda confusing…