thiagoperes / IDMPhotoBrowser

Photo Browser / Viewer inspired by Facebook's and Tweetbot's with ARC support, swipe-to-dismiss, image progress and more
MIT License
2.71k stars 642 forks source link

Auto Layout Invalid After Dismissing Photo Browser #196

Open vito-royeca opened 8 years ago

vito-royeca commented 8 years ago

This happens when i used pan gestures. However if no pan gesture is used and only the Done button was tapped to dismiss the browser, auto layout is still valid.

The root view of the view presenter is a UITabBarController. I present the browser in one of its view controllers and it has auto layout constraints.

jyounus commented 8 years ago

Were you able to fix or find a workaround for this issue @jovito-royeca?

jyounus commented 8 years ago

I was able to find a workaround. I have to constrain my collection view to the top of the view controller and not using the Top Layout Guide.

I use PureLayout for my auto layout stuff and here's what I did before: collectionView.autoPinToTopLayoutGuideOfViewController(vc, withInset: 0)

Had to change it to: collectionView.autoPinEdgeToSuperviewEdge(.Top, withInset: 20)

This workaround is not ideal as the in-call status bar is messed up now but better than the whole UI being messed up when the user swipes up/down to dismiss a photo.

If anyone has a proper fix or a better workaround, please share! Thanks.

vito-royeca commented 8 years ago

Thank you @jyounus . I will try your solution and get back to you.