// // RAEditRequiredAlert.m // Apex And Drivers // // Created by Jack on 2018/9/6. // Copyright © 2018年 USAI. All rights reserved. // #import "RAEditRequiredAlert.h" @interface RAEditRequiredAlert () @property (strong, nonatomic) IBOutlet UILabel *titleLabel; @property (strong, nonatomic) IBOutlet UILabel *msgLabel; @property (nonatomic,copy) NSString *alertTitle; @property (nonatomic,copy) NSString *alertMessage; @end @implementation RAEditRequiredAlert + (instancetype)alertWithTile:(NSString *)title message:(NSString *)msg { RAEditRequiredAlert *alertVC = [[UIStoryboard storyboardWithName:@"Edit" bundle:nil] instantiateViewControllerWithIdentifier:NSStringFromClass(self)]; alertVC.alertTitle = title; alertVC.alertMessage = msg; return alertVC; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.titleLabel.text = self.alertTitle; [self.titleLabel sizeToFit]; self.msgLabel.text = self.alertMessage; [self.msgLabel sizeToFit]; CGFloat h = CGRectGetHeight(self.titleLabel.bounds) + CGRectGetHeight(self.msgLabel.bounds) + 60.0f; CGFloat w = 300.0f; self.preferredContentSize = CGSizeMake(w, h); } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (IBAction)okBtnClick:(id)sender { [self dismissViewControllerAnimated:YES completion:nil]; } @end