urbn / URBNShareKit

MIT License
19 stars 2 forks source link

iPad iOS8 #4

Open Binusz opened 8 years ago

Binusz commented 8 years ago

it does not work at iPad with iOS 8+

ryang1428 commented 8 years ago

Any more info? I tried in the iOS 9 simulator and it seemed to be working, I am charging up a real iPad now to test out on there.

Binusz commented 8 years ago

May be its my fault. i should check popoverPresentationController with respondsToSelector. It is good to add detailed information about ipad in your Readme file.

ryang1428 commented 8 years ago

Can you post some code with what you need to do? Thanks

Binusz commented 8 years ago
// on iOS8
if ([urbnActivityController respondsToSelector:@selector(popoverPresentationController)]) {
        urbnActivityController.popoverPresentationController.barButtonItem = (UIBarButtonItem *)sender;
    }  
    [self presentViewController:urbnActivityController animated:YES completion:nil];  

On iOS 8 or later, we should check popoverPresentationController. Otherwise, when try to present, app will be crashed.

if you mention that in your readme. it would be appropriate.