Added viewController visibility check method.