






#import "OccurYetMajorController.h"
#import "GeneralViewController.h"

@interface OccurYetMajorController ()

@end

@implementation OccurYetMajorController


- (BOOL)shouldAutorotate {
    return self.topViewController.shouldAutorotate;
}

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return self.topViewController.supportedInterfaceOrientations;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.interactivePopGestureRecognizer.enabled = NO;
    [self setNavigationBarHidden:YES];
    self.view.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:.3];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    
    CGPoint point = [[touches anyObject] locationInView:self.view];
    
    UIView *allView = self.topViewController.view;
    
    point = [allView.layer convertPoint:point fromLayer:self.view.layer];
    
    GeneralViewController *its = (GeneralViewController *)self.topViewController;
    if (![allView.layer containsPoint:point]) {
        [its motionWasClearEjectHourly:touches withEvent:event];
    }else{  
        [super touchesBegan:touches withEvent:event];
    }
}

- (void)pushViewController:(GeneralViewController *)viewController animated:(BOOL)animated
{
    if (self.childViewControllers.count > 0) {
        viewController.reversingButton.hidden = NO;
    }else {
        viewController.reversingButton.hidden = YES;
    }
    [super pushViewController:viewController animated:animated];
    
}
- (void)dealloc {
    
}
@end
