DYTPopupManager 是Objective-C編寫的彈窗組件(可使用磨砂玻璃效果),支持View、ViewController的彈出,可配置彈出位置用押、彈窗樣式、彈窗遮罩樣式(黑色半透明靶剑、磨砂玻璃效果)蜻拨,并通過Delegate觸發(fā)彈窗出現(xiàn)前池充、彈窗出現(xiàn)后、彈窗退出前缎讼、彈窗退出后事件纵菌。
效果
效果錄屏:http://www.tudou.com/programs/view/RCKykoRawxw/
基本參數(shù)
DYTPopupStyle 彈窗樣式,默認(rèn)是無任何樣式
typedef NS_ENUM(NSInteger, DYTPopupStyle){
DYTPopupStyleNone = 0,
DYTPopupStyleCancelButton
};
DYTPopupMaskStyle 彈窗遮罩樣式休涤,默認(rèn)是灰色
typedef NS_ENUM(NSInteger, DYTPopupMaskStyle){
DYTPopupMaskStyleGray = 0, //灰色
DYTPopupMaskStyleBlur //高斯模糊
};
DYTPopupPosition 彈窗位置,默認(rèn)是底部彈窗
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];