问题
Can a viewcontroller access the identifier of the segue that was used to transition to it? For example, I transition from viewcontroller A to viewcontroller B using a segue with the identifier "mySegue". Is there anyway for viewcontroller B to get the segue's identifier?
回答1:
I don't believe there is such a property. This kind of thing should be handled via the calling VC's prepareForSegue:sender method (as said in the comments) and then assigning a custom property to denote where it came from, etc.
来源:https://stackoverflow.com/questions/10629399/can-a-viewcontroller-access-the-identifier-of-an-incoming-segue