问题描述:

I've used STPopup library for created a popup in iOS app with Objective-c, so everything was fine.

Now I want dismiss popup by tapping in background but my code don't work and get error backgroundViewDidTap]: unrecognized selector sent to instance 0x15780b7b0

ViewController.m

- (void)showPopupDaudit{

STPopupController *popupController = [[STPopupController alloc] initWithRootViewController:[POPViewController new]];

[STPopupNavigationBar appearance].tintColor = MP_HEX_RGB(MAINCOLOR);;

popupController.containerView.layer.cornerRadius = 4;

if (NSClassFromString(@"UIBlurEffect")) {

UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];

popupController.backgroundView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];

}

[popupController.backgroundView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:popupController

action:@selector(backgroundViewDidTap)]];

[popupController presentInViewController:self];

}

POPUPController.m

- (IBAction)backgroundViewDidTap

{

[self.popupController dismiss];

}

Any idea?

相关阅读:
Top