diff --git a/Classes/MMAlertView.h b/Classes/MMAlertView.h index 48b02df..6b3c0e1 100644 --- a/Classes/MMAlertView.h +++ b/Classes/MMAlertView.h @@ -14,6 +14,7 @@ typedef void(^MMPopupInputHandler)(NSString *text); @interface MMAlertView : MMPopupView @property (nonatomic, assign) NSUInteger maxInputLength; // default is 0. Means no length limit. +@property (nonatomic, assign) BOOL hidePassively; // default false. alertView will not hide by click item if true - (instancetype) initWithInputTitle:(NSString*)title detail:(NSString*)detail diff --git a/Classes/MMAlertView.m b/Classes/MMAlertView.m index e41bb5b..e6b0c74 100644 --- a/Classes/MMAlertView.m +++ b/Classes/MMAlertView.m @@ -253,14 +253,16 @@ - (void)actionButton:(UIButton*)btn if ( self.withKeyboard && (btn.tag==1) ) { - if ( self.inputView.text.length > 0 ) + if ( self.inputView.text.length > 0 && !self.hidePassively) { [self hide]; } } else { - [self hide]; + if (!self.hidePassively) { + [self hide]; + } } if ( self.inputHandler && (btn.tag>0) ) diff --git a/MMPopupView/.DS_Store b/MMPopupView/.DS_Store new file mode 100644 index 0000000..eb9299a Binary files /dev/null and b/MMPopupView/.DS_Store differ