GitHub - CoderCC/CCPopoverView

/** 初始化一个popoverView
@param customView 需要显示的View
@param popStyle 显示时动画弹框样式
@param dismissStyle 移除时动画弹框样式
*/
- (nullable instancetype)initWithCustomView:(UIView *_Nonnull)customView
                                   popStyle:(CCPopoverStyle)popStyle
                               dismissStyle:(CCAnimationDismissStyle)dismissStyle;

/**
 显示时动画弹框样式
 */
typedef NS_ENUM(NSInteger, CCPopoverStyle) {
    CCPopoverStyleNO = 0,               ///< 无动画
    CCPopoverStyleScale,                
    CCPopoverStyleShakeFromTop,         
    CCPopoverStyleShakeFromBottom,      
    CCPopoverStyleShakeFromLeft,        
    CCPopoverStyleShakeFromRight,       
    CCPopoverStyleCardDropFromLeft,    
    CCPopoverStyleCardDropFromRight,    
    CCPopoverStyleLineFromBottom,
};

/**
 移除时动画弹框样式
 */
typedef NS_ENUM(NSInteger, CCAnimationDismissStyle) {
    CCAnimationDismissStyleNO = 0,               ///< 无动画
    CCAnimationDismissStyleScale,                
    CCAnimationDismissStyleDropToTop,            
    CCAnimationDismissStyleDropToBottom,         
    CCAnimationDismissStyleDropToLeft,           
    CCAnimationDismissStyleDropToRight,          
    CCAnimationDismissStyleCardDropToLeft,       
    CCAnimationDismissStyleCardDropToRight,      
    CCAnimationDismissStyleCardDropToTop,        
    CCAnimationDismissStyleLineToBottom,
};
CCPopoverView *popoverView = [[CCPopoverView alloc] initWithCustomView:theCustomView
                                                                  popStyle:popoverStyle
                                                              dismissStyle:dismissStyle];
    popoverView.popBGAlpha = .5f;
    popoverView.isObserverOrientationChange = YES;
    
    popoverView.popComplete = ^{
        // callback
    };
    
    popoverView.dismissComplete = ^{
        // callback
    };
              ...
              ...
              ...