├── .gitignore ├── .swift-version ├── GKCover.podspec ├── GKCover ├── Category │ ├── UIView+GKExtension.h │ └── UIView+GKExtension.m ├── GKCover.h ├── GKCover.m └── GKCoverEnum.h ├── GKCoverDemo ├── GKCoverDemo-gif.gif ├── GKCoverDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── GKCoverDemo │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── share1.imageset │ │ │ ├── Contents.json │ │ │ └── share1.png │ │ ├── share2.imageset │ │ │ ├── Contents.json │ │ │ └── share2.png │ │ └── top1.imageset │ │ │ ├── Contents.json │ │ │ └── top1.png │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Classes │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Demo │ │ │ ├── Controller │ │ │ │ ├── GKCoverDemo_v240.h │ │ │ │ └── GKCoverDemo_v240.m │ │ │ └── View │ │ │ │ ├── GKCoverView.h │ │ │ │ ├── GKCoverView.m │ │ │ │ └── GKCoverView.xib │ │ └── main.m │ ├── Info.plist │ └── PrefixHeader.pch ├── GKCoverDemoTests │ ├── GKCoverDemoTests.m │ └── Info.plist ├── GKCoverDemoUITests │ ├── GKCoverDemoUITests.m │ └── Info.plist ├── demo_bottom.png ├── demo_center.png └── demo_top.png ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # macOS 2 | .DS_Store 3 | 4 | # Xcode 5 | # 6 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 7 | 8 | ## Build generated 9 | build/ 10 | DerivedData/ 11 | 12 | ## Various settings 13 | *.pbxuser 14 | !default.pbxuser 15 | *.mode1v3 16 | !default.mode1v3 17 | *.mode2v3 18 | !default.mode2v3 19 | *.perspectivev3 20 | !default.perspectivev3 21 | xcuserdata/ 22 | 23 | ## Other 24 | *.moved-aside 25 | *.xcuserstate 26 | 27 | ## Obj-C/Swift specific 28 | *.hmap 29 | *.ipa 30 | *.dSYM.zip 31 | *.dSYM 32 | 33 | # CocoaPods 34 | # 35 | # We recommend against adding the Pods directory to your .gitignore. However 36 | # you should judge for yourself, the pros and cons are mentioned at: 37 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 38 | # 39 | # Pods/ 40 | 41 | # Carthage 42 | # 43 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 44 | # Carthage/Checkouts 45 | 46 | Carthage/Build 47 | 48 | # fastlane 49 | # 50 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 51 | # screenshots whenever they are needed. 52 | # For more information about the recommended setup visit: 53 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 54 | 55 | fastlane/report.xml 56 | fastlane/screenshots 57 | 58 | #Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 2.3 2 | -------------------------------------------------------------------------------- /GKCover.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "GKCover" 3 | s.version = "3.0.1" 4 | s.summary = "一行代码显示遮罩视图,让你的弹窗更easy!" 5 | s.homepage = "https://github.com/QuintGao/GKCover" 6 | s.license = "MIT" 7 | s.authors = { "高坤" => "1094887059@qq.com" } 8 | s.social_media_url = "https://github.com/QuintGao" 9 | s.platform = :ios, "6.0" 10 | s.ios.deployment_target = '6.0' 11 | s.source = { :git => "https://github.com/QuintGao/GKCover.git", :tag => s.version.to_s } 12 | 13 | s.requires_arc = true 14 | s.source_files = 'GKCover/**/*.{h,m}' 15 | s.public_header_files = 'GKCover/**/*.{h}' 16 | s.frameworks = "Foundation", "UIKit" 17 | 18 | end 19 | -------------------------------------------------------------------------------- /GKCover/Category/UIView+GKExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+GKExtension.h 3 | // GKCoverDemo 4 | // 5 | // Created by QuintGao on 16/8/24. 6 | // Copyright © 2016年 QuintGao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (GKExtension) 12 | 13 | @property CGFloat gk_width; 14 | @property CGFloat gk_height; 15 | @property CGFloat gk_x; 16 | @property CGFloat gk_y; 17 | @property CGFloat gk_right; 18 | @property CGFloat gk_bottom; 19 | @property CGFloat gk_centerX; 20 | @property CGFloat gk_centerY; 21 | @property CGSize gk_size; 22 | 23 | + (instancetype)gk_viewFromXib; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /GKCover/Category/UIView+GKExtension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+GKExtension.m 3 | // GKCoverDemo 4 | // 5 | // Created by QuintGao on 16/8/24. 6 | // Copyright © 2016年 QuintGao. All rights reserved. 7 | // 8 | 9 | #import "UIView+GKExtension.h" 10 | 11 | @implementation UIView (GKExtension) 12 | 13 | - (void)setGk_width:(CGFloat)gk_width 14 | { 15 | CGRect rect = self.frame; 16 | rect.size.width = gk_width; 17 | self.frame = rect; 18 | } 19 | 20 | - (CGFloat)gk_width 21 | { 22 | return self.frame.size.width; 23 | } 24 | 25 | - (void)setGk_height:(CGFloat)gk_height 26 | { 27 | CGRect rect = self.frame; 28 | rect.size.height = gk_height; 29 | self.frame = rect; 30 | } 31 | 32 | - (CGFloat)gk_height 33 | { 34 | return self.frame.size.height; 35 | } 36 | 37 | - (void)setGk_x:(CGFloat)gk_x 38 | { 39 | CGRect rect = self.frame; 40 | rect.origin.x = gk_x; 41 | self.frame = rect; 42 | } 43 | 44 | - (CGFloat)gk_x 45 | { 46 | return self.frame.origin.x; 47 | } 48 | 49 | - (void)setGk_y:(CGFloat)gk_y 50 | { 51 | CGRect rect = self.frame; 52 | rect.origin.y = gk_y; 53 | self.frame = rect; 54 | } 55 | 56 | - (CGFloat)gk_y 57 | { 58 | return self.frame.origin.y; 59 | } 60 | 61 | - (void)setGk_right:(CGFloat)gk_right 62 | { 63 | CGRect rect = self.frame; 64 | rect.origin.x = gk_right - rect.size.width; 65 | self.frame = rect; 66 | } 67 | 68 | - (CGFloat)gk_right 69 | { 70 | return self.frame.origin.x + self.frame.size.width; 71 | } 72 | 73 | - (void)setGk_bottom:(CGFloat)gk_bottom 74 | { 75 | CGRect rect = self.frame; 76 | rect.origin.y = gk_bottom - rect.size.height; 77 | self.frame = rect; 78 | } 79 | 80 | - (CGFloat)gk_bottom 81 | { 82 | return self.frame.origin.y + self.frame.size.height; 83 | } 84 | 85 | - (void)setGk_centerX:(CGFloat)gk_centerX 86 | { 87 | CGPoint center = self.center; 88 | center.x = gk_centerX; 89 | self.center = center; 90 | } 91 | 92 | - (CGFloat)gk_centerX 93 | { 94 | return self.center.x; 95 | } 96 | 97 | - (void)setGk_centerY:(CGFloat)gk_centerY 98 | { 99 | CGPoint center = self.center; 100 | center.y = gk_centerY; 101 | self.center = center; 102 | } 103 | 104 | - (CGFloat)gk_centerY 105 | { 106 | return self.center.y; 107 | } 108 | 109 | - (void)setGk_size:(CGSize)gk_size 110 | { 111 | CGRect rect = self.frame; 112 | rect.size = gk_size; 113 | self.frame = rect; 114 | } 115 | 116 | - (CGSize)gk_size 117 | { 118 | return self.frame.size; 119 | } 120 | 121 | + (instancetype)gk_viewFromXib 122 | { 123 | return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject]; 124 | } 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /GKCover/GKCover.h: -------------------------------------------------------------------------------- 1 | // 2 | // GKCover.h 3 | // GKCoverDemo 4 | // 5 | // Created by QuintGao on 16/8/24. 6 | // Copyright © 2016年 QuintGao. All rights reserved. 7 | // GKCover-一个简单的遮罩视图,让你的弹窗更easy,支持自定义遮罩弹窗 8 | // github:https://github.com/QuintGao/GKCover 9 | 10 | #import 11 | #import "GKCoverEnum.h" 12 | #import "UIView+GKExtension.h" 13 | 14 | typedef void(^showBlock)(void); 15 | typedef void(^hideBlock)(void); 16 | 17 | @interface GKCover : UIView 18 | 19 | /// 快速创建遮罩 20 | /// @param fromView 显示在此视图上 21 | /// @param contentView 显示的内容视图 22 | /// @param style 遮罩类型 23 | /// @param showStyle 显示类型 24 | /// @param showAnimStyle 显示动画类型 25 | /// @param hideAnimStyle 隐藏动画类型 26 | /// @param notClick 是否不可点击 27 | + (void)coverFrom:(UIView *)fromView 28 | contentView:(UIView *)contentView 29 | style:(GKCoverStyle)style 30 | showStyle:(GKCoverShowStyle)showStyle 31 | showAnimStyle:(GKCoverShowAnimStyle)showAnimStyle 32 | hideAnimStyle:(GKCoverHideAnimStyle)hideAnimStyle 33 | notClick:(BOOL)notClick; 34 | 35 | /// 快速创建遮罩 36 | /// @param fromView 显示在此视图上 37 | /// @param contentView 显示的内容视图 38 | /// @param style 遮罩类型 39 | /// @param showStyle 显示类型 40 | /// @param showAnimStyle 显示动画类型 41 | /// @param hideAnimStyle 隐藏动画类型 42 | /// @param notClick 是否不可点击 43 | /// @param showBlock 显示后的回调 44 | /// @param hideBlock 隐藏后的回调 45 | + (void)coverFrom:(UIView *)fromView 46 | contentView:(UIView *)contentView 47 | style:(GKCoverStyle)style 48 | showStyle:(GKCoverShowStyle)showStyle 49 | showAnimStyle:(GKCoverShowAnimStyle)showAnimStyle 50 | hideAnimStyle:(GKCoverHideAnimStyle)hideAnimStyle 51 | notClick:(BOOL)notClick 52 | showBlock:(showBlock)showBlock 53 | hideBlock:(hideBlock)hideBlock; 54 | 55 | /// 快速创建遮罩 56 | /// @param fromView 显示在此视图上 57 | /// @param contentView 显示的内容视图 58 | /// @param margin 遮罩与父视图的距离 59 | /// @param style 遮罩类型 60 | /// @param showStyle 显示类型 61 | /// @param showAnimStyle 显示的动画类型 62 | /// @param hideAnimStyle 隐藏的动画类型 63 | /// @param notClick 是否不可点击 64 | + (void)coverFrom:(UIView *)fromView 65 | contentView:(UIView *)contentView 66 | margin:(CGFloat)margin 67 | style:(GKCoverStyle)style 68 | showStyle:(GKCoverShowStyle)showStyle 69 | showAnimStyle:(GKCoverShowAnimStyle)showAnimStyle 70 | hideAnimStyle:(GKCoverHideAnimStyle)hideAnimStyle 71 | notClick:(BOOL)notClick; 72 | 73 | /// 快速创建遮罩 74 | /// @param fromView 显示在此视图上 75 | /// @param contentView 显示的内容视图 76 | /// @param margin 遮罩与父视图的距离 77 | /// @param style 遮罩类型 78 | /// @param showStyle 显示类型 79 | /// @param showAnimStyle 显示的动画类型 80 | /// @param hideAnimStyle 隐藏的动画类型 81 | /// @param notClick 是否不可点击 82 | /// @param showBlock 显示后的回调 83 | /// @param hideBlock 隐藏后的回调 84 | + (void)coverFrom:(UIView *)fromView 85 | contentView:(UIView *)contentView 86 | margin:(CGFloat)margin 87 | style:(GKCoverStyle)style 88 | showStyle:(GKCoverShowStyle)showStyle 89 | showAnimStyle:(GKCoverShowAnimStyle)showAnimStyle 90 | hideAnimStyle:(GKCoverHideAnimStyle)hideAnimStyle 91 | notClick:(BOOL)notClick 92 | showBlock:(showBlock)showBlock 93 | hideBlock:(hideBlock)hideBlock; 94 | 95 | 96 | /** 97 | 显示遮罩-隐藏状态栏 98 | 99 | @param contentView 显示的内容视图 100 | @param style 遮罩类型 101 | @param showStyle 显示方式 102 | @param showAnimStyle 显示动画类型 103 | @param hideAnimStyle 隐藏动画类型 104 | @param notClick 是否不可点击 105 | @param showBlock 显示后的block 106 | @param hideBlock 隐藏后的block 107 | */ 108 | 109 | 110 | /// 快速创建遮罩,遮盖状态栏 111 | /// @param contentView 显示的内容视图 112 | /// @param style 遮罩类型 113 | /// @param showStyle 显示类型 114 | /// @param showAnimStyle 显示的动画类型 115 | /// @param hideAnimStyle 隐藏的动画类型 116 | /// @param notClick 是否不可点击 117 | /// @param showBlock 显示后的回调 118 | /// @param hideBlock 隐藏后的回调 119 | + (void)coverHideStatusBarWithContentView:(UIView *)contentView 120 | style:(GKCoverStyle)style 121 | showStyle:(GKCoverShowStyle)showStyle 122 | showAnimStyle:(GKCoverShowAnimStyle)showAnimStyle 123 | hideAnimStyle:(GKCoverHideAnimStyle)hideAnimStyle 124 | notClick:(BOOL)notClick 125 | showBlock:(showBlock)showBlock 126 | hideBlock:(hideBlock)hideBlock; 127 | 128 | 129 | /// 快速创建中间遮罩 130 | /// @param fromView 显示在此视图上 131 | /// @param contentView 显示的内容视图 132 | /// @param style 遮罩类型 133 | /// @param animation 自定义动画 134 | /// @param notClick 是否不可点击 135 | + (void)showAlertViewFrom:(UIView *)fromView 136 | contentView:(UIView *)contentView 137 | style:(GKCoverStyle)style 138 | animation:(CAAnimation *)animation 139 | notClick:(BOOL)notClick; 140 | 141 | /// 快速创建中间遮罩 142 | /// @param fromView 显示在此视图上 143 | /// @param contentView 显示的内容视图 144 | /// @param style 遮罩类型 145 | /// @param animation 自定义动画 146 | /// @param notClick 是否不可点击 147 | /// @param showBlock 显示后的回调 148 | /// @param hideBlock 隐藏后的回调 149 | + (void)showAlertViewFrom:(UIView *)fromView 150 | contentView:(UIView *)contentView 151 | style:(GKCoverStyle)style 152 | animation:(CAAnimation *)animation 153 | notClick:(BOOL)notClick 154 | showBlock:(showBlock)showBlock 155 | hideBlock:(hideBlock)hideBlock; 156 | 157 | /// 判断是否已经存在cover 158 | + (BOOL)hasCover; 159 | 160 | /// 改变遮罩透明度,只对半透明遮罩生效 161 | /// @param alpha 透明度 162 | + (void)changeAlpha:(CGFloat)alpha; 163 | 164 | /// 改变遮罩背景色 165 | /// @param bgColor 背景色 166 | + (void)changeCoverBgColor:(UIColor *)bgColor; 167 | 168 | /// 隐藏遮罩 169 | + (void)hideCover; 170 | 171 | /// 隐藏遮罩并设置回调,调用此方法主方法中的hideBlock将不再起作用 172 | /// @param hideBlock 隐藏成功后的回调 173 | + (void)hideCoverWithHideBlock:(hideBlock)hideBlock; 174 | 175 | /// 无动画隐藏 176 | + (void)hideCoverWithoutAnimation; 177 | 178 | /// 重新布局 179 | + (void)layoutSubViews; 180 | 181 | @end 182 | -------------------------------------------------------------------------------- /GKCover/GKCover.m: -------------------------------------------------------------------------------- 1 | // 2 | // GKCover.m 3 | // GKCoverDemo 4 | // 5 | // Created by QuintGao on 16/8/24. 6 | // Copyright © 2016年 QuintGao. All rights reserved. 7 | // GKCover-一个简单的遮罩视图,让你的弹窗更easy,支持自定义遮罩弹窗 8 | // github:https://github.com/QuintGao/GKCover 9 | 10 | #import "GKCover.h" 11 | 12 | #pragma mark - 内部记录 13 | static GKCover *_cover; // 遮罩 14 | static UIView *_fromView; // 显示在此视图上 15 | static UIView *_contentView; // 显示的视图 16 | static CGFloat _margin; // 遮罩距离父视图的间距 17 | static BOOL _animated; // 是否需要动画 18 | static showBlock _showBlock; // 显示时的回调block 19 | static hideBlock _hideBlock; // 隐藏时的回调block 20 | static BOOL _notclick; // 是否能点击的判断 21 | static GKCoverStyle _style; // 遮罩类型 22 | static GKCoverShowStyle _showStyle; // 显示类型 23 | static BOOL _hasCover; // 遮罩是否已经显示的判断值 24 | static BOOL _isHideStatusBar; // 遮罩是否遮盖状态栏 25 | static CAAnimation *_animation; // 中间弹窗动画 26 | 27 | // 分离动画类型 28 | static GKCoverShowAnimStyle _showAnimStyle; 29 | static GKCoverHideAnimStyle _hideAnimStyle; 30 | 31 | static UIColor *_bgColor; // 背景色 32 | 33 | @implementation GKCover 34 | 35 | + (void)coverFrom:(UIView *)fromView contentView:(UIView *)contentView style:(GKCoverStyle)style showStyle:(GKCoverShowStyle)showStyle showAnimStyle:(GKCoverShowAnimStyle)showAnimStyle hideAnimStyle:(GKCoverHideAnimStyle)hideAnimStyle notClick:(BOOL)notClick 36 | { 37 | [self coverFrom:fromView contentView:contentView style:style showStyle:showStyle showAnimStyle:showAnimStyle hideAnimStyle:hideAnimStyle notClick:notClick showBlock:nil hideBlock:nil]; 38 | } 39 | 40 | + (void)coverFrom:(UIView *)fromView contentView:(UIView *)contentView margin:(CGFloat)margin style:(GKCoverStyle)style showStyle:(GKCoverShowStyle)showStyle showAnimStyle:(GKCoverShowAnimStyle)showAnimStyle hideAnimStyle:(GKCoverHideAnimStyle)hideAnimStyle notClick:(BOOL)notClick { 41 | [self coverFrom:fromView contentView:contentView margin:margin style:style showStyle:showStyle showAnimStyle:showAnimStyle hideAnimStyle:hideAnimStyle notClick:notClick showBlock:nil hideBlock:nil]; 42 | } 43 | 44 | + (void)coverFrom:(UIView *)fromView contentView:(UIView *)contentView style:(GKCoverStyle)style showStyle:(GKCoverShowStyle)showStyle showAnimStyle:(GKCoverShowAnimStyle)showAnimStyle hideAnimStyle:(GKCoverHideAnimStyle)hideAnimStyle notClick:(BOOL)notClick showBlock:(showBlock)showBlock hideBlock:(hideBlock)hideBlock { 45 | [self coverFrom:fromView contentView:contentView margin:0 style:style showStyle:showStyle showAnimStyle:showAnimStyle hideAnimStyle:hideAnimStyle notClick:notClick showBlock:showBlock hideBlock:hideBlock]; 46 | } 47 | 48 | + (void)coverFrom:(UIView *)fromView contentView:(UIView *)contentView margin:(CGFloat)margin style:(GKCoverStyle)style showStyle:(GKCoverShowStyle)showStyle showAnimStyle:(GKCoverShowAnimStyle)showAnimStyle hideAnimStyle:(GKCoverHideAnimStyle)hideAnimStyle notClick:(BOOL)notClick showBlock:(showBlock)showBlock hideBlock:(hideBlock)hideBlock { 49 | if ([self hasCover]) return; 50 | 51 | _fromView = fromView; 52 | _contentView = contentView; 53 | _margin = margin; 54 | _style = style; 55 | _showStyle = showStyle; 56 | _showAnimStyle = showAnimStyle; 57 | _hideAnimStyle = hideAnimStyle; 58 | _notclick = notClick; 59 | _showBlock = showBlock; 60 | _hideBlock = hideBlock; 61 | 62 | // 创建遮罩 63 | GKCover *cover = [self cover]; 64 | CGRect frame = fromView.bounds; 65 | switch (showStyle) { 66 | case GKCoverShowStyleTop: { 67 | frame.origin.y = margin; 68 | frame.size.height -= margin; 69 | _contentView.gk_y = margin; 70 | } 71 | break; 72 | case GKCoverShowStyleBottom: { 73 | frame.size.height -= margin; 74 | } 75 | break; 76 | case GKCoverShowStyleLeft: { 77 | frame.origin.x = margin; 78 | frame.size.width -= margin; 79 | _contentView.gk_x = margin; 80 | } 81 | break; 82 | case GKCoverShowStyleRight: { 83 | frame.size.width -= margin; 84 | } 85 | break; 86 | default: 87 | break; 88 | } 89 | cover.frame = frame; 90 | [fromView addSubview:cover]; 91 | _cover = cover; 92 | 93 | switch (style) { 94 | case GKCoverStyleTranslucent: // 半透明 95 | [self setupTranslucentCover:cover]; 96 | break; 97 | case GKCoverStyleTransparent: // 全透明 98 | [self setupTransparentCover:cover]; 99 | break; 100 | case GKCoverStyleBlur: // 高斯模糊 101 | [self setupBlurCover:cover]; 102 | break; 103 | 104 | default: 105 | break; 106 | } 107 | 108 | [self showCover]; 109 | } 110 | 111 | + (void)coverHideStatusBarWithContentView:(UIView *)contentView style:(GKCoverStyle)style showStyle:(GKCoverShowStyle)showStyle showAnimStyle:(GKCoverShowAnimStyle)showAnimStyle hideAnimStyle:(GKCoverHideAnimStyle)hideAnimStyle notClick:(BOOL)notClick showBlock:(showBlock)showBlock hideBlock:(hideBlock)hideBlock { 112 | 113 | if ([self hasCover]) return; 114 | 115 | _isHideStatusBar = YES; 116 | 117 | _style = style; 118 | _showStyle = showStyle; 119 | _showAnimStyle = showAnimStyle; 120 | _hideAnimStyle = hideAnimStyle; 121 | _contentView = contentView; 122 | _margin = 0; 123 | _notclick = notClick; 124 | _showBlock = showBlock; 125 | _hideBlock = hideBlock; 126 | 127 | UIWindow *fromView = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 128 | fromView.windowLevel = UIWindowLevelAlert; 129 | fromView.hidden = NO; 130 | [fromView makeKeyAndVisible]; 131 | 132 | _fromView = fromView; 133 | 134 | // 创建遮罩 135 | GKCover *cover = [self cover]; 136 | // 设置大小和颜色 137 | cover.frame = fromView.bounds; 138 | // 添加遮罩 139 | [fromView addSubview:cover]; 140 | _cover = cover; 141 | 142 | switch (style) { 143 | case GKCoverStyleTranslucent: // 半透明 144 | [self setupTranslucentCover:cover]; 145 | break; 146 | case GKCoverStyleTransparent: // 全透明 147 | [self setupTransparentCover:cover]; 148 | break; 149 | case GKCoverStyleBlur: // 高斯模糊 150 | [self setupBlurCover:cover]; 151 | break; 152 | 153 | default: 154 | break; 155 | } 156 | 157 | [self showCover]; 158 | } 159 | 160 | + (void)showAlertViewFrom:(UIView *)fromView contentView:(UIView *)contentView style:(GKCoverStyle)style animation:(CAAnimation *)animation notClick:(BOOL)notClick { 161 | [self showAlertViewFrom:fromView contentView:contentView style:style animation:animation notClick:notClick showBlock:nil hideBlock:nil]; 162 | } 163 | 164 | + (void)showAlertViewFrom:(UIView *)fromView contentView:(UIView *)contentView style:(GKCoverStyle)style animation:(CAAnimation *)animation notClick:(BOOL)notClick showBlock:(showBlock)showBlock hideBlock:(hideBlock)hideBlock { 165 | _animation = animation; 166 | [self coverFrom:fromView contentView:contentView style:style showStyle:GKCoverShowStyleCenter showAnimStyle:GKCoverShowAnimStyleCenter hideAnimStyle:GKCoverHideAnimStyleCenter notClick:notClick showBlock:showBlock hideBlock:hideBlock]; 167 | } 168 | 169 | + (instancetype)cover { 170 | // cover一经初始化就存在 171 | _hasCover = YES; 172 | return [[self alloc] init]; 173 | } 174 | 175 | + (BOOL)hasCover { 176 | if (!_cover) { 177 | _hasCover = NO; 178 | } 179 | return _hasCover; 180 | } 181 | 182 | + (void)changeAlpha:(CGFloat)alpha { 183 | _cover.alpha = alpha; 184 | } 185 | 186 | + (void)changeCoverBgColor:(UIColor *)bgColor { 187 | _bgColor = bgColor; 188 | _cover.backgroundColor = bgColor; 189 | } 190 | 191 | + (void)hideCoverWithHideBlock:(hideBlock)hideBlock { 192 | _hideBlock = hideBlock; 193 | [GKCover hideCover]; 194 | } 195 | 196 | + (void)hideCoverWithoutAnimation { 197 | if (!_cover) { 198 | _hasCover = NO; 199 | return; 200 | } 201 | if (!_hasCover) return; 202 | // 这里为了防止动画未完成导致的不能及时判断cover是否存在,实际上cover再这里并没有销毁 203 | _hasCover = NO; 204 | [self remove]; 205 | } 206 | 207 | - (instancetype)initWithFrame:(CGRect)frame { 208 | self = [super initWithFrame:frame]; 209 | if (self) { 210 | // 自动伸缩 211 | self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 212 | _animated = NO; 213 | } 214 | return self; 215 | } 216 | 217 | + (void)showCover { 218 | [_fromView addSubview:_contentView]; 219 | 220 | switch (_showStyle) { 221 | case GKCoverShowStyleTop: { // 显示在顶部 222 | _contentView.gk_centerX = _cover.gk_centerX; 223 | if (_showAnimStyle == GKCoverShowAnimStyleTop) { 224 | _contentView.gk_y = -_contentView.gk_height; 225 | [UIView animateWithDuration:kAnimDuration animations:^{ 226 | _contentView.gk_y = _margin; 227 | }completion:^(BOOL finished) { 228 | !_showBlock ? : _showBlock(); 229 | }]; 230 | }else{ 231 | !_showBlock ? : _showBlock(); 232 | _contentView.gk_y = _margin; 233 | } 234 | } 235 | break; 236 | case GKCoverShowStyleCenter: { // 显示在中间 237 | _contentView.gk_centerX = _fromView.gk_centerX; 238 | if (_showAnimStyle == GKCoverShowAnimStyleTop) { // 上进 239 | _contentView.gk_y = -_contentView.gk_height; 240 | [UIView animateWithDuration:kAnimDuration animations:^{ 241 | _contentView.center = _fromView.center; 242 | }completion:^(BOOL finished) { 243 | !_showBlock ? : _showBlock(); 244 | }]; 245 | }else if (_showAnimStyle == GKCoverShowAnimStyleCenter) { // 中间动画 246 | _contentView.center = _fromView.center; 247 | [self animationAlert:_contentView]; 248 | }else if (_showAnimStyle == GKCoverShowAnimStyleBottom) { // 下进 249 | _contentView.gk_y = _fromView.gk_height; 250 | [UIView animateWithDuration:kAnimDuration animations:^{ 251 | _contentView.center = _fromView.center; 252 | }completion:^(BOOL finished) { 253 | !_showBlock ? : _showBlock(); 254 | }]; 255 | }else{ // 无动画 256 | _contentView.center = _fromView.center; 257 | !_showBlock ? : _showBlock(); 258 | } 259 | } 260 | break; 261 | case GKCoverShowStyleBottom: { // 显示在底部 262 | _contentView.gk_centerX = _cover.gk_centerX; 263 | if (_showAnimStyle == GKCoverShowAnimStyleBottom) { 264 | _contentView.gk_y = _cover.gk_height; 265 | [UIView animateWithDuration:kAnimDuration animations:^{ 266 | _contentView.gk_y = _cover.gk_height - _contentView.gk_height; 267 | }completion:^(BOOL finished) { 268 | !_showBlock ? : _showBlock(); 269 | }]; 270 | }else{ 271 | !_showBlock ? : _showBlock(); 272 | _contentView.gk_y = _cover.gk_height - _contentView.gk_height; 273 | } 274 | } 275 | break; 276 | case GKCoverShowStyleLeft: { // 显示在左侧 277 | _contentView.gk_centerY = _cover.gk_height * 0.5f; 278 | if (_showAnimStyle == GKCoverShowAnimStyleLeft) { 279 | _contentView.gk_x = -_contentView.gk_width; 280 | [UIView animateWithDuration:kAnimDuration animations:^{ 281 | _contentView.gk_x = _margin; 282 | }completion:^(BOOL finished) { 283 | !_showBlock ? : _showBlock(); 284 | }]; 285 | }else { 286 | !_showBlock ? : _showBlock(); 287 | _contentView.gk_x = _margin; 288 | } 289 | } 290 | break; 291 | case GKCoverShowStyleRight: { // 显示在右侧 292 | _contentView.gk_centerY = _cover.gk_height * 0.5f; 293 | if (_showAnimStyle == GKCoverShowAnimStyleRight) { 294 | _contentView.gk_x = _fromView.gk_width; 295 | [UIView animateWithDuration:kAnimDuration animations:^{ 296 | _contentView.gk_x = _cover.gk_width - _contentView.gk_width; 297 | }completion:^(BOOL finished) { 298 | !_showBlock ? : _showBlock(); 299 | }]; 300 | }else { 301 | !_showBlock ? : _showBlock(); 302 | _contentView.gk_x = _cover.gk_width - _contentView.gk_width; 303 | } 304 | } 305 | break; 306 | 307 | default: 308 | break; 309 | } 310 | } 311 | 312 | + (void)hideCover { 313 | if (!_cover) { 314 | _hasCover = NO; 315 | return; 316 | } 317 | if (!_hasCover) return; 318 | // 这里为了防止动画未完成导致的不能及时判断cover是否存在,实际上cover再这里并没有销毁 319 | _hasCover = NO; 320 | 321 | switch (_showStyle) { 322 | case GKCoverShowStyleTop: { // 显示在顶部 323 | if (_hideAnimStyle == GKCoverHideAnimStyleTop) { 324 | [UIView animateWithDuration:kAnimDuration animations:^{ 325 | _contentView.gk_y = -_contentView.gk_height; 326 | }completion:^(BOOL finished) { 327 | [self remove]; 328 | }]; 329 | }else{ 330 | _contentView.gk_y = -_contentView.gk_height; 331 | [self remove]; 332 | } 333 | } 334 | break; 335 | case GKCoverShowStyleCenter: { // 显示在中间 336 | if (_hideAnimStyle == GKCoverHideAnimStyleTop) { // 上出 337 | [UIView animateWithDuration:kAnimDuration animations:^{ 338 | _contentView.gk_y = -_contentView.gk_height; 339 | }completion:^(BOOL finished) { 340 | [self remove]; 341 | }]; 342 | }else if (_hideAnimStyle == GKCoverHideAnimStyleCenter) { // 中间动画 343 | [self remove]; 344 | }else if (_hideAnimStyle == GKCoverHideAnimStyleBottom) { // 下出 345 | [UIView animateWithDuration:kAnimDuration animations:^{ 346 | _contentView.gk_y = _cover.gk_height; 347 | }completion:^(BOOL finished) { 348 | [self remove]; 349 | }]; 350 | }else{ // 无动画 351 | _contentView.center = _cover.center; 352 | [self remove]; 353 | } 354 | } 355 | break; 356 | case GKCoverShowStyleBottom: { // 显示在底部 357 | if (_hideAnimStyle == GKCoverHideAnimStyleBottom) { 358 | [UIView animateWithDuration:kAnimDuration animations:^{ 359 | _contentView.gk_y = _cover.gk_height; 360 | }completion:^(BOOL finished) { 361 | [self remove]; 362 | }]; 363 | }else{ 364 | _contentView.gk_y = _cover.gk_height; 365 | [self remove]; 366 | } 367 | } 368 | break; 369 | case GKCoverShowStyleLeft: { // 显示在左侧 370 | if (_hideAnimStyle == GKCoverHideAnimStyleLeft) { 371 | [UIView animateWithDuration:kAnimDuration animations:^{ 372 | _contentView.gk_x = -_contentView.gk_width; 373 | }completion:^(BOOL finished) { 374 | [self remove]; 375 | }]; 376 | }else{ 377 | _contentView.gk_x = -_contentView.gk_width; 378 | [self remove]; 379 | } 380 | } 381 | break; 382 | case GKCoverShowStyleRight: { // 显示在右侧 383 | if (_hideAnimStyle == GKCoverHideAnimStyleRight) { 384 | [UIView animateWithDuration:kAnimDuration animations:^{ 385 | _contentView.gk_x = _cover.gk_width; 386 | }completion:^(BOOL finished) { 387 | [self remove]; 388 | }]; 389 | }else{ 390 | _contentView.gk_x = _cover.gk_width; 391 | [self remove]; 392 | } 393 | } 394 | break; 395 | default: 396 | break; 397 | } 398 | } 399 | 400 | #pragma mark - Private Method 401 | /// 半透明遮罩 402 | + (void)setupTranslucentCover:(UIView *)cover { 403 | cover.backgroundColor = _bgColor ? _bgColor : [UIColor blackColor]; 404 | cover.alpha = kAlpha; 405 | [self coverAddTap:cover]; 406 | } 407 | 408 | /// 全透明遮罩 409 | + (void)setupTransparentCover:(UIView *)cover { 410 | UIView *bgView = [UIView new]; 411 | bgView.backgroundColor = [UIColor clearColor]; 412 | bgView.gk_size = cover.gk_size; 413 | bgView.userInteractionEnabled = YES; 414 | [self coverAddTap:bgView]; 415 | 416 | cover.backgroundColor = [UIColor clearColor]; 417 | [cover addSubview:bgView]; 418 | } 419 | 420 | /// 高斯模糊遮罩 421 | + (void)setupBlurCover:(UIView *)cover { 422 | cover.backgroundColor = [UIColor clearColor]; 423 | [self coverAddTap:cover]; 424 | // 添加高斯模糊效果,添加毛玻璃效果 425 | UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; 426 | UIVisualEffectView *effectview = [[UIVisualEffectView alloc] initWithEffect:blur]; 427 | effectview.frame = cover.bounds; 428 | 429 | [cover addSubview:effectview]; 430 | } 431 | 432 | /// 中间弹窗动画 433 | + (void)animationAlert:(UIView *)view { 434 | if (_animation) { 435 | if (!_animation.delegate) { 436 | _animation.delegate = _cover; 437 | } 438 | [view.layer addAnimation:_animation forKey:nil]; 439 | }else { 440 | CAKeyframeAnimation* animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 441 | animation.duration = 0.5; 442 | animation.delegate = _cover; 443 | 444 | NSMutableArray *values = [NSMutableArray array]; 445 | [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.1, 0.1, 1.0)]]; 446 | [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.2, 1.2, 1.0)]]; 447 | [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.9, 0.9, 1.0)]]; 448 | [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)]]; 449 | animation.values = values; 450 | 451 | [view.layer addAnimation:animation forKey:nil]; 452 | } 453 | } 454 | 455 | + (void)coverAddTap:(UIView *)cover { 456 | if (!_notclick) { 457 | [cover addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideCover)]]; 458 | } 459 | } 460 | 461 | + (void)remove { 462 | [_cover removeFromSuperview]; 463 | [_contentView removeFromSuperview]; 464 | if (_isHideStatusBar) { 465 | _isHideStatusBar = NO; 466 | 467 | UIWindow *coverWindow = (UIWindow *)_fromView; 468 | coverWindow.hidden = YES; 469 | [coverWindow resignKeyWindow]; 470 | coverWindow = nil; 471 | } 472 | 473 | _cover = nil; 474 | _hasCover = NO; 475 | _fromView = nil; 476 | _contentView = nil; 477 | 478 | // 隐藏block放到最后,修复多个cover不能隐藏的bug 479 | !_hideBlock ? : _hideBlock(); 480 | } 481 | 482 | + (void)layoutSubViews { 483 | 484 | _contentView.gk_centerX = _fromView.gk_centerX; 485 | 486 | switch (_showStyle) { 487 | case GKCoverShowStyleTop: { 488 | _contentView.gk_y = _margin; 489 | } 490 | break; 491 | case GKCoverShowStyleCenter: { 492 | _contentView.center = _fromView.center; 493 | } 494 | break; 495 | case GKCoverShowStyleBottom: { 496 | _contentView.gk_y = _fromView.gk_height - _contentView.gk_height; 497 | } 498 | break; 499 | case GKCoverShowStyleLeft: { 500 | _contentView.gk_x = _margin; 501 | } 502 | break; 503 | case GKCoverShowStyleRight: { 504 | _contentView.gk_x = _fromView.gk_width - _contentView.gk_width; 505 | } 506 | break; 507 | 508 | default: 509 | break; 510 | } 511 | } 512 | 513 | #pragma mark - CAAnimationDelegate 514 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { 515 | if (_animation) { 516 | _animation = nil; 517 | } 518 | !_showBlock ? : _showBlock(); 519 | } 520 | 521 | @end 522 | -------------------------------------------------------------------------------- /GKCover/GKCoverEnum.h: -------------------------------------------------------------------------------- 1 | // 2 | // GKCoverEnum.h 3 | // GKCoverDemo 4 | // 5 | // Created by QuintGao on 2016/11/2. 6 | // Copyright © 2016年 QuintGao. All rights reserved. 7 | // 8 | 9 | #ifndef GKCoverEnum_h 10 | #define GKCoverEnum_h 11 | 12 | #define KScreenW [UIScreen mainScreen].bounds.size.width 13 | #define KScreenH [UIScreen mainScreen].bounds.size.height 14 | 15 | /** 默认动画时间 */ 16 | #define kAnimDuration 0.25 17 | /** 默认透明度 */ 18 | #define kAlpha 0.5 19 | 20 | // 过期提醒 21 | #define GKCoverDeprecated(instead) NS_DEPRECATED(2_0, 8_0, 2_0, 8_0, instead) 22 | 23 | /** 遮罩类型 */ 24 | typedef NS_ENUM(NSUInteger, GKCoverStyle) { 25 | /** 半透明 */ 26 | GKCoverStyleTranslucent, // 半透明 27 | /** 全透明 */ 28 | GKCoverStyleTransparent, // 全透明 29 | /** 高斯模糊 */ 30 | GKCoverStyleBlur // 高斯模糊 31 | }; 32 | 33 | /** 视图显示类型 */ 34 | typedef NS_ENUM(NSUInteger, GKCoverShowStyle) { 35 | /** 显示在上面 */ 36 | GKCoverShowStyleTop, // 显示在上面 37 | /** 显示在中间 */ 38 | GKCoverShowStyleCenter, // 显示在中间 39 | /** 显示在底部 */ 40 | GKCoverShowStyleBottom, // 显示在底部 41 | /** 显示在左侧 */ 42 | GKCoverShowStyleLeft, // 显示在左侧 43 | /** 显示在右侧 */ 44 | GKCoverShowStyleRight // 显示在右侧 45 | }; 46 | 47 | #pragma mark - v2.4.0新增 48 | /** 弹窗显示时的动画类型 */ 49 | typedef NS_ENUM(NSUInteger, GKCoverShowAnimStyle) { 50 | /** 从上弹出 */ 51 | GKCoverShowAnimStyleTop, // 从上弹出 52 | /** 中间弹出 */ 53 | GKCoverShowAnimStyleCenter, // 中间弹出 54 | /** 底部弹出 */ 55 | GKCoverShowAnimStyleBottom, // 底部弹出 56 | /** 左侧弹出 */ 57 | GKCoverShowAnimStyleLeft, // 左侧弹出 58 | /** 右侧弹出 */ 59 | GKCoverShowAnimStyleRight, // 右侧弹出 60 | /** 无动画 */ 61 | GKCoverShowAnimStyleNone // 无动画 62 | }; 63 | 64 | /** 弹窗隐藏时的动画类型 */ 65 | typedef NS_ENUM(NSUInteger, GKCoverHideAnimStyle) { 66 | /** 从上隐藏 */ 67 | GKCoverHideAnimStyleTop, // 从上隐藏 68 | /** 中间隐藏(直接消失) */ 69 | GKCoverHideAnimStyleCenter, // 中间隐藏(直接消失) 70 | /** 底部隐藏 */ 71 | GKCoverHideAnimStyleBottom, // 底部隐藏 72 | /** 左侧隐藏 */ 73 | GKCoverHideAnimStyleLeft, // 左侧弹出 74 | /** 右侧隐藏 */ 75 | GKCoverHideAnimStyleRight, // 右侧弹出 76 | /** 无动画 */ 77 | GKCoverHideAnimStyleNone // 无动画 78 | }; 79 | 80 | #endif /* GKCoverEnum_h */ 81 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo-gif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuintGao/GKCover/09f82d37256693d089949c441cae8f69c76973f5/GKCoverDemo/GKCoverDemo-gif.gif -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6008096C1D6EE2EB00CCF5F1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 600809671D6EE2EB00CCF5F1 /* AppDelegate.m */; }; 11 | 6008096D1D6EE2EB00CCF5F1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 600809681D6EE2EB00CCF5F1 /* main.m */; }; 12 | 6008098B1D6F03FA00CCF5F1 /* UIView+GKExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 600809861D6F03FA00CCF5F1 /* UIView+GKExtension.m */; }; 13 | 6008098C1D6F03FA00CCF5F1 /* GKCover.m in Sources */ = {isa = PBXBuildFile; fileRef = 600809881D6F03FA00CCF5F1 /* GKCover.m */; }; 14 | 6034DFD21D6D65DC000A7942 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6034DFD01D6D65DC000A7942 /* Main.storyboard */; }; 15 | 6034DFD41D6D65DC000A7942 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6034DFD31D6D65DC000A7942 /* Assets.xcassets */; }; 16 | 6034DFD71D6D65DC000A7942 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6034DFD51D6D65DC000A7942 /* LaunchScreen.storyboard */; }; 17 | 6034DFE21D6D65DC000A7942 /* GKCoverDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6034DFE11D6D65DC000A7942 /* GKCoverDemoTests.m */; }; 18 | 6034DFED1D6D65DC000A7942 /* GKCoverDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6034DFEC1D6D65DC000A7942 /* GKCoverDemoUITests.m */; }; 19 | 6043D7FF1E60208D00186421 /* GKCoverDemo_v240.m in Sources */ = {isa = PBXBuildFile; fileRef = 6043D7FE1E60208D00186421 /* GKCoverDemo_v240.m */; }; 20 | 604FA89620C79FA900EBA75B /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 604FA89520C79FA900EBA75B /* README.md */; }; 21 | 60A9A1571E8E3F6E00E714D4 /* GKCoverView.m in Sources */ = {isa = PBXBuildFile; fileRef = 60A9A1561E8E3F6E00E714D4 /* GKCoverView.m */; }; 22 | 60A9A1591E8E3F7800E714D4 /* GKCoverView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 60A9A1581E8E3F7800E714D4 /* GKCoverView.xib */; }; 23 | 7934C9DE1FBD254E00A1F7FA /* GKCover.podspec in Resources */ = {isa = PBXBuildFile; fileRef = 7934C9DD1FBD254D00A1F7FA /* GKCover.podspec */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | 6034DFDE1D6D65DC000A7942 /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = 6034DFBC1D6D65DC000A7942 /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = 6034DFC31D6D65DC000A7942; 32 | remoteInfo = GKCoverDemo; 33 | }; 34 | 6034DFE91D6D65DC000A7942 /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = 6034DFBC1D6D65DC000A7942 /* Project object */; 37 | proxyType = 1; 38 | remoteGlobalIDString = 6034DFC31D6D65DC000A7942; 39 | remoteInfo = GKCoverDemo; 40 | }; 41 | /* End PBXContainerItemProxy section */ 42 | 43 | /* Begin PBXFileReference section */ 44 | 600809661D6EE2EB00CCF5F1 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 45 | 600809671D6EE2EB00CCF5F1 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 46 | 600809681D6EE2EB00CCF5F1 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Classes/main.m; sourceTree = ""; }; 47 | 600809851D6F03FA00CCF5F1 /* UIView+GKExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+GKExtension.h"; sourceTree = ""; }; 48 | 600809861D6F03FA00CCF5F1 /* UIView+GKExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+GKExtension.m"; sourceTree = ""; }; 49 | 600809871D6F03FA00CCF5F1 /* GKCover.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GKCover.h; sourceTree = ""; }; 50 | 600809881D6F03FA00CCF5F1 /* GKCover.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GKCover.m; sourceTree = ""; }; 51 | 6034DFC41D6D65DC000A7942 /* GKCoverDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GKCoverDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 6034DFD11D6D65DC000A7942 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | 6034DFD31D6D65DC000A7942 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | 6034DFD61D6D65DC000A7942 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 6034DFD81D6D65DC000A7942 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | 6034DFDD1D6D65DC000A7942 /* GKCoverDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GKCoverDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | 6034DFE11D6D65DC000A7942 /* GKCoverDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GKCoverDemoTests.m; sourceTree = ""; }; 58 | 6034DFE31D6D65DC000A7942 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59 | 6034DFE81D6D65DC000A7942 /* GKCoverDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GKCoverDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | 6034DFEC1D6D65DC000A7942 /* GKCoverDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GKCoverDemoUITests.m; sourceTree = ""; }; 61 | 6034DFEE1D6D65DC000A7942 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 62 | 6043D7FD1E60208D00186421 /* GKCoverDemo_v240.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GKCoverDemo_v240.h; sourceTree = ""; }; 63 | 6043D7FE1E60208D00186421 /* GKCoverDemo_v240.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GKCoverDemo_v240.m; sourceTree = ""; }; 64 | 604FA89520C79FA900EBA75B /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../../README.md; sourceTree = ""; }; 65 | 60A9A1551E8E3F6E00E714D4 /* GKCoverView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GKCoverView.h; sourceTree = ""; }; 66 | 60A9A1561E8E3F6E00E714D4 /* GKCoverView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GKCoverView.m; sourceTree = ""; }; 67 | 60A9A1581E8E3F7800E714D4 /* GKCoverView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = GKCoverView.xib; sourceTree = ""; }; 68 | 60AC7C7C1DDDA68900579B7C /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; }; 69 | 60F9480A1DC9F1D700CF0E12 /* GKCoverEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GKCoverEnum.h; sourceTree = ""; }; 70 | 7934C9DD1FBD254D00A1F7FA /* GKCover.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = GKCover.podspec; path = ../../GKCover.podspec; sourceTree = ""; }; 71 | /* End PBXFileReference section */ 72 | 73 | /* Begin PBXFrameworksBuildPhase section */ 74 | 6034DFC11D6D65DC000A7942 /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | 6034DFDA1D6D65DC000A7942 /* Frameworks */ = { 82 | isa = PBXFrameworksBuildPhase; 83 | buildActionMask = 2147483647; 84 | files = ( 85 | ); 86 | runOnlyForDeploymentPostprocessing = 0; 87 | }; 88 | 6034DFE51D6D65DC000A7942 /* Frameworks */ = { 89 | isa = PBXFrameworksBuildPhase; 90 | buildActionMask = 2147483647; 91 | files = ( 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | /* End PBXFrameworksBuildPhase section */ 96 | 97 | /* Begin PBXGroup section */ 98 | 600809651D6EE28F00CCF5F1 /* Classes */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 60FC8C4A1DCE1A180069F86C /* Demo */, 102 | 600809661D6EE2EB00CCF5F1 /* AppDelegate.h */, 103 | 600809671D6EE2EB00CCF5F1 /* AppDelegate.m */, 104 | ); 105 | path = Classes; 106 | sourceTree = ""; 107 | }; 108 | 600809831D6F03FA00CCF5F1 /* GKCover */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 600809841D6F03FA00CCF5F1 /* Category */, 112 | 600809871D6F03FA00CCF5F1 /* GKCover.h */, 113 | 600809881D6F03FA00CCF5F1 /* GKCover.m */, 114 | 60F9480A1DC9F1D700CF0E12 /* GKCoverEnum.h */, 115 | ); 116 | name = GKCover; 117 | path = ../../GKCover; 118 | sourceTree = ""; 119 | }; 120 | 600809841D6F03FA00CCF5F1 /* Category */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 600809851D6F03FA00CCF5F1 /* UIView+GKExtension.h */, 124 | 600809861D6F03FA00CCF5F1 /* UIView+GKExtension.m */, 125 | ); 126 | path = Category; 127 | sourceTree = ""; 128 | }; 129 | 6034DFBB1D6D65DC000A7942 = { 130 | isa = PBXGroup; 131 | children = ( 132 | 6034DFC61D6D65DC000A7942 /* GKCoverDemo */, 133 | 6034DFE01D6D65DC000A7942 /* GKCoverDemoTests */, 134 | 6034DFEB1D6D65DC000A7942 /* GKCoverDemoUITests */, 135 | 6034DFC51D6D65DC000A7942 /* Products */, 136 | ); 137 | sourceTree = ""; 138 | }; 139 | 6034DFC51D6D65DC000A7942 /* Products */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | 6034DFC41D6D65DC000A7942 /* GKCoverDemo.app */, 143 | 6034DFDD1D6D65DC000A7942 /* GKCoverDemoTests.xctest */, 144 | 6034DFE81D6D65DC000A7942 /* GKCoverDemoUITests.xctest */, 145 | ); 146 | name = Products; 147 | sourceTree = ""; 148 | }; 149 | 6034DFC61D6D65DC000A7942 /* GKCoverDemo */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 600809651D6EE28F00CCF5F1 /* Classes */, 153 | 600809831D6F03FA00CCF5F1 /* GKCover */, 154 | 6034DFC71D6D65DC000A7942 /* Supporting Files */, 155 | ); 156 | path = GKCoverDemo; 157 | sourceTree = ""; 158 | }; 159 | 6034DFC71D6D65DC000A7942 /* Supporting Files */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 600809681D6EE2EB00CCF5F1 /* main.m */, 163 | 6034DFD01D6D65DC000A7942 /* Main.storyboard */, 164 | 6034DFD31D6D65DC000A7942 /* Assets.xcassets */, 165 | 6034DFD51D6D65DC000A7942 /* LaunchScreen.storyboard */, 166 | 6034DFD81D6D65DC000A7942 /* Info.plist */, 167 | 60AC7C7C1DDDA68900579B7C /* PrefixHeader.pch */, 168 | 7934C9DD1FBD254D00A1F7FA /* GKCover.podspec */, 169 | 604FA89520C79FA900EBA75B /* README.md */, 170 | ); 171 | name = "Supporting Files"; 172 | sourceTree = ""; 173 | }; 174 | 6034DFE01D6D65DC000A7942 /* GKCoverDemoTests */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | 6034DFE11D6D65DC000A7942 /* GKCoverDemoTests.m */, 178 | 6034DFE31D6D65DC000A7942 /* Info.plist */, 179 | ); 180 | path = GKCoverDemoTests; 181 | sourceTree = ""; 182 | }; 183 | 6034DFEB1D6D65DC000A7942 /* GKCoverDemoUITests */ = { 184 | isa = PBXGroup; 185 | children = ( 186 | 6034DFEC1D6D65DC000A7942 /* GKCoverDemoUITests.m */, 187 | 6034DFEE1D6D65DC000A7942 /* Info.plist */, 188 | ); 189 | path = GKCoverDemoUITests; 190 | sourceTree = ""; 191 | }; 192 | 60FC8C4A1DCE1A180069F86C /* Demo */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | 60FC8C4B1DCE1A2F0069F86C /* Controller */, 196 | 60FC8C4C1DCE1A2F0069F86C /* View */, 197 | ); 198 | path = Demo; 199 | sourceTree = ""; 200 | }; 201 | 60FC8C4B1DCE1A2F0069F86C /* Controller */ = { 202 | isa = PBXGroup; 203 | children = ( 204 | 6043D7FD1E60208D00186421 /* GKCoverDemo_v240.h */, 205 | 6043D7FE1E60208D00186421 /* GKCoverDemo_v240.m */, 206 | ); 207 | path = Controller; 208 | sourceTree = ""; 209 | }; 210 | 60FC8C4C1DCE1A2F0069F86C /* View */ = { 211 | isa = PBXGroup; 212 | children = ( 213 | 60A9A1551E8E3F6E00E714D4 /* GKCoverView.h */, 214 | 60A9A1561E8E3F6E00E714D4 /* GKCoverView.m */, 215 | 60A9A1581E8E3F7800E714D4 /* GKCoverView.xib */, 216 | ); 217 | path = View; 218 | sourceTree = ""; 219 | }; 220 | /* End PBXGroup section */ 221 | 222 | /* Begin PBXNativeTarget section */ 223 | 6034DFC31D6D65DC000A7942 /* GKCoverDemo */ = { 224 | isa = PBXNativeTarget; 225 | buildConfigurationList = 6034DFF11D6D65DC000A7942 /* Build configuration list for PBXNativeTarget "GKCoverDemo" */; 226 | buildPhases = ( 227 | 6034DFC01D6D65DC000A7942 /* Sources */, 228 | 6034DFC11D6D65DC000A7942 /* Frameworks */, 229 | 6034DFC21D6D65DC000A7942 /* Resources */, 230 | ); 231 | buildRules = ( 232 | ); 233 | dependencies = ( 234 | ); 235 | name = GKCoverDemo; 236 | productName = GKCoverDemo; 237 | productReference = 6034DFC41D6D65DC000A7942 /* GKCoverDemo.app */; 238 | productType = "com.apple.product-type.application"; 239 | }; 240 | 6034DFDC1D6D65DC000A7942 /* GKCoverDemoTests */ = { 241 | isa = PBXNativeTarget; 242 | buildConfigurationList = 6034DFF41D6D65DC000A7942 /* Build configuration list for PBXNativeTarget "GKCoverDemoTests" */; 243 | buildPhases = ( 244 | 6034DFD91D6D65DC000A7942 /* Sources */, 245 | 6034DFDA1D6D65DC000A7942 /* Frameworks */, 246 | 6034DFDB1D6D65DC000A7942 /* Resources */, 247 | ); 248 | buildRules = ( 249 | ); 250 | dependencies = ( 251 | 6034DFDF1D6D65DC000A7942 /* PBXTargetDependency */, 252 | ); 253 | name = GKCoverDemoTests; 254 | productName = GKCoverDemoTests; 255 | productReference = 6034DFDD1D6D65DC000A7942 /* GKCoverDemoTests.xctest */; 256 | productType = "com.apple.product-type.bundle.unit-test"; 257 | }; 258 | 6034DFE71D6D65DC000A7942 /* GKCoverDemoUITests */ = { 259 | isa = PBXNativeTarget; 260 | buildConfigurationList = 6034DFF71D6D65DC000A7942 /* Build configuration list for PBXNativeTarget "GKCoverDemoUITests" */; 261 | buildPhases = ( 262 | 6034DFE41D6D65DC000A7942 /* Sources */, 263 | 6034DFE51D6D65DC000A7942 /* Frameworks */, 264 | 6034DFE61D6D65DC000A7942 /* Resources */, 265 | ); 266 | buildRules = ( 267 | ); 268 | dependencies = ( 269 | 6034DFEA1D6D65DC000A7942 /* PBXTargetDependency */, 270 | ); 271 | name = GKCoverDemoUITests; 272 | productName = GKCoverDemoUITests; 273 | productReference = 6034DFE81D6D65DC000A7942 /* GKCoverDemoUITests.xctest */; 274 | productType = "com.apple.product-type.bundle.ui-testing"; 275 | }; 276 | /* End PBXNativeTarget section */ 277 | 278 | /* Begin PBXProject section */ 279 | 6034DFBC1D6D65DC000A7942 /* Project object */ = { 280 | isa = PBXProject; 281 | attributes = { 282 | LastUpgradeCheck = 1250; 283 | ORGANIZATIONNAME = "高坤"; 284 | TargetAttributes = { 285 | 6034DFC31D6D65DC000A7942 = { 286 | CreatedOnToolsVersion = 7.3.1; 287 | }; 288 | 6034DFDC1D6D65DC000A7942 = { 289 | CreatedOnToolsVersion = 7.3.1; 290 | TestTargetID = 6034DFC31D6D65DC000A7942; 291 | }; 292 | 6034DFE71D6D65DC000A7942 = { 293 | CreatedOnToolsVersion = 7.3.1; 294 | TestTargetID = 6034DFC31D6D65DC000A7942; 295 | }; 296 | }; 297 | }; 298 | buildConfigurationList = 6034DFBF1D6D65DC000A7942 /* Build configuration list for PBXProject "GKCoverDemo" */; 299 | compatibilityVersion = "Xcode 3.2"; 300 | developmentRegion = en; 301 | hasScannedForEncodings = 0; 302 | knownRegions = ( 303 | en, 304 | Base, 305 | ); 306 | mainGroup = 6034DFBB1D6D65DC000A7942; 307 | productRefGroup = 6034DFC51D6D65DC000A7942 /* Products */; 308 | projectDirPath = ""; 309 | projectRoot = ""; 310 | targets = ( 311 | 6034DFC31D6D65DC000A7942 /* GKCoverDemo */, 312 | 6034DFDC1D6D65DC000A7942 /* GKCoverDemoTests */, 313 | 6034DFE71D6D65DC000A7942 /* GKCoverDemoUITests */, 314 | ); 315 | }; 316 | /* End PBXProject section */ 317 | 318 | /* Begin PBXResourcesBuildPhase section */ 319 | 6034DFC21D6D65DC000A7942 /* Resources */ = { 320 | isa = PBXResourcesBuildPhase; 321 | buildActionMask = 2147483647; 322 | files = ( 323 | 604FA89620C79FA900EBA75B /* README.md in Resources */, 324 | 6034DFD71D6D65DC000A7942 /* LaunchScreen.storyboard in Resources */, 325 | 6034DFD41D6D65DC000A7942 /* Assets.xcassets in Resources */, 326 | 6034DFD21D6D65DC000A7942 /* Main.storyboard in Resources */, 327 | 7934C9DE1FBD254E00A1F7FA /* GKCover.podspec in Resources */, 328 | 60A9A1591E8E3F7800E714D4 /* GKCoverView.xib in Resources */, 329 | ); 330 | runOnlyForDeploymentPostprocessing = 0; 331 | }; 332 | 6034DFDB1D6D65DC000A7942 /* Resources */ = { 333 | isa = PBXResourcesBuildPhase; 334 | buildActionMask = 2147483647; 335 | files = ( 336 | ); 337 | runOnlyForDeploymentPostprocessing = 0; 338 | }; 339 | 6034DFE61D6D65DC000A7942 /* Resources */ = { 340 | isa = PBXResourcesBuildPhase; 341 | buildActionMask = 2147483647; 342 | files = ( 343 | ); 344 | runOnlyForDeploymentPostprocessing = 0; 345 | }; 346 | /* End PBXResourcesBuildPhase section */ 347 | 348 | /* Begin PBXSourcesBuildPhase section */ 349 | 6034DFC01D6D65DC000A7942 /* Sources */ = { 350 | isa = PBXSourcesBuildPhase; 351 | buildActionMask = 2147483647; 352 | files = ( 353 | 6008096D1D6EE2EB00CCF5F1 /* main.m in Sources */, 354 | 6008098B1D6F03FA00CCF5F1 /* UIView+GKExtension.m in Sources */, 355 | 6008098C1D6F03FA00CCF5F1 /* GKCover.m in Sources */, 356 | 60A9A1571E8E3F6E00E714D4 /* GKCoverView.m in Sources */, 357 | 6043D7FF1E60208D00186421 /* GKCoverDemo_v240.m in Sources */, 358 | 6008096C1D6EE2EB00CCF5F1 /* AppDelegate.m in Sources */, 359 | ); 360 | runOnlyForDeploymentPostprocessing = 0; 361 | }; 362 | 6034DFD91D6D65DC000A7942 /* Sources */ = { 363 | isa = PBXSourcesBuildPhase; 364 | buildActionMask = 2147483647; 365 | files = ( 366 | 6034DFE21D6D65DC000A7942 /* GKCoverDemoTests.m in Sources */, 367 | ); 368 | runOnlyForDeploymentPostprocessing = 0; 369 | }; 370 | 6034DFE41D6D65DC000A7942 /* Sources */ = { 371 | isa = PBXSourcesBuildPhase; 372 | buildActionMask = 2147483647; 373 | files = ( 374 | 6034DFED1D6D65DC000A7942 /* GKCoverDemoUITests.m in Sources */, 375 | ); 376 | runOnlyForDeploymentPostprocessing = 0; 377 | }; 378 | /* End PBXSourcesBuildPhase section */ 379 | 380 | /* Begin PBXTargetDependency section */ 381 | 6034DFDF1D6D65DC000A7942 /* PBXTargetDependency */ = { 382 | isa = PBXTargetDependency; 383 | target = 6034DFC31D6D65DC000A7942 /* GKCoverDemo */; 384 | targetProxy = 6034DFDE1D6D65DC000A7942 /* PBXContainerItemProxy */; 385 | }; 386 | 6034DFEA1D6D65DC000A7942 /* PBXTargetDependency */ = { 387 | isa = PBXTargetDependency; 388 | target = 6034DFC31D6D65DC000A7942 /* GKCoverDemo */; 389 | targetProxy = 6034DFE91D6D65DC000A7942 /* PBXContainerItemProxy */; 390 | }; 391 | /* End PBXTargetDependency section */ 392 | 393 | /* Begin PBXVariantGroup section */ 394 | 6034DFD01D6D65DC000A7942 /* Main.storyboard */ = { 395 | isa = PBXVariantGroup; 396 | children = ( 397 | 6034DFD11D6D65DC000A7942 /* Base */, 398 | ); 399 | name = Main.storyboard; 400 | sourceTree = ""; 401 | }; 402 | 6034DFD51D6D65DC000A7942 /* LaunchScreen.storyboard */ = { 403 | isa = PBXVariantGroup; 404 | children = ( 405 | 6034DFD61D6D65DC000A7942 /* Base */, 406 | ); 407 | name = LaunchScreen.storyboard; 408 | sourceTree = ""; 409 | }; 410 | /* End PBXVariantGroup section */ 411 | 412 | /* Begin XCBuildConfiguration section */ 413 | 6034DFEF1D6D65DC000A7942 /* Debug */ = { 414 | isa = XCBuildConfiguration; 415 | buildSettings = { 416 | ALWAYS_SEARCH_USER_PATHS = NO; 417 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 418 | CLANG_ANALYZER_NONNULL = YES; 419 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 420 | CLANG_CXX_LIBRARY = "libc++"; 421 | CLANG_ENABLE_MODULES = YES; 422 | CLANG_ENABLE_OBJC_ARC = YES; 423 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 424 | CLANG_WARN_BOOL_CONVERSION = YES; 425 | CLANG_WARN_COMMA = YES; 426 | CLANG_WARN_CONSTANT_CONVERSION = YES; 427 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 428 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 429 | CLANG_WARN_EMPTY_BODY = YES; 430 | CLANG_WARN_ENUM_CONVERSION = YES; 431 | CLANG_WARN_INFINITE_RECURSION = YES; 432 | CLANG_WARN_INT_CONVERSION = YES; 433 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 434 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 435 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 436 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 437 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 438 | CLANG_WARN_STRICT_PROTOTYPES = YES; 439 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 440 | CLANG_WARN_UNREACHABLE_CODE = YES; 441 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 442 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 443 | COPY_PHASE_STRIP = NO; 444 | DEBUG_INFORMATION_FORMAT = dwarf; 445 | ENABLE_STRICT_OBJC_MSGSEND = YES; 446 | ENABLE_TESTABILITY = YES; 447 | GCC_C_LANGUAGE_STANDARD = gnu99; 448 | GCC_DYNAMIC_NO_PIC = NO; 449 | GCC_NO_COMMON_BLOCKS = YES; 450 | GCC_OPTIMIZATION_LEVEL = 0; 451 | GCC_PREPROCESSOR_DEFINITIONS = ( 452 | "DEBUG=1", 453 | "$(inherited)", 454 | ); 455 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 456 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 457 | GCC_WARN_UNDECLARED_SELECTOR = YES; 458 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 459 | GCC_WARN_UNUSED_FUNCTION = YES; 460 | GCC_WARN_UNUSED_VARIABLE = YES; 461 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 462 | MTL_ENABLE_DEBUG_INFO = YES; 463 | ONLY_ACTIVE_ARCH = YES; 464 | SDKROOT = iphoneos; 465 | }; 466 | name = Debug; 467 | }; 468 | 6034DFF01D6D65DC000A7942 /* Release */ = { 469 | isa = XCBuildConfiguration; 470 | buildSettings = { 471 | ALWAYS_SEARCH_USER_PATHS = NO; 472 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 473 | CLANG_ANALYZER_NONNULL = YES; 474 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 475 | CLANG_CXX_LIBRARY = "libc++"; 476 | CLANG_ENABLE_MODULES = YES; 477 | CLANG_ENABLE_OBJC_ARC = YES; 478 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 479 | CLANG_WARN_BOOL_CONVERSION = YES; 480 | CLANG_WARN_COMMA = YES; 481 | CLANG_WARN_CONSTANT_CONVERSION = YES; 482 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 483 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 484 | CLANG_WARN_EMPTY_BODY = YES; 485 | CLANG_WARN_ENUM_CONVERSION = YES; 486 | CLANG_WARN_INFINITE_RECURSION = YES; 487 | CLANG_WARN_INT_CONVERSION = YES; 488 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 489 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 490 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 491 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 492 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 493 | CLANG_WARN_STRICT_PROTOTYPES = YES; 494 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 495 | CLANG_WARN_UNREACHABLE_CODE = YES; 496 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 497 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 498 | COPY_PHASE_STRIP = NO; 499 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 500 | ENABLE_NS_ASSERTIONS = NO; 501 | ENABLE_STRICT_OBJC_MSGSEND = YES; 502 | GCC_C_LANGUAGE_STANDARD = gnu99; 503 | GCC_NO_COMMON_BLOCKS = YES; 504 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 505 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 506 | GCC_WARN_UNDECLARED_SELECTOR = YES; 507 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 508 | GCC_WARN_UNUSED_FUNCTION = YES; 509 | GCC_WARN_UNUSED_VARIABLE = YES; 510 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 511 | MTL_ENABLE_DEBUG_INFO = NO; 512 | SDKROOT = iphoneos; 513 | VALIDATE_PRODUCT = YES; 514 | }; 515 | name = Release; 516 | }; 517 | 6034DFF21D6D65DC000A7942 /* Debug */ = { 518 | isa = XCBuildConfiguration; 519 | buildSettings = { 520 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 521 | GCC_PREFIX_HEADER = GKCoverDemo/PrefixHeader.pch; 522 | INFOPLIST_FILE = GKCoverDemo/Info.plist; 523 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 524 | PRODUCT_BUNDLE_IDENTIFIER = com.gaokun.bykj.GKCoverDemo; 525 | PRODUCT_NAME = "$(TARGET_NAME)"; 526 | }; 527 | name = Debug; 528 | }; 529 | 6034DFF31D6D65DC000A7942 /* Release */ = { 530 | isa = XCBuildConfiguration; 531 | buildSettings = { 532 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 533 | GCC_PREFIX_HEADER = GKCoverDemo/PrefixHeader.pch; 534 | INFOPLIST_FILE = GKCoverDemo/Info.plist; 535 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 536 | PRODUCT_BUNDLE_IDENTIFIER = com.gaokun.bykj.GKCoverDemo; 537 | PRODUCT_NAME = "$(TARGET_NAME)"; 538 | }; 539 | name = Release; 540 | }; 541 | 6034DFF51D6D65DC000A7942 /* Debug */ = { 542 | isa = XCBuildConfiguration; 543 | buildSettings = { 544 | BUNDLE_LOADER = "$(TEST_HOST)"; 545 | INFOPLIST_FILE = GKCoverDemoTests/Info.plist; 546 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 547 | PRODUCT_BUNDLE_IDENTIFIER = com.gaokun.bykj.GKCoverDemoTests; 548 | PRODUCT_NAME = "$(TARGET_NAME)"; 549 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GKCoverDemo.app/GKCoverDemo"; 550 | }; 551 | name = Debug; 552 | }; 553 | 6034DFF61D6D65DC000A7942 /* Release */ = { 554 | isa = XCBuildConfiguration; 555 | buildSettings = { 556 | BUNDLE_LOADER = "$(TEST_HOST)"; 557 | INFOPLIST_FILE = GKCoverDemoTests/Info.plist; 558 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 559 | PRODUCT_BUNDLE_IDENTIFIER = com.gaokun.bykj.GKCoverDemoTests; 560 | PRODUCT_NAME = "$(TARGET_NAME)"; 561 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GKCoverDemo.app/GKCoverDemo"; 562 | }; 563 | name = Release; 564 | }; 565 | 6034DFF81D6D65DC000A7942 /* Debug */ = { 566 | isa = XCBuildConfiguration; 567 | buildSettings = { 568 | INFOPLIST_FILE = GKCoverDemoUITests/Info.plist; 569 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 570 | PRODUCT_BUNDLE_IDENTIFIER = com.gaokun.bykj.GKCoverDemoUITests; 571 | PRODUCT_NAME = "$(TARGET_NAME)"; 572 | TEST_TARGET_NAME = GKCoverDemo; 573 | }; 574 | name = Debug; 575 | }; 576 | 6034DFF91D6D65DC000A7942 /* Release */ = { 577 | isa = XCBuildConfiguration; 578 | buildSettings = { 579 | INFOPLIST_FILE = GKCoverDemoUITests/Info.plist; 580 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 581 | PRODUCT_BUNDLE_IDENTIFIER = com.gaokun.bykj.GKCoverDemoUITests; 582 | PRODUCT_NAME = "$(TARGET_NAME)"; 583 | TEST_TARGET_NAME = GKCoverDemo; 584 | }; 585 | name = Release; 586 | }; 587 | /* End XCBuildConfiguration section */ 588 | 589 | /* Begin XCConfigurationList section */ 590 | 6034DFBF1D6D65DC000A7942 /* Build configuration list for PBXProject "GKCoverDemo" */ = { 591 | isa = XCConfigurationList; 592 | buildConfigurations = ( 593 | 6034DFEF1D6D65DC000A7942 /* Debug */, 594 | 6034DFF01D6D65DC000A7942 /* Release */, 595 | ); 596 | defaultConfigurationIsVisible = 0; 597 | defaultConfigurationName = Release; 598 | }; 599 | 6034DFF11D6D65DC000A7942 /* Build configuration list for PBXNativeTarget "GKCoverDemo" */ = { 600 | isa = XCConfigurationList; 601 | buildConfigurations = ( 602 | 6034DFF21D6D65DC000A7942 /* Debug */, 603 | 6034DFF31D6D65DC000A7942 /* Release */, 604 | ); 605 | defaultConfigurationIsVisible = 0; 606 | defaultConfigurationName = Release; 607 | }; 608 | 6034DFF41D6D65DC000A7942 /* Build configuration list for PBXNativeTarget "GKCoverDemoTests" */ = { 609 | isa = XCConfigurationList; 610 | buildConfigurations = ( 611 | 6034DFF51D6D65DC000A7942 /* Debug */, 612 | 6034DFF61D6D65DC000A7942 /* Release */, 613 | ); 614 | defaultConfigurationIsVisible = 0; 615 | defaultConfigurationName = Release; 616 | }; 617 | 6034DFF71D6D65DC000A7942 /* Build configuration list for PBXNativeTarget "GKCoverDemoUITests" */ = { 618 | isa = XCConfigurationList; 619 | buildConfigurations = ( 620 | 6034DFF81D6D65DC000A7942 /* Debug */, 621 | 6034DFF91D6D65DC000A7942 /* Release */, 622 | ); 623 | defaultConfigurationIsVisible = 0; 624 | defaultConfigurationName = Release; 625 | }; 626 | /* End XCConfigurationList section */ 627 | }; 628 | rootObject = 6034DFBC1D6D65DC000A7942 /* Project object */; 629 | } 630 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "size" : "1024x1024", 46 | "scale" : "1x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Assets.xcassets/share1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "share1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Assets.xcassets/share1.imageset/share1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuintGao/GKCover/09f82d37256693d089949c441cae8f69c76973f5/GKCoverDemo/GKCoverDemo/Assets.xcassets/share1.imageset/share1.png -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Assets.xcassets/share2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "share2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Assets.xcassets/share2.imageset/share2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuintGao/GKCover/09f82d37256693d089949c441cae8f69c76973f5/GKCoverDemo/GKCoverDemo/Assets.xcassets/share2.imageset/share2.png -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Assets.xcassets/top1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "top1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Assets.xcassets/top1.imageset/top1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuintGao/GKCover/09f82d37256693d089949c441cae8f69c76973f5/GKCoverDemo/GKCoverDemo/Assets.xcassets/top1.imageset/top1.png -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 61 | 68 | 75 | 82 | 89 | 96 | 103 | 110 | 117 | 124 | 131 | 138 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Classes/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // GKCoverDemo 4 | // 5 | // Created by 高坤 on 16/8/24. 6 | // Copyright © 2016年 高坤. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Classes/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // GKCoverDemo 4 | // 5 | // Created by 高坤 on 16/8/24. 6 | // Copyright © 2016年 高坤. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | 20 | // Override point for customization after application launch. 21 | return YES; 22 | } 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 27 | } 28 | 29 | - (void)applicationDidEnterBackground:(UIApplication *)application { 30 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 32 | } 33 | 34 | - (void)applicationWillEnterForeground:(UIApplication *)application { 35 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 36 | } 37 | 38 | - (void)applicationDidBecomeActive:(UIApplication *)application { 39 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 40 | } 41 | 42 | - (void)applicationWillTerminate:(UIApplication *)application { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Classes/Demo/Controller/GKCoverDemo_v240.h: -------------------------------------------------------------------------------- 1 | // 2 | // GKCoverDemo_v240.h 3 | // GKCoverDemo 4 | // 5 | // Created by 高坤 on 2017/2/24. 6 | // Copyright © 2017年 高坤. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GKCoverDemo_v240 : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Classes/Demo/Controller/GKCoverDemo_v240.m: -------------------------------------------------------------------------------- 1 | // 2 | // GKCoverDemo_v240.m 3 | // GKCoverDemo 4 | // 5 | // Created by 高坤 on 2017/2/24. 6 | // Copyright © 2017年 高坤. All rights reserved. 7 | // 8 | 9 | #import "GKCoverDemo_v240.h" 10 | #import "GKCover.h" 11 | 12 | @interface GKCoverDemo_v240 () 13 | 14 | @end 15 | 16 | @implementation GKCoverDemo_v240 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | self.navigationController.navigationBar.barTintColor = [UIColor blackColor]; 22 | } 23 | 24 | - (IBAction)top01:(id)sender { 25 | UIImage *topImage = [UIImage imageNamed:@"top1"]; 26 | UIImageView *imgView = [[UIImageView alloc] initWithImage:topImage]; 27 | imgView.gk_size = CGSizeMake(KScreenW, KScreenW * topImage.size.height / topImage.size.width); 28 | 29 | CGFloat top = UIApplication.sharedApplication.statusBarFrame.size.height + self.navigationController.navigationBar.frame.size.height; 30 | 31 | [GKCover coverFrom:self.view contentView:imgView margin:top style:GKCoverStyleTranslucent showStyle:GKCoverShowStyleTop showAnimStyle:GKCoverShowAnimStyleTop hideAnimStyle:GKCoverHideAnimStyleTop notClick:NO]; 32 | } 33 | 34 | - (IBAction)top02:(id)sender { 35 | UIImage *topImage = [UIImage imageNamed:@"top1"]; 36 | UIImageView *imgView = [[UIImageView alloc] initWithImage:topImage]; 37 | imgView.gk_size = CGSizeMake(KScreenW, KScreenW * topImage.size.height / topImage.size.width); 38 | 39 | 40 | CGFloat top = UIApplication.sharedApplication.statusBarFrame.size.height + self.navigationController.navigationBar.frame.size.height; 41 | 42 | [GKCover coverFrom:self.view contentView:imgView margin:top style:GKCoverStyleTranslucent showStyle:GKCoverShowStyleTop showAnimStyle:GKCoverShowAnimStyleTop hideAnimStyle:GKCoverHideAnimStyleNone notClick:NO]; 43 | } 44 | 45 | - (IBAction)center01:(id)sender { 46 | UIImage *centerImage = [UIImage imageNamed:@"share2"]; 47 | UIImageView *imgView = [[UIImageView alloc] initWithImage:centerImage]; 48 | imgView.gk_size = CGSizeMake(300, 340); 49 | imgView.userInteractionEnabled = YES; 50 | [imgView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imgClick)]]; 51 | 52 | [GKCover coverFrom:[UIApplication sharedApplication].keyWindow 53 | contentView:imgView 54 | style:GKCoverStyleTranslucent 55 | showStyle:GKCoverShowStyleCenter 56 | showAnimStyle:GKCoverShowAnimStyleTop 57 | hideAnimStyle:GKCoverHideAnimStyleBottom 58 | notClick:YES showBlock:^{ 59 | NSLog(@"遮罩显示了。。。"); 60 | } hideBlock:^{ 61 | NSLog(@"遮罩消失了。。。"); 62 | }]; 63 | 64 | if ([GKCover hasCover]) { 65 | NSLog(@"遮罩已存在"); 66 | }else { 67 | NSLog(@"遮罩不存在"); 68 | } 69 | 70 | // [GKCover coverHideStatusBarWithContentView:imgView style:GKCoverStyleTranslucent showStyle:GKCoverShowStyleBottom showAnimStyle:GKCoverShowAnimStyleBottom hideAnimStyle:GKCoverHideAnimStyleBottom notClick:YES showBlock:nil hideBlock:nil]; 71 | 72 | } 73 | 74 | - (IBAction)center02:(id)sender { 75 | 76 | UIImage *centerImage = [UIImage imageNamed:@"share2"]; 77 | UIImageView *imgView = [[UIImageView alloc] initWithImage:centerImage]; 78 | imgView.gk_size = CGSizeMake(300, 340); 79 | imgView.userInteractionEnabled = YES; 80 | [imgView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imgClick)]]; 81 | 82 | [GKCover coverFrom:[UIApplication sharedApplication].keyWindow 83 | contentView:imgView 84 | style:GKCoverStyleTranslucent 85 | showStyle:GKCoverShowStyleCenter 86 | showAnimStyle:GKCoverShowAnimStyleBottom 87 | hideAnimStyle:GKCoverHideAnimStyleTop 88 | notClick:YES]; 89 | 90 | if ([GKCover hasCover]) { 91 | NSLog(@"遮罩已存在"); 92 | }else{ 93 | NSLog(@"遮罩不存在"); 94 | } 95 | } 96 | - (IBAction)center03:(id)sender { 97 | 98 | UIImage *centerImage = [UIImage imageNamed:@"share2"]; 99 | UIImageView *imgView = [[UIImageView alloc] initWithImage:centerImage]; 100 | imgView.gk_size = CGSizeMake(300, 340); 101 | imgView.userInteractionEnabled = YES; 102 | [imgView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imgClick)]]; 103 | 104 | [GKCover coverFrom:[UIApplication sharedApplication].keyWindow 105 | contentView:imgView 106 | style:GKCoverStyleTranslucent 107 | showStyle:GKCoverShowStyleCenter 108 | showAnimStyle:GKCoverShowAnimStyleCenter 109 | hideAnimStyle:GKCoverHideAnimStyleCenter 110 | notClick:YES]; 111 | 112 | if ([GKCover hasCover]) { 113 | NSLog(@"遮罩已存在"); 114 | }else{ 115 | NSLog(@"遮罩不存在"); 116 | } 117 | 118 | [GKCover changeCoverBgColor:[UIColor greenColor]]; 119 | } 120 | - (IBAction)center04:(id)sender { 121 | 122 | UIImage *centerImage = [UIImage imageNamed:@"share2"]; 123 | UIImageView *imgView = [[UIImageView alloc] initWithImage:centerImage]; 124 | imgView.gk_size = CGSizeMake(300, 340); 125 | imgView.userInteractionEnabled = YES; 126 | [imgView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imgClick)]]; 127 | 128 | [GKCover coverFrom:[UIApplication sharedApplication].keyWindow contentView:imgView 129 | style:GKCoverStyleTranslucent 130 | showStyle:GKCoverShowStyleCenter 131 | showAnimStyle:GKCoverShowAnimStyleBottom 132 | hideAnimStyle:GKCoverHideAnimStyleNone 133 | notClick:YES]; 134 | 135 | if ([GKCover hasCover]) { 136 | NSLog(@"遮罩已存在"); 137 | }else{ 138 | NSLog(@"遮罩不存在"); 139 | } 140 | } 141 | - (IBAction)bottom01:(id)sender { 142 | 143 | UIImage *bottomImage = [UIImage imageNamed:@"share1"]; 144 | UIImageView *imgView = [[UIImageView alloc] initWithImage:bottomImage]; 145 | imgView.gk_size = CGSizeMake(KScreenW, KScreenW * bottomImage.size.height / bottomImage.size.width); 146 | 147 | UIView *contentView = [UIView new]; 148 | [contentView addSubview:imgView]; 149 | contentView.gk_size = CGSizeMake(imgView.gk_width, imgView.gk_height + 34.0f); 150 | 151 | [GKCover coverFrom:self.view 152 | contentView:contentView 153 | style:GKCoverStyleTranslucent 154 | showStyle:GKCoverShowStyleBottom 155 | showAnimStyle:GKCoverShowAnimStyleBottom 156 | hideAnimStyle:GKCoverHideAnimStyleBottom 157 | notClick:NO]; 158 | } 159 | - (IBAction)bottom02:(id)sender { 160 | UIImage *bottomImage = [UIImage imageNamed:@"share1"]; 161 | UIImageView *imgView = [[UIImageView alloc] initWithImage:bottomImage]; 162 | imgView.gk_size = CGSizeMake(KScreenW, KScreenW * bottomImage.size.height / bottomImage.size.width); 163 | 164 | [GKCover coverFrom:self.view 165 | contentView:imgView 166 | style:GKCoverStyleBlur 167 | showStyle:GKCoverShowStyleBottom 168 | showAnimStyle:GKCoverShowAnimStyleBottom 169 | hideAnimStyle:GKCoverHideAnimStyleNone 170 | notClick:NO]; 171 | } 172 | - (IBAction)bottom03:(id)sender { 173 | UIView *blueView = [UIView new]; 174 | blueView.backgroundColor = [UIColor blueColor]; 175 | blueView.gk_size = CGSizeMake(KScreenW, 160.0f); 176 | [blueView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(bottom03ViewClick:)]]; 177 | 178 | [GKCover coverFrom:self.view 179 | contentView:blueView 180 | style:GKCoverStyleTranslucent 181 | showStyle:GKCoverShowStyleBottom 182 | showAnimStyle:GKCoverShowAnimStyleBottom 183 | hideAnimStyle:GKCoverHideAnimStyleBottom 184 | notClick:YES]; 185 | } 186 | 187 | - (IBAction)left:(id)sender { 188 | UIView *redView = [UIView new]; 189 | redView.backgroundColor = [UIColor redColor]; 190 | redView.gk_size = CGSizeMake(120, KScreenH); 191 | 192 | [GKCover coverFrom:self.view 193 | contentView:redView 194 | style:GKCoverStyleTranslucent 195 | showStyle:GKCoverShowStyleLeft 196 | showAnimStyle:GKCoverShowAnimStyleLeft 197 | hideAnimStyle:GKCoverHideAnimStyleLeft 198 | notClick:NO]; 199 | } 200 | 201 | - (IBAction)right:(id)sender { 202 | UIView *redView = [UIView new]; 203 | redView.backgroundColor = [UIColor redColor]; 204 | redView.gk_size = CGSizeMake(120, KScreenH); 205 | 206 | [GKCover coverFrom:self.view 207 | contentView:redView 208 | style:GKCoverStyleTranslucent 209 | showStyle:GKCoverShowStyleRight 210 | showAnimStyle:GKCoverShowAnimStyleRight 211 | hideAnimStyle:GKCoverHideAnimStyleRight 212 | notClick:NO]; 213 | } 214 | 215 | - (IBAction)customAnim:(id)sender { 216 | CAKeyframeAnimation *popAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 217 | popAnimation.duration = 0.4; 218 | popAnimation.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.9f, 0.9f, 1.0f)], 219 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.1f, 1.1f, 1.0f)], 220 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.9f, 0.9f, 1.0f)], 221 | [NSValue valueWithCATransform3D:CATransform3DIdentity]]; 222 | popAnimation.keyTimes = @[@0.0f, @0.5f, @0.75f, @1.0f]; 223 | popAnimation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], 224 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], 225 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]]; 226 | 227 | UIView *contentView = [UIView new]; 228 | contentView.backgroundColor = UIColor.whiteColor; 229 | contentView.layer.cornerRadius = 10; 230 | contentView.layer.masksToBounds = YES; 231 | contentView.gk_size = CGSizeMake(300, 100); 232 | 233 | [GKCover showAlertViewFrom:self.view contentView:contentView style:GKCoverStyleTranslucent animation:popAnimation notClick:NO]; 234 | } 235 | 236 | - (void)bottom03ViewClick:(id)sender { 237 | [GKCover hideCover]; 238 | 239 | // 这里需要延迟弹窗,防止动画冲突 240 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(kAnimDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 241 | [self bottom02:nil]; 242 | }); 243 | } 244 | 245 | - (void)imgClick 246 | { 247 | [GKCover hideCoverWithHideBlock:^{ 248 | NSLog(@"隐藏block。。。。。"); 249 | }]; 250 | 251 | if ([GKCover hasCover]) { 252 | NSLog(@"遮罩已存在"); 253 | }else{ 254 | NSLog(@"遮罩不存在"); 255 | } 256 | } 257 | 258 | - (BOOL)prefersStatusBarHidden { 259 | return NO; 260 | } 261 | 262 | - (UIStatusBarStyle)preferredStatusBarStyle { 263 | return UIStatusBarStyleLightContent; 264 | } 265 | 266 | @end 267 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Classes/Demo/View/GKCoverView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GKCoverView.h 3 | // GKCoverDemo 4 | // 5 | // Created by 高坤 on 2017/3/31. 6 | // Copyright © 2017年 高坤. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GKCoverView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Classes/Demo/View/GKCoverView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GKCoverView.m 3 | // GKCoverDemo 4 | // 5 | // Created by 高坤 on 2017/3/31. 6 | // Copyright © 2017年 高坤. All rights reserved. 7 | // 8 | 9 | #import "GKCoverView.h" 10 | 11 | @implementation GKCoverView 12 | 13 | /* 14 | // Only override drawRect: if you perform custom drawing. 15 | // An empty implementation adversely affects performance during animation. 16 | - (void)drawRect:(CGRect)rect { 17 | // Drawing code 18 | } 19 | */ 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Classes/Demo/View/GKCoverView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Classes/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // GKCoverDemo 4 | // 5 | // Created by 高坤 on 16/8/24. 6 | // Copyright © 2016年 高坤. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIViewControllerBasedStatusBarAppearance 6 | 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UIStatusBarStyle 36 | UIStatusBarStyleLightContent 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemo/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // GKCoverDemo 4 | // 5 | // Created by 高坤 on 2016/11/17. 6 | // Copyright © 2016年 高坤. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | 12 | #import "GKCover.h" 13 | 14 | #endif /* PrefixHeader_pch */ 15 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemoTests/GKCoverDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // GKCoverDemoTests.m 3 | // GKCoverDemoTests 4 | // 5 | // Created by 高坤 on 16/8/24. 6 | // Copyright © 2016年 高坤. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GKCoverDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation GKCoverDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemoUITests/GKCoverDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // GKCoverDemoUITests.m 3 | // GKCoverDemoUITests 4 | // 5 | // Created by 高坤 on 16/8/24. 6 | // Copyright © 2016年 高坤. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GKCoverDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation GKCoverDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /GKCoverDemo/GKCoverDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /GKCoverDemo/demo_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuintGao/GKCover/09f82d37256693d089949c441cae8f69c76973f5/GKCoverDemo/demo_bottom.png -------------------------------------------------------------------------------- /GKCoverDemo/demo_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuintGao/GKCover/09f82d37256693d089949c441cae8f69c76973f5/GKCoverDemo/demo_center.png -------------------------------------------------------------------------------- /GKCoverDemo/demo_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuintGao/GKCover/09f82d37256693d089949c441cae8f69c76973f5/GKCoverDemo/demo_top.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GKCover 2 | 3 | [![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/QuintGao/GKCover/master/LICENSE)   4 | [![platform](http://img.shields.io/cocoapods/p/GKCover.svg?style=flat)](http://cocoadocs.org/docsets/GKCover)   5 | [![languages](https://img.shields.io/badge/language-objective--c-blue.svg)](#)    6 | [![cocoapods](http://img.shields.io/cocoapods/v/GKCover.svg?style=flat)](https://cocoapods.org/pods/GKCover)   7 | [![support](https://img.shields.io/badge/support-ios%208%2B-orange.svg)](#) 8 | 9 | 一行代码实现遮罩视图,让你的弹窗更easy 10 | ============== 11 | 12 | ## 说明 13 | 关于iPhone X及iOS 11的适配问题,在底部弹出视图时,建议自行将弹出视图的底部距离增加安全区域的距离,防止遮挡。 14 | 15 | ## 版本说明 16 | 版本2.4.0更新:分离遮罩弹出和隐藏时的动画,当前隐藏遮罩方法[GKCover hideCover] 17 | 18 | 最新版本2.3.1已支持判断遮罩是否存在的方法:[GKCover hasCover] 19 | 20 | ## 使用方法 21 | 22 | 1.底部弹窗 23 | 24 | ``` 25 | UIView *redView = [UIView new]; 26 | redView.backgroundColor = [UIColor redColor]; 27 | redView.gk_size = CGSizeMake(KScreenW, 200); 28 | 29 | [GKCover translucentCoverFrom:self.view content:redView animated:YES]; 30 | 31 | ``` 32 | 2.中间弹窗 33 | 34 | ``` 35 | UIView *greenView = [UIView new]; 36 | greenView.backgroundColor = [UIColor greenColor]; 37 | greenView.gk_size = CGSizeMake(240, 160); 38 | 39 | [GKCover translucentWindowCenterCoverContent:greenView animated:YES]; 40 | ``` 41 | 3.自定义弹窗 42 | 43 | ``` 44 | GKCover *cover = [GKCover transparentCoverWithTarget:self action:@selector(hidden)]; 45 | cover.frame = self.view.bounds; 46 | [self.view addSubview:cover]; 47 | self.cover = cover; 48 | 49 | UIView *customView = [UIView new]; 50 | customView.backgroundColor = [UIColor purpleColor]; 51 | customView.frame = CGRectMake((KScreenW - 300)/2, 0, 300, 200); 52 | [self.view addSubview:customView]; 53 | self.customView = customView; 54 | 55 | [UIView animateWithDuration:0.25 animations:^{ 56 | customView.gk_y = (KScreenH - 200)/2; 57 | }]; 58 | ``` 59 | 60 | 4.显示和隐藏block 61 | 62 | ``` 63 | UIView *customView = [UIView new]; 64 | customView.gk_size = CGSizeMake(KScreenW, 200); 65 | customView.backgroundColor = [UIColor blackColor]; 66 | 67 | [GKCover translucentCoverFrom:self.view content:customView animated:YES showBlock:^{ 68 | // 显示出来时的block 69 | NSLog(@"弹窗显示了,6不6"); 70 | } hideBlock:^{ 71 | // 移除后的block 72 | NSLog(@"弹窗消失了,555"); 73 | }]; 74 | 75 | 76 | ``` 77 | 78 | 5.新增一行代码实现各种弹窗 79 | 80 | ``` 81 | /** 82 | 显示遮罩 83 | 84 | @param fromView 显示的视图上 85 | @param contentView 显示的视图 86 | @param style 遮罩类型 87 | @param showStyle 显示类型 88 | @param animStyle 动画类型 89 | @param notClick 是否不可点击 90 | */ 91 | + (void)coverFrom:(UIView *)fromView contentView:(UIView *)contentView style:(GKCoverStyle)style showStyle:(GKCoverShowStyle)showStyle animStyle:(GKCoverAnimStyle)animStyle notClick:(BOOL)notClick; 92 | 93 | 最全方法:增加遮罩显示和隐藏的block方法 94 | 95 | + (void)coverFrom:(UIView *)fromView contentView:(UIView *)contentView style:(GKCoverStyle)style showStyle:(GKCoverShowStyle)showStyle animStyle:(GKCoverAnimStyle)animStyle notClick:(BOOL)notClick showBlock:(showBlock)showBlock hideBlock:(hideBlock)hideBlock; 96 | 97 | 98 | ``` 99 | 100 | ## Demo效果图: 101 | 102 | ![image](https://github.com/QuintGao/GKCover/blob/master/GKCoverDemo/GKCoverDemo-gif.gif) 103 | 104 | 新增demo效果图: 105 | 106 | 顶部弹出 107 | 108 | ![image](https://github.com/QuintGao/GKCover/blob/master/GKCoverDemo/demo_top.png) 109 | 110 | 中间弹出 111 | 112 | ![image](https://github.com/QuintGao/GKCover/blob/master/GKCoverDemo/demo_center.png) 113 | 114 | 底部弹出 115 | 116 | ![image](https://github.com/QuintGao/GKCover/blob/master/GKCoverDemo/demo_bottom.png) 117 | 118 | 更新日志: 119 | 120 | ``` 121 | 1.0.0版本:添加底部遮罩和中间遮罩 122 | 1.0.1版本:添加自定义遮罩 123 | 1.0.2版本:添加使用方法 124 | 1.0.3版本:修改一个全透明遮罩不能点击消失的bug 125 | 1.0.4版本:更新Demo工程,添加更多使用方法 126 | 1.0.5版本:遮罩支持显示和隐藏的block,可以在block中添加要实现的方法 127 | 1.0.6版本:添加外部调用隐藏方法 128 | 129 | 2.0.0版本:2016.09.01,重大更新,优化代码内容,新增是否能点击遮罩的判断值,使用更方便。 130 | 2.1.0版本:2016.09.02,新增毛玻璃效果 131 | 2.2.0版本:2016.11.02,重大更新 132 | 1.增加类型的判断(毛玻璃,全透明,半透明) 133 | 2.增加显示类型的判断(上,中,下) 134 | 3.增加动画类型的判断(从上弹出,中间弹出,底部弹出,无动画) 135 | 2.3.0版本:2016.11.17 136 | 1. 部分内容优化 137 | 2. 增加2.2.0的使用方法demo 138 | 2.3.1版本:2017.2.21 139 | 1. 新增判断遮罩是否已存在的方法[GKCover hasCover]; 140 | 2.4.0版本:2017.2.28 141 | 1. 分离弹出和隐藏时的动画 142 | 2. 当前版本的隐藏方法改为[GKCover hideCover]防止与以前版本的冲突 143 | 2.4.2版本:2017.8.23 144 | 新增遮罩遮盖状态栏的方法 145 | 2.5.2版本:2018.6.6 146 | 新增调用隐藏方法时加入block 147 | 2.5.3版本:2018.6.6 148 | 新增改变遮罩背景色方法 149 | 2.5.4版本:2019.3.11 150 | 优化代码,防止内存泄漏 151 | 2.5.5版本:2020.04.11 152 | 优化,解决多处调用隐藏block可以导致的bug 153 | 2.6.0版本:2021.03.26 154 | 新增自定义中间弹窗动画功能 155 | 2.6.1版本:2021.05.08 156 | 新增无动画隐藏遮罩方法 157 | 3.0.0版本:2021.09.01 158 | 1、内部逻辑优化,删除弃用方法及无用代码 159 | 2、新增设置遮罩与父视图的间距属性,支持上下左右弹窗 160 | 3.0.1版本:2021.12.31 161 | 修复某些情况下hasCover方法不准确的问题 162 | ``` 163 | 164 | ## 技术支持: 165 | 166 | [csdn博客地址](http://blog.csdn.net/u010565269/article/details/52332027) 167 | 168 | [简书地址](http://www.jianshu.com/p/866a79a95963) 169 | 170 | 本人QQ:1094887059 171 | 交流群:529040270 172 | --------------------------------------------------------------------------------