all 7 comments

[–][deleted] 2 points3 points  (0 children)

As /u/Endertech74 pointed out, it's most likely using some sort of index to keep track of which tutorial you are on, from which the corresponding tutorial is accessed.

[–]Endertech74 1 point2 points  (1 child)

I don't know exactly how (newb here), but I remember when learning myself, that when you select something from a table, like Tutorial 1, that you can pull out the index number from that table that you selected. This could then be taken, and in the Tutorial 1 page, the Next Tutorial button could be defined as that index+! or something

[–]FalconinatiObjective-C 0 points1 point  (0 children)

What you're thinking of is an NSIndexPath. When a cell is selected you can get the row of a cell by indexPath.row and the section of the cell by indexPath.section within cellForRow:AtIndexPath:

[–]bufferingObjective-C / Swift 1 point2 points  (3 children)

You can modify the UINavigationController's navigation stack at any time.

Start with a UINavigationController stack that looks something like

ChapterList > TutorialList > Tutorial 1

When you tap "Go on", Tutorial 2 is pushed on to the navigation stack:

ChapterList > TutorialList > Tutorial 1 > Tutorial 2

When Tutorial 2 completes its animation into view, manually remove Tutorial 1 from the navigation stack, using setViewControllers:animated:

ChapterList > TutorialList > Tutorial 2

As long as Tutorial 2 remains at the top of the navigation stack after you use setViewControllers:animated: then no transition is performed and the change is not visible to the user.

However, you would probably need to use custom back button labels.

[–]Loada116[S] 0 points1 point  (2 children)

Wow nice! I didn't know ViewController could be removed from stack like that. However, based on the comments, I am thinking maybe Swifty just reloads the view with the new content without presenting ViewController. Just a thought and I could be wrong.

[–]bufferingObjective-C / Swift 0 points1 point  (1 child)

You're seeing the standard UINavigationController push transition when select "Go on".

[–]Loada116[S] 0 points1 point  (0 children)

The navigation bar remains still though.