热更新demo

orderHelpController.m 3.3KB

    // // orderHelpController.m // ThePaperBase // // Created by YoungLee on 15/9/8. // Copyright (c) 2015年 scar1900. All rights reserved. // #import "orderHelpController.h" #import "AppDelegate.h" @interface orderHelpController () @property(nonatomic, strong)UIImageView *centerView; @property(nonatomic, strong)UIButton *disBtn; @end @implementation orderHelpController - (void)viewDidLoad { [super viewDidLoad]; [self.view addSubview:self.centerView]; [self.view addSubview:self.disBtn]; if (IS_IPHONE4) { [self.centerView makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.view.centerX).offset(56); make.width.equalTo(@(217/2)); make.centerY.equalTo(self.view.centerY).offset(60); make.height.equalTo(@(89/2)); }]; }else if(IS_IPHONE5){ [self.centerView makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.view.centerX).offset(56); make.width.equalTo(@(217/2)); make.centerY.equalTo(self.view.centerY).offset(15); make.height.equalTo(@(89/2)); }]; }else if(rect_screen.size.height == 667){ [self.centerView makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.view.centerX).offset(70); make.width.equalTo(@(217/2)); make.centerY.equalTo(self.view.centerY).offset(35); make.height.equalTo(@(89/2)); }]; }else if (rect_screen.size.height == 736){ [self.centerView makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.view.centerX).offset(80); make.width.equalTo(@(217/2)); make.centerY.equalTo(self.view.centerY).offset(50); make.height.equalTo(@(89/2)); }]; } // [self.centerView makeConstraints:^(MASConstraintMaker *make) { // make.centerX.equalTo(self.view.centerX).offset(200/2); // make.width.equalTo(@(217/2)); // make.centerY.equalTo(self.view.centerY).offset(120); // make.height.equalTo(@(89/2)); // }]; [self.disBtn makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.view.left); make.right.equalTo(self.view.right); make.top.equalTo(self.view.top); make.bottom.equalTo(self.view.bottom); }]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; needGestureOfSideController(NO); /** * bug:5392(【倒退】栏目导航页:首次进入时,“长按拖入订阅”字样返回首页依然会显示) */ } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } -(UIImageView *)centerView{ if (!_centerView) { _centerView = [UIImageView new]; _centerView.image = Image(@"welcome/orderHelp.png"); } return _centerView; } -(UIButton *)disBtn{ if (!_disBtn) { _disBtn = [UIButton buttonWithType:UIButtonTypeCustom]; _disBtn.backgroundColor = [UIColor clearColor]; [_disBtn addTarget:self action:@selector(disSelector:) forControlEvents:UIControlEventTouchUpInside]; } return _disBtn; } -(void) disSelector:(UIButton *)btn{ if ([self.delegate respondsToSelector:@selector(disHelp)]) { [self.delegate disHelp]; } }@end