ShareKit icon indicating copy to clipboard operation
ShareKit copied to clipboard

iOS 5 view won't close: parentViewController always nil

Open omichde opened this issue 12 years ago • 7 comments

Hello,

bear with me, this is my first github submission, but it may be useful: in iOS 5, dismissing a viewController by asking the parentViewControll to dismiss it, no longer works (as documented in the Help manuals). Instead it is recommended to ask the presentingViewController to do so. That said, in SHK.m -> hideCurrentViewControllerAnimated: after testing the parentViewController (which is always nil in iOS 5), SHK should add

    else if ([currentView respondsToSelector:@selector(presentingViewController)] && [currentView presentingViewController] != nil)
    {
        self.isDismissingView = YES;
        [[currentView presentingViewController] dismissModalViewControllerAnimated:animated];
    }

A feedback wether this works for others and how to commit such a change would be helpful, thank you - Oliver

omichde avatar Mar 11 '12 16:03 omichde

Huge thanks!!! You solved me a huge bug (after sharing the window won't close until killing the app!!!). Thanks!!!

yanivefraim avatar Mar 13 '12 13:03 yanivefraim

Thanks,this really help me too much. i have solved this BUG by your recommend.

siweidw avatar Mar 20 '12 06:03 siweidw

Thank you so much, it absolutly works for me. Suggest a commit !

philippeauriach avatar Apr 04 '12 11:04 philippeauriach

Thanks this works perfectly.

nickmadole avatar Jun 22 '12 20:06 nickmadole

Works for me too, Thanks!

sidan5 avatar Jul 02 '12 09:07 sidan5

Thank you so much! You saved my life

yanpengchao avatar Aug 16 '12 15:08 yanpengchao

Thank a lot!

hoanghuu avatar Nov 09 '12 03:11 hoanghuu