| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- //
- // 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
|