FSImageViewer icon indicating copy to clipboard operation
FSImageViewer copied to clipboard

Improved modal detection

Open harlanhaskins opened this issue 10 years ago • 12 comments

Trying to push this view controller onto a navigation stack that's already being presented causes a 'Done' button. This new method only puts on a done button if the FSImageViewerViewController is the only view controller in the navigation stack.

harlanhaskins avatar Jul 04 '15 02:07 harlanhaskins

Hi @harlanhaskins,

i think this could lead to problems, if you use a a other presentation style, or?

Best,

Felix

x2on avatar Jul 05 '15 13:07 x2on

Hi x2on,

I'm not sure the modalPresentationStyle will affect this...

Right now, I'm using FSImageViewerViewController inside a modal that was presented using UIModalPresentationStyleOverCurrentContext.

This only checks to make sure it's the only thing in the navigation hierarchy before presenting the 'Done' button vs. back button.

harlanhaskins avatar Jul 05 '15 13:07 harlanhaskins

Wouldn't it be better to check if presentingViewController exists and the style is UIModalPresentationFullScreen or UIModalPresentationStyleOverCurrentContext and your change?

x2on avatar Jul 05 '15 19:07 x2on

That's a good point -- I can make that change

harlanhaskins avatar Jul 05 '15 19:07 harlanhaskins

Any news?

x2on avatar Sep 03 '15 17:09 x2on

Totally forgot! I updated the PR.

harlanhaskins avatar Sep 03 '15 18:09 harlanhaskins

The travis build is broken - i will have a look at it.

x2on avatar Sep 04 '15 12:09 x2on

Any chance we can merge this?

harlanhaskins avatar Sep 18 '15 21:09 harlanhaskins

Could you please merge current master into your branch?

x2on avatar Sep 21 '15 12:09 x2on

I was running across this as well. A done button would be incorrectly presented in certain circumstances. After making this change, the issue has gone away. Has this change been successfully merged into master?

iamroberthood avatar Jan 28 '16 20:01 iamroberthood

Any news about merging?

x2on avatar Sep 01 '16 13:09 x2on

Oh, my apologies. I'll do this later today!

harlanhaskins avatar Sep 01 '16 13:09 harlanhaskins