Updating to work with views that are contained in other views (i.e. UITableViewController)

Since iOS may wrap a view controller in another view controller for display purposes we needed some logic to find the actual view controller that was added to the stack.