What UIViewController class am I looking at right now?

When you are looking at unfamiliar iOS Objective-C code (either someone else’s or your own), it can be tricky to figure out where code can be hiding out within a project.

Well no more. I found this interesting bit of method swizzling from Michael Armstrong that will show you which UIViewController subclass in on the screen at any time.


I went into this code and added a #define that I am setting in my .pch file, so that I can turn off the view controller labels if I do not need to see them.

As an iOS aside, if you are an iOS developer, I would recommend following Romain Briche either on Twitter or on his web site (broken link removed). I have found quite a few useful controls, code samples, and other hints and tutorials as a result of Romain’s postings.

BTW, Happy Birthday to Melody Thomas Scott, who I thought was fantastic in The Car, one of my all time favorite movies. (Oh, and she is on The Young and The Restless, too.)

Leave a Reply