| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //
- // MOBaseViewController.m
- // MiMoLive
- //
- // Created by SuperC on 2023/10/9.
- //
- #import "MOBaseViewController.h"
- @interface MOBaseViewController ()
- @end
- @implementation MOBaseViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- self.view.backgroundColor = [MOTools colorWithHexString:@"#F9F9F9" alpha:1.0];
-
- if (@available(iOS 13.0, *)) {
- UINavigationBarAppearance *appearance = [UINavigationBarAppearance new];
- [appearance configureWithOpaqueBackground];
- // 设置导航栏阴影图片
- appearance.backgroundColor = [UIColor whiteColor];
- appearance.shadowImage = [MOTools createImageWithColor:[UIColor clearColor]];
- self.navigationController.navigationBar.standardAppearance = appearance;
- self.navigationController.navigationBar.scrollEdgeAppearance =self.navigationController.navigationBar.standardAppearance;
- } else {}
-
- // 解决右滑返回失效问题
- self.navigationController.interactivePopGestureRecognizer.delegate = self;
- }
- - (void)viewDidAppear:(BOOL)animated {
- [super viewDidAppear:animated];
-
- if(self.navigationController.viewControllers.firstObject == self){
- // 是否允许右滑返回
- [self.navigationController.interactivePopGestureRecognizer setEnabled:NO];
- }
- else{
- // 是否允许右滑返回
- [self.navigationController.interactivePopGestureRecognizer setEnabled:YES];
- }
- }
- - (UIInterfaceOrientationMask)supportedInterfaceOrientations{
- return UIInterfaceOrientationMaskPortrait;
- }
- @end
|