0

***** You can download this project to see the issue *****

I've embedded SLPagingViewSwift in my project. In the third VC i added a button (and a table):

enter image description here

The button configured to do a segue (Present Modally):

enter image description here

In the target VC i have a button (marked in square green above) that do:

 @IBAction func dissmissIt(_ sender: AnyObject) {

    dismiss(animated: true, completion: nil)
}

But after the target VC is dismissed i see the button in the third VC in a different location (higher):

enter image description here

The layout is configured, button 40 pixels from the top (and table 8 pixels from the button):

enter image description here

What went wrong?

I guess the initial layout configuration takes the SLPagingViewSwift navigation bar into consideration but after the dismiss it recalculates the layout from the top of the screen.

What is the right way to perform the segue and dismiss the target VC while keeping the layout as designed?

I saw this answer

But i was not sure where to use it. i tried:

nav?.view.translatesAutoresizingMaskIntoConstraints = false

and

controller.view.translatesAutoresizingMaskIntoConstraints = false

But with no luck.

***** You can download this project to see the issue *****

Thanks.

Community
  • 1
  • 1
Eyal Ben Yehuda
  • 219
  • 3
  • 17
  • can you post your 3rdVC with the x button after view dismiss... – Joe Nov 05 '16 at 13:28
  • Hi @Joe, the X button is not on the third VC it is on another VC. the third VC have a button to segue to that other VC (https://s3.postimg.org/f870k2adf/Snip20161105_10.png). after the X is clicked and dismiss the other VC - i see the third VC again but with wrong layout. LMK if it is still not clear or that you need more details. thanks. – Eyal Ben Yehuda Nov 05 '16 at 14:51

1 Answers1

1

I had the same problem. After a lot of hour trying to fix it, I found the solution.

  1. Click on your segue
  2. On the right panel click on 'Show the attributes inspector'
  3. Set the Presentation option to 'Over Full Screen'.

Worked for me. I hope it works for you!

engtom
  • 44
  • 4