-1

I'm having an issue with segues in swift. In the picture I gave an example of the problem I'm having; basically I make a button in a view controller and link it to the next view controller via a segue. The problem is that when I make the segue, the view controller turns into a "tab" I guess is the way to put it, and in the application, the user can just swipe down on the tap to return to the previous view controller.(As shown in the transition from picture 1 to picture 2) This is problematic because if the user goes back and forth with the buttons between view controllers, it makes new instances of the view controllers that stack on top of each other, and lag starts to set in because of the memory usage.

It's been a while since I've done swift programming, but I remember that when a segue was made, it would just transition from the view controllers without creating these, again I'll call them, "tabs". Does anyone know why this is happening?enter image description hereenter image description here

S. Carr
  • 149
  • 1
  • 8
  • 1
    [View Controller Presentation Changes in iOS 13](https://medium.com/@hacknicity/view-controller-presentation-changes-in-ios-13-ac8c901ebc4e); [Presenting modal in iOS 13 fullscreen](https://stackoverflow.com/questions/56435510/presenting-modal-in-ios-13-fullscreen); [iOS 13: Changes in the ViewController Presentation Style](https://zonneveld.dev/ios-13-viewcontroller-presentation-style-modalpresentationstyle/); [5 breaking changes to check before building your app for iOS 13](https://fluffy.es/4-ios13-breaking-changes/) – MadProgrammer Feb 07 '20 at 00:02
  • @MadProgrammer Thank you so much! Spent about an hour on that, and it was such a simple solution. – S. Carr Feb 07 '20 at 00:10

2 Answers2

1

Click the path of the segue, it will open the right pane, open the attribute inspector and under storyboard segue change the dropdown next to "Kind" then change it to "Show (e.g Push)"

For reference:

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Jimmers
  • 21
  • 3
0

This is problematic because if the user goes back and forth with the buttons between view controllers, it makes new instances of the view controllers that stack on top of each other,

If that’s happening, it’s because your Go Back button is incorrectly configured. You need to set up an unwind segue, or else have the Go Back button’s action handler call dismiss.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • If you’re having a pile up problem now, you were always doing this wrong. It has nothing to do with how a presented view controller _looks_ in iOS 13. – matt Feb 07 '20 at 00:21
  • Yes I am just realizing this now. – S. Carr Feb 07 '20 at 00:24