0

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?

Cyrille
  • 25,014
  • 12
  • 67
  • 90
Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199

1 Answers1

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