1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- //
- // MTAlertView.m
- // FunnyFish
- //
- // Created by Simon on 2020/9/27.
- // Copyright © 2020 Linchng Wang. All rights reserved.
- //
- #import "MTAlertView.h"
- @interface MTAlertView ()
- @property (weak, nonatomic) IBOutlet UIView *centerView;
- @end
- @implementation MTAlertView
- - (instancetype)initWithFrame:(CGRect)frame
- {
- self = [super initWithFrame:frame];
- self = [[[NSBundle mainBundle] loadNibNamed:@"MTAlertView" owner:self options:nil] lastObject];
- if (self) {
- self.frame = frame;
- [self setupViews];
- }
- return self;
- }
- -(void)setupViews{
- [self.centerView mt_yuanjiao:kNumFrom375(14)];
- [[self.leftBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
- [self removeFromSuperview];
- if (self.leftBlock) {
- self.leftBlock();
- }
- }];
- [[self.rightBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
- [self removeFromSuperview];
- if (self.rightBlock) {
- self.rightBlock();
- }
- }];
- }
- @end
|