Share Tweet crashes on ipad iOS 8.3


#1

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).

Error:

*** 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
#2

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

Thanks for reporting.


#3

not fixed yet ? still crashes in TwitterKit 1.7.0


#4

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


#5

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


#6

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:

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

#7

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!


#8

still happens to me on TwitterKit 1.8.1!


#9

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


#10