Program Back button to go back where it was called self.presentViewController

arthurbas

First of all, thanks for all the help I am receiving through stackoverflow.

I am making an app which takes information from a tableview and pass it to a viewController using the presentViewController method. Now I want to put a Back button to go back to the screen it was called.

Is it possible to accomplish that?

I do not want to put a segway because I want to use the same ViewController to display information coming from different ViewControllers to avoid creating a Viewcontroller (detailing the info) for every ViewController (that has the info resumed).

Let's put it this way, I have

First ViewControler Second ViewControler Third ViewControler Fourth ViewControler

DetailViewController (that displays the item info coming from one of the ViewControllers above)

From the First to the Fourth, each one has product information resumed, but I want to display the details depending on what item is tapped, then I show another ViewController with the item details, but I want to create one ViewController, instead of creating one ViewController for each.

Thanks!

Dave Barker

What you are asking is possible, but it sounds to me like you are trying to prematurely optimise for performance by not recreating the detail view controller each time. Is it really that expensive to recreate the detail view controller each time?

As far as the back button from the presented view controller, just add a UINavigationItem to your detail view controller that dismisses the view controller when actioned.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Swift - How to program a button to go to the mainScene, without segues going back?

From Dev

Webview back button won't go back

From Dev

back button doesn't go back

From Dev

Webview back button won't go back

From Dev

Go one back browser back button

From Dev

Getting the back button to go to the Launcher

From Dev

Nativescript behavior of the '< Go Back' button

From Dev

Changing where the back button leads to

From Dev

onCreate() called with onBackPressed but not by pressing the back button

From Dev

onActivityResult is not called when the back button in ActionBar is clicked

From Dev

onDestroy() gets called when the back button is pressed

From Dev

Back Button Image - what is it called in Swift?

From Dev

onActivityResult is not called when the back button in ActionBar is clicked

From Dev

onCreate() called with onBackPressed but not by pressing the back button

From Dev

Android: Press Back Button onCreate method is not called

From Dev

On brower back button app `init` method not called

From Dev

How to make program go back to the "menu"?

From Dev

How to make program go back to the "menu"?

From Dev

back button go back to another activity not the one i define it in the manifest

From Dev

After logout if browser back button press then it go back last screen

From Dev

Changing the UINavigationBar back button to an icon and retaining the swipe to go back

From Dev

back button go back to another activity not the one i define it in the manifest

From Dev

Codename One - BrowserComponent: use the back button to go back in history

From Dev

Need back button to go back to tab host on the tab it was currently on

From Dev

Display Back button to go back like the browser back button when not in home path

From Dev

Go back button in single-page webapp

From Dev

Make back button go to the previous view programmatically

From Dev

go back button between "grand child" fragment

From Dev

App closing when pressing go back button

Related Related

  1. 1

    Swift - How to program a button to go to the mainScene, without segues going back?

  2. 2

    Webview back button won't go back

  3. 3

    back button doesn't go back

  4. 4

    Webview back button won't go back

  5. 5

    Go one back browser back button

  6. 6

    Getting the back button to go to the Launcher

  7. 7

    Nativescript behavior of the '< Go Back' button

  8. 8

    Changing where the back button leads to

  9. 9

    onCreate() called with onBackPressed but not by pressing the back button

  10. 10

    onActivityResult is not called when the back button in ActionBar is clicked

  11. 11

    onDestroy() gets called when the back button is pressed

  12. 12

    Back Button Image - what is it called in Swift?

  13. 13

    onActivityResult is not called when the back button in ActionBar is clicked

  14. 14

    onCreate() called with onBackPressed but not by pressing the back button

  15. 15

    Android: Press Back Button onCreate method is not called

  16. 16

    On brower back button app `init` method not called

  17. 17

    How to make program go back to the "menu"?

  18. 18

    How to make program go back to the "menu"?

  19. 19

    back button go back to another activity not the one i define it in the manifest

  20. 20

    After logout if browser back button press then it go back last screen

  21. 21

    Changing the UINavigationBar back button to an icon and retaining the swipe to go back

  22. 22

    back button go back to another activity not the one i define it in the manifest

  23. 23

    Codename One - BrowserComponent: use the back button to go back in history

  24. 24

    Need back button to go back to tab host on the tab it was currently on

  25. 25

    Display Back button to go back like the browser back button when not in home path

  26. 26

    Go back button in single-page webapp

  27. 27

    Make back button go to the previous view programmatically

  28. 28

    go back button between "grand child" fragment

  29. 29

    App closing when pressing go back button

HotTag

Archive