Say I segue from UIViewController A to UIViewController B. Is there a way to know, from inside UIViewController B, whether UIViewController B was a result of a push vs a modal segue?
Asked
Active
Viewed 956 times
0

Cyrille
- 25,014
- 12
- 67
- 90

Katedral Pillon
- 14,534
- 25
- 99
- 199
-
Note, the accepted answer in the duplicate is not the best solution. – rmaddy Sep 17 '14 at 16:02
1 Answers
1
If your view controller has its property presentingViewController
set to something other than nil
, then it's being presented modally by that controller. Else, you can assume it's been pushed (thus, self.parentViewController
should be an UINavigationController
).

Cyrille
- 25,014
- 12
- 67
- 90