centree
centree

Reputation: 2439

Get Storyboard ID or Class of previous view controller

I have a view controller that displays the details of a cell after it is selected. The view controller in question is used for multiple table views in the app, most display the same information but some are different. Because of this I need to know which view controller 'sent' the user to that page. Is there anyway to get the Storyboard ID or the Class name of the previous view controller. I'm putting together a simple switch statement.

Upvotes: 1

Views: 198

Answers (1)

Graham Perks
Graham Perks

Reputation: 23398

Sure... [[self presentingViewController] class] will give you the class.

Upvotes: 1

Related Questions