Determine the frame of modal view controller or content within it relative to the base window?
===

I have a modal VC that I'm displaying on screen (on iPad) -- using UIModalPresentationFormSheet presentation style. I'd like to resize some content in the VC when the keyboard appears and obscures some elements within the VC. 

Determining the size of the keyboard is trivial, but determining the exact coordinates of the modal VC or content within it wrt to the base window is proving challenging. I would expect that:

    CGRect textViewFrame    = textView.frame;    
    CGRect frameWRTWindow   = [self.view convertRect:textViewFrame toView:nil]

would give me the size of the my textView relative to the base window. But the value of frameWRTWindow varies -- sometimes giving me the correct value, sometimes not. 

I'd hate to have to hard-code values, but that's where I'm at now.