DYTPopupManager 是Objective-C编写的弹窗组件(可使用磨砂玻璃效果),支持View、ViewController的弹出,可配置弹出位置、弹窗样式、弹窗遮罩样式(黑色半透明、磨砂玻璃效果),并通过Delegate触发弹窗出现前、弹窗出现后、弹窗退出前、弹窗退出后事件。
效果
效果录屏:http://www.tudou.com/programs/view/RCKykoRawxw/
基本参数
DYTPopupStyle 弹窗样式,默认是无任何样式
typedef NS_ENUM(NSInteger, DYTPopupStyle){
DYTPopupStyleNone = 0,
DYTPopupStyleCancelButton
};
DYTPopupMaskStyle 弹窗遮罩样式,默认是灰色
typedef NS_ENUM(NSInteger, DYTPopupMaskStyle){
DYTPopupMaskStyleGray = 0, //灰色
DYTPopupMaskStyleBlur //高斯模糊
};
DYTPopupPosition 弹窗位置,默认是底部弹窗
typedef NS_ENUM(NSInteger, DYTPopupPosition){
DYTPopupPositionBottom = 0,
DYTPopupPositionCenter
};
Delegate
弹窗弹出前
-(void)dyt_popupViewWillPresent:(UIView *)popupView;
弹窗弹出后
-(void)dyt_popupViewDidPresent:(UIView *)popupView;
弹出隐藏前
-(void)dyt_popupViewWillDismiss:(UIView *)popupView;
弹出隐藏后
-(void)dyt_popupViewDidDismiss:(UIView *)popupView;
示例
self.popupManager = [[DYTPopupManager alloc] init];
self.popupManager.delegate = self;
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 200)];
[self.popupManager showPopupViewWithView:view style:DYTPopupStyleNone maskStyle:DYTPopupMaskStyleBlur position:DYTPopupPositionBottom animation:YES];