Is it possible to check inside ViewController class that it is presented as modal view controller?
This should work.
if(self.parentViewController.modalViewController == self)…