I have an alert-style view that I want to push in front of whatever the current view is, but I need a reference to the current view so that I can call these two lines:
currentView.InsertSubviewAbove(myNewViewToShow, currentView);
currentView.BringSubviewToFront(myNewViewToShow);
So how do I get a reference to the current view?
I saw the answer at the bottom of this link: Get active view in iOS
MyAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
UIView *topView = appDelegate.viewController.view;
and I tried this:
((AppDelegate)UIApplication.SharedApplication.Delegate).ViewController.View
but as far as I can tell, there is no 'ViewController' property in the Monotouch appDelegate.
I am using storyboards and segues to control my program flow. I have a background thread that is monitoring for various error conditions and needs to overlay a UIView on top of the currently-displayed view whenever an error occurs.