├── SingleMask ├── Assets.xcassets │ ├── Contents.json │ ├── 分时引导.imageset │ │ ├── 分时引导@2x.png │ │ ├── 分时引导@3x.png │ │ └── Contents.json │ ├── 组合收益.imageset │ │ ├── 组合收益@2x.png │ │ ├── 组合收益@3x.png │ │ └── Contents.json │ ├── 首页引导.imageset │ │ ├── 首页引导@2x.png │ │ ├── 首页引导@3x.png │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── ViewController.h ├── AppDelegate.h ├── main.m ├── LoadMaskHelper.h ├── SingleMaskView.h ├── ViewController.m ├── UIView+SetRect.h ├── Info.plist ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard ├── AppDelegate.m ├── UIView+SetRect.m ├── SingleMaskView.m └── LoadMaskHelper.m ├── README.md └── SingleMask.xcodeproj ├── xcuserdata └── liuchengli.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── xcschememanagement.plist │ └── SingleMask.xcscheme ├── project.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── liuchengli.xcuserdatad │ └── UserInterfaceState.xcuserstate └── project.pbxproj /SingleMask/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SingleMask/Assets.xcassets/分时引导.imageset/分时引导@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchengli/SingleMaskView/HEAD/SingleMask/Assets.xcassets/分时引导.imageset/分时引导@2x.png -------------------------------------------------------------------------------- /SingleMask/Assets.xcassets/分时引导.imageset/分时引导@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchengli/SingleMaskView/HEAD/SingleMask/Assets.xcassets/分时引导.imageset/分时引导@3x.png -------------------------------------------------------------------------------- /SingleMask/Assets.xcassets/组合收益.imageset/组合收益@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchengli/SingleMaskView/HEAD/SingleMask/Assets.xcassets/组合收益.imageset/组合收益@2x.png -------------------------------------------------------------------------------- /SingleMask/Assets.xcassets/组合收益.imageset/组合收益@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchengli/SingleMaskView/HEAD/SingleMask/Assets.xcassets/组合收益.imageset/组合收益@3x.png -------------------------------------------------------------------------------- /SingleMask/Assets.xcassets/首页引导.imageset/首页引导@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchengli/SingleMaskView/HEAD/SingleMask/Assets.xcassets/首页引导.imageset/首页引导@2x.png -------------------------------------------------------------------------------- /SingleMask/Assets.xcassets/首页引导.imageset/首页引导@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchengli/SingleMaskView/HEAD/SingleMask/Assets.xcassets/首页引导.imageset/首页引导@3x.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SingleMaskView 2 | 蒙版工具类,自定义添加多个蒙版透明区和多种形状
3 | 1,可以一个界面自定义添加任意个引导蒙版透明区
4 | 2,透明区为矩形或带圆角和椭圆
5 | 3,支持添加图片功能
6 | 4,附带一个参考展示逻辑工具类,方便将蒙版统一管理。也可以直接用SingleMaskView添加引导蒙版 7 | -------------------------------------------------------------------------------- /SingleMask.xcodeproj/xcuserdata/liuchengli.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /SingleMask.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SingleMask.xcodeproj/project.xcworkspace/xcuserdata/liuchengli.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchengli/SingleMaskView/HEAD/SingleMask.xcodeproj/project.xcworkspace/xcuserdata/liuchengli.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SingleMask/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // SingleMask 4 | // 5 | // Created by 刘成利 on 2016/6/13. 6 | // Copyright © 2016年 刘成利. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /SingleMask/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SingleMask 4 | // 5 | // Created by 刘成利 on 2016/6/13. 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 | -------------------------------------------------------------------------------- /SingleMask/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SingleMask 4 | // 5 | // Created by 刘成利 on 2017/1/13. 6 | // Copyright © 2017年 刘成利. 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 | -------------------------------------------------------------------------------- /SingleMask/Assets.xcassets/分时引导.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "分时引导@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "分时引导@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /SingleMask/Assets.xcassets/组合收益.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "组合收益@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "组合收益@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /SingleMask/Assets.xcassets/首页引导.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "首页引导@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "首页引导@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /SingleMask.xcodeproj/xcuserdata/liuchengli.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SingleMask.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 5A74B3621E28AB72000D51D1 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /SingleMask/LoadMaskHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoadMaskHelper.h 3 | // ZiPeiYi 4 | // 5 | // Created by 刘成利 on 16/6/14. 6 | // Copyright © 2016年 YouXianMing. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | typedef enum : NSUInteger { 12 | 13 | HomePage, // 主页 14 | RealIncome, // 实际收益 15 | StockTimesharing, // 股票分时 16 | 17 | } PageTye; 18 | 19 | @interface LoadMaskHelper : NSObject 20 | 21 | /* 22 | 使用方法: [LoadMaskHelper showMaskWithType:HomePage onView:self.view delay:0.5]; 23 | */ 24 | 25 | 26 | /** 27 | * 显示蒙版 ( 页面蒙版类型 要在那个view展示 延时几秒展示) 28 | */ 29 | + (void)showMaskWithType:(PageTye)pageType onView:(UIView*)view delay:(NSTimeInterval)delay; 30 | 31 | /** 32 | * 版本升级则重置蒙版,加载新蒙版 33 | */ 34 | + (void)checkAPPVersion; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /SingleMask/SingleMaskView.h: -------------------------------------------------------------------------------- 1 | // 2 | // SingleMaskView.h 3 | // 4 | // Created by 刘成利 on 16/6/7. 5 | // Copyright © 2016年 刘成利. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | 11 | 12 | 13 | @interface SingleMaskView : UIView 14 | 15 | /** 16 | * 蒙版颜色(非透明区颜色,默认黑色0.5透明度) 17 | */ 18 | @property (nonatomic, strong) UIColor *maskColor; 19 | 20 | /** 21 | * 添加矩形透明区(位置和弧度) 22 | */ 23 | - (void)addTransparentRect:(CGRect)rect withRadius:(CGFloat)radius; 24 | 25 | /** 26 | * 添加圆形透明区 27 | */ 28 | - (void)addTransparentOvalRect:(CGRect)rect; 29 | 30 | /** 31 | * 添加图片(图片和位置) 32 | */ 33 | - (void)addImage:(UIImage*)image withFrame:(CGRect)frame; 34 | 35 | 36 | 37 | /** 在指定view上显示蒙版(过渡动画) 38 | * 不调用用此方法可使用 addSubview:自己添加展示 39 | */ 40 | - (void)showMaskViewInView:(UIView *)view; 41 | 42 | /** 43 | * 销毁蒙版view(默认点击空白区自动销毁) 44 | */ 45 | - (void)dismissMaskView; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /SingleMask/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 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /SingleMask/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // SingleMask 4 | // 5 | // Created by 刘成利 on 2016/6/13. 6 | // Copyright © 2016年 刘成利. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "LoadMaskHelper.h" 11 | 12 | 13 | @interface ViewController () 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | 22 | 23 | // 蒙版透明区和图片适配根据个人项目适配方式添加(个人是乘以比率,未加入代码中) 24 | 25 | 26 | // 主页蒙版 27 | [LoadMaskHelper showMaskWithType:HomePage onView:self.view delay:0.5]; 28 | 29 | // // 其他页面蒙版1 30 | // [LoadMaskHelper showMaskWithType:RealIncome onView:self.view delay:0.5]; 31 | // 32 | // // 其他页面蒙版2 33 | // [LoadMaskHelper showMaskWithType:StockTimesharing onView:self.view delay:1.5]; 34 | 35 | 36 | } 37 | 38 | 39 | - (void)didReceiveMemoryWarning { 40 | [super didReceiveMemoryWarning]; 41 | // Dispose of any resources that can be recreated. 42 | } 43 | 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /SingleMask/UIView+SetRect.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+SetRect.h 3 | // SetRect 4 | // 5 | // Created by YouXianMing on 14-9-26. 6 | // Copyright (c) 2014年 YouXianMing. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (SetRect) 12 | 13 | // Frame 14 | @property (nonatomic) CGPoint viewOrigin; 15 | @property (nonatomic) CGSize viewSize; 16 | 17 | // Frame Origin 18 | @property (nonatomic) CGFloat x; 19 | @property (nonatomic) CGFloat y; 20 | 21 | // Frame Size 22 | @property (nonatomic) CGFloat width; 23 | @property (nonatomic) CGFloat height; 24 | 25 | // Frame Borders 26 | @property (nonatomic) CGFloat top; 27 | @property (nonatomic) CGFloat left; 28 | @property (nonatomic) CGFloat bottom; 29 | @property (nonatomic) CGFloat right; 30 | 31 | // Center Point 32 | #if !IS_IOS_DEVICE 33 | @property (nonatomic) CGPoint center; 34 | #endif 35 | @property (nonatomic) CGFloat centerX; 36 | @property (nonatomic) CGFloat centerY; 37 | 38 | // Middle Point 39 | @property (nonatomic, readonly) CGPoint middlePoint; 40 | @property (nonatomic, readonly) CGFloat middleX; 41 | @property (nonatomic, readonly) CGFloat middleY; 42 | @end 43 | -------------------------------------------------------------------------------- /SingleMask/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 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /SingleMask/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 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /SingleMask/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 | -------------------------------------------------------------------------------- /SingleMask/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SingleMask 4 | // 5 | // Created by 刘成利 on 2016/6/13. 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 | // Override point for customization after application launch. 20 | return YES; 21 | } 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 invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /SingleMask.xcodeproj/xcuserdata/liuchengli.xcuserdatad/xcschemes/SingleMask.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /SingleMask/UIView+SetRect.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+SetRect.m 3 | // SetRect 4 | // 5 | // Created by YouXianMing on 14-9-26. 6 | // Copyright (c) 2014年 YouXianMing. All rights reserved. 7 | // 8 | 9 | #import "UIView+SetRect.h" 10 | 11 | @implementation UIView (SetRect) 12 | 13 | #pragma mark Frame 14 | 15 | - (CGPoint)viewOrigin { 16 | 17 | return self.frame.origin; 18 | } 19 | 20 | - (void)setViewOrigin:(CGPoint)newOrigin { 21 | 22 | CGRect newFrame = self.frame; 23 | newFrame.origin = newOrigin; 24 | self.frame = newFrame; 25 | } 26 | 27 | - (CGSize)viewSize { 28 | 29 | return self.frame.size; 30 | } 31 | 32 | - (void)setViewSize:(CGSize)newSize { 33 | CGRect newFrame = self.frame; 34 | newFrame.size = newSize; 35 | self.frame = newFrame; 36 | } 37 | 38 | #pragma mark Frame Origin 39 | 40 | - (CGFloat)x { 41 | 42 | return self.frame.origin.x; 43 | } 44 | 45 | - (void)setX:(CGFloat)newX { 46 | 47 | CGRect newFrame = self.frame; 48 | newFrame.origin.x = newX; 49 | self.frame = newFrame; 50 | } 51 | 52 | - (CGFloat)y { 53 | 54 | return self.frame.origin.y; 55 | } 56 | 57 | - (void)setY:(CGFloat)newY { 58 | 59 | CGRect newFrame = self.frame; 60 | newFrame.origin.y = newY; 61 | self.frame = newFrame; 62 | } 63 | 64 | #pragma mark Frame Size 65 | 66 | - (CGFloat)height { 67 | 68 | return self.frame.size.height; 69 | } 70 | 71 | - (void)setHeight:(CGFloat)newHeight { 72 | 73 | CGRect newFrame = self.frame; 74 | newFrame.size.height = newHeight; 75 | self.frame = newFrame; 76 | } 77 | 78 | - (CGFloat)width { 79 | 80 | return self.frame.size.width; 81 | } 82 | 83 | - (void)setWidth:(CGFloat)newWidth { 84 | 85 | CGRect newFrame = self.frame; 86 | newFrame.size.width = newWidth; 87 | self.frame = newFrame; 88 | } 89 | 90 | #pragma mark Frame Borders 91 | 92 | - (CGFloat)left { 93 | 94 | return self.x; 95 | } 96 | 97 | - (void)setLeft:(CGFloat)left { 98 | 99 | self.x = left; 100 | } 101 | 102 | - (CGFloat)right { 103 | 104 | return self.frame.origin.x + self.frame.size.width; 105 | } 106 | 107 | - (void)setRight:(CGFloat)right { 108 | 109 | self.x = right - self.width; 110 | } 111 | 112 | - (CGFloat)top { 113 | 114 | return self.y; 115 | } 116 | 117 | - (void)setTop:(CGFloat)top { 118 | 119 | self.y = top; 120 | } 121 | 122 | - (CGFloat)bottom { 123 | 124 | return self.frame.origin.y + self.frame.size.height; 125 | } 126 | 127 | - (void)setBottom:(CGFloat)bottom { 128 | 129 | self.y = bottom - self.height; 130 | } 131 | 132 | #pragma mark Center Point 133 | 134 | #if !IS_IOS_DEVICE 135 | - (CGPoint)center { 136 | 137 | return CGPointMake(self.left + self.middleX, self.top + self.middleY); 138 | } 139 | 140 | - (void)setCenter:(CGPoint)newCenter { 141 | 142 | self.left = newCenter.x - self.middleX; 143 | self.top = newCenter.y - self.middleY; 144 | } 145 | #endif 146 | 147 | - (CGFloat)centerX { 148 | 149 | return self.center.x; 150 | } 151 | 152 | - (void)setCenterX:(CGFloat)newCenterX { 153 | 154 | self.center = CGPointMake(newCenterX, self.center.y); 155 | } 156 | 157 | - (CGFloat)centerY { 158 | 159 | return self.center.y; 160 | } 161 | 162 | - (void)setCenterY:(CGFloat)newCenterY { 163 | 164 | self.center = CGPointMake(self.center.x, newCenterY); 165 | } 166 | 167 | #pragma mark Middle Point 168 | 169 | - (CGPoint)middlePoint { 170 | 171 | return CGPointMake(self.middleX, self.middleY); 172 | } 173 | 174 | - (CGFloat)middleX { 175 | 176 | return self.width / 2; 177 | } 178 | 179 | - (CGFloat)middleY { 180 | 181 | return self.height / 2; 182 | } 183 | 184 | @end 185 | -------------------------------------------------------------------------------- /SingleMask/SingleMaskView.m: -------------------------------------------------------------------------------- 1 | // 2 | // SingleMaskView.m 3 | // 4 | // Created by 刘成利 on 16/6/7. 5 | // Copyright © 2016年 刘成利. All rights reserved. 6 | // 7 | 8 | #import "SingleMaskView.h" 9 | 10 | @interface SingleMaskView () 11 | 12 | @property (nonatomic, weak) CAShapeLayer *fillLayer; 13 | @property (nonatomic, strong) UIBezierPath *overlayPath; 14 | @property (nonatomic, strong) NSMutableArray *transparentPaths; // 透明区数组 15 | 16 | @end 17 | 18 | @implementation SingleMaskView 19 | 20 | #pragma mark - 初始化 21 | - (instancetype)initWithFrame:(CGRect)frame { 22 | 23 | self = [super initWithFrame: [UIScreen mainScreen].bounds]; 24 | if (self) { 25 | [self setUp]; 26 | } 27 | 28 | return self; 29 | } 30 | 31 | 32 | - (void)setUp { 33 | self.backgroundColor = [UIColor clearColor]; 34 | self.maskColor = [UIColor colorWithWhite:0 alpha:0.5]; // default 50% transparent black 35 | 36 | self.fillLayer.path = self.overlayPath.CGPath; 37 | self.fillLayer.fillRule = kCAFillRuleEvenOdd; 38 | self.fillLayer.fillColor = self.maskColor.CGColor; 39 | 40 | 41 | UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissMaskView)]; 42 | [self addGestureRecognizer:tapGesture]; 43 | } 44 | 45 | 46 | 47 | - (void)layoutSubviews { 48 | [super layoutSubviews]; 49 | 50 | [self refreshMask]; 51 | } 52 | 53 | 54 | - (void)refreshMask { 55 | 56 | UIBezierPath *overlayPath = [self generateOverlayPath]; 57 | 58 | for (UIBezierPath *transparentPath in self.transparentPaths) { 59 | [overlayPath appendPath:transparentPath]; 60 | } 61 | 62 | self.overlayPath = overlayPath; 63 | 64 | self.fillLayer.frame = self.bounds; 65 | self.fillLayer.path = self.overlayPath.CGPath; 66 | self.fillLayer.fillColor = self.maskColor.CGColor; 67 | } 68 | 69 | 70 | 71 | - (UIBezierPath *)generateOverlayPath { 72 | 73 | UIBezierPath *overlayPath = [UIBezierPath bezierPathWithRect:self.bounds]; 74 | [overlayPath setUsesEvenOddFillRule:YES]; 75 | 76 | return overlayPath; 77 | } 78 | 79 | 80 | 81 | - (void)addTransparentPath:(UIBezierPath *)transparentPath { 82 | [self.overlayPath appendPath:transparentPath]; 83 | 84 | [self.transparentPaths addObject:transparentPath]; 85 | 86 | self.fillLayer.path = self.overlayPath.CGPath; 87 | } 88 | 89 | #pragma mark - 公有方法 90 | - (void)addTransparentRect:(CGRect)rect withRadius:(CGFloat)radius{ 91 | 92 | UIBezierPath *transparentPath = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:radius]; 93 | 94 | [self addTransparentPath:transparentPath]; 95 | 96 | 97 | } 98 | 99 | 100 | - (void)addTransparentOvalRect:(CGRect)rect { 101 | UIBezierPath *transparentPath = [UIBezierPath bezierPathWithOvalInRect:rect]; 102 | 103 | [self addTransparentPath:transparentPath]; 104 | } 105 | 106 | 107 | - (void)addImage:(UIImage*)image withFrame:(CGRect)frame{ 108 | 109 | UIImageView * imageView = [[UIImageView alloc]initWithFrame:frame]; 110 | imageView.backgroundColor = [UIColor clearColor]; 111 | imageView.image = image; 112 | 113 | [self addSubview:imageView]; 114 | 115 | 116 | } 117 | 118 | 119 | - (void)showMaskViewInView:(UIView *)view{ 120 | 121 | self.alpha = 0; 122 | [view addSubview:self]; 123 | [UIView animateWithDuration:0.3 animations:^{ 124 | self.alpha = 1; 125 | }]; 126 | 127 | 128 | } 129 | 130 | 131 | - (void)dismissMaskView{ 132 | 133 | 134 | __weak typeof(self)weakSelf = self; 135 | [UIView animateWithDuration:0.3 animations:^{ 136 | weakSelf.alpha = 0; 137 | } completion:^(BOOL finished) { 138 | [weakSelf removeFromSuperview]; 139 | }]; 140 | 141 | 142 | 143 | } 144 | 145 | 146 | #pragma mark - 懒加载Getter Methods 147 | 148 | - (UIBezierPath *)overlayPath { 149 | if (!_overlayPath) { 150 | _overlayPath = [self generateOverlayPath]; 151 | } 152 | 153 | return _overlayPath; 154 | } 155 | 156 | - (CAShapeLayer *)fillLayer { 157 | if (!_fillLayer) { 158 | CAShapeLayer *fillLayer = [CAShapeLayer layer]; 159 | fillLayer.frame = self.bounds; 160 | [self.layer addSublayer:fillLayer]; 161 | 162 | _fillLayer = fillLayer; 163 | } 164 | 165 | return _fillLayer; 166 | } 167 | 168 | - (NSMutableArray *)transparentPaths { 169 | if (!_transparentPaths) { 170 | _transparentPaths = [NSMutableArray array]; 171 | } 172 | 173 | return _transparentPaths; 174 | } 175 | 176 | 177 | - (void)setMaskColor:(UIColor *)maskColor { 178 | _maskColor = maskColor; 179 | 180 | [self refreshMask]; 181 | } 182 | 183 | 184 | 185 | 186 | 187 | @end 188 | -------------------------------------------------------------------------------- /SingleMask/LoadMaskHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // LoadMaskHelper.m 3 | // ZiPeiYi 4 | // 5 | // Created by 刘成利 on 16/6/14. 6 | // Copyright © 2016年 YouXianMing. All rights reserved. 7 | // 8 | 9 | #import "LoadMaskHelper.h" 10 | #import "SingleMaskView.h" 11 | 12 | #import "UIView+SetRect.h" 13 | 14 | 15 | 16 | #define MaskVersiomKey @"MaskVersiomKey" 17 | 18 | #define HomePageKey @"HomePage2.3.5" // 主页 可用资产 19 | #define RealIncomeKey @"RealIncome2.3.5" // ISM完成期详情 实际收益 20 | #define StockTimesharingKey @"StockTimesharing2.3.5" // 股票分时图 21 | 22 | 23 | 24 | @implementation LoadMaskHelper 25 | 26 | + (void)showMaskWithType:(PageTye)pageType onView:(UIView*)view delay:(NSTimeInterval)delay{ 27 | 28 | 29 | // 处理是否加载蒙版 30 | switch (pageType) { 31 | 32 | // 个人主页 33 | case HomePage: 34 | { 35 | NSString *KeyStr = [[NSUserDefaults standardUserDefaults] objectForKey:HomePageKey]; 36 | if(KeyStr.length <=0) 37 | { 38 | 39 | [[NSUserDefaults standardUserDefaults] setObject:@"haveShown" forKey:HomePageKey]; 40 | 41 | }else{ 42 | 43 | // 测试用,让蒙版再次显示,开发完工后注释掉下面代码 44 | [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:HomePageKey]; 45 | return; 46 | 47 | } 48 | 49 | } 50 | 51 | break; 52 | 53 | 54 | 55 | 56 | 57 | case RealIncome: 58 | { 59 | NSString *KeyStr = [[NSUserDefaults standardUserDefaults] objectForKey:RealIncomeKey]; 60 | if(KeyStr.length <=0) 61 | { 62 | 63 | [[NSUserDefaults standardUserDefaults] setObject:@"haveShown" forKey:RealIncomeKey]; 64 | 65 | }else{ 66 | // 测试用,让蒙版再次显示,开发完工后注释掉下面代码 67 | [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:RealIncomeKey]; 68 | return; 69 | 70 | } 71 | 72 | } 73 | 74 | break; 75 | 76 | 77 | 78 | case StockTimesharing: 79 | { 80 | NSString *KeyStr = [[NSUserDefaults standardUserDefaults] objectForKey:StockTimesharingKey]; 81 | if(KeyStr.length <=0) 82 | { 83 | 84 | [[NSUserDefaults standardUserDefaults] setObject:@"haveShown" forKey:StockTimesharingKey]; 85 | 86 | }else{ 87 | 88 | // 测试用,让蒙版再次显示,开发完工后注释掉下面代码 89 | [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:StockTimesharingKey]; 90 | return; 91 | 92 | } 93 | 94 | } 95 | 96 | break; 97 | 98 | default: 99 | break; 100 | } 101 | 102 | 103 | 104 | 105 | 106 | 107 | /* 108 | 以下 项目真实使用案例 109 | */ 110 | 111 | 112 | 113 | SingleMaskView *maskView = [SingleMaskView new]; 114 | 115 | // 加载蒙版 116 | switch (pageType) { 117 | 118 | // 主页 119 | case HomePage: 120 | { 121 | 122 | // 添加第一个蒙版透明区 123 | [maskView addTransparentRect:CGRectMake(view.width-180, 205, 170, 50) withRadius:10]; 124 | [maskView addImage:[UIImage imageNamed:@"首页引导"] withFrame:CGRectMake(view.width-220, 270, 210, 83)]; 125 | 126 | // 添加第二个蒙版透明区 127 | [maskView addTransparentRect:CGRectMake(view.width/10, 400, view.width*4/5, 145) withRadius:10]; 128 | [maskView addImage:[UIImage imageNamed:@"分时引导"] withFrame:CGRectMake((view.width-103)/2, 560, 267 , 83)]; 129 | } 130 | break; 131 | 132 | 133 | 134 | // 实际收益 135 | case RealIncome: 136 | { 137 | [maskView addTransparentRect:CGRectMake(view.width/5, 100, view.width/5*3, 60) withRadius:10]; 138 | [maskView addImage:[UIImage imageNamed:@"组合收益"] withFrame:CGRectMake((view.width)/4, 170, 172 , 83)]; 139 | } 140 | break; 141 | 142 | 143 | // 曲线分时 144 | case StockTimesharing: 145 | { 146 | [maskView addTransparentRect:CGRectMake(view.width/10, 305, view.width*4/5, 145) withRadius:10]; 147 | [maskView addImage:[UIImage imageNamed:@"分时引导"] withFrame:CGRectMake((view.width-103)/2, 460, 267 , 83)]; 148 | } 149 | break; 150 | 151 | 152 | 153 | default: 154 | break; 155 | } 156 | 157 | 158 | // GCD 延时,非阻塞主线程 延时时间:delay 159 | dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)); 160 | 161 | dispatch_after(delayTime, dispatch_get_main_queue(), ^{ 162 | 163 | [maskView showMaskViewInView:view]; 164 | 165 | }); 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | } 174 | 175 | 176 | // 由于每一版app蒙版不一样,新版app自己删除旧版app蒙版代码,即可不用下面的方法 177 | + (void)checkAPPVersion{ 178 | 179 | 180 | /* 181 | 182 | 183 | // 启动时候检测,版本升级 (在app delegate 调用此类的方法); 184 | 185 | NSString *KeyStr = [[NSUserDefaults standardUserDefaults] objectForKey:MaskVersiomKey]; 186 | if (KeyStr.length <=0) { 187 | 188 | // 头一次安装 189 | NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; 190 | NSString *appVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; 191 | [[NSUserDefaults standardUserDefaults] setObject:appVersion forKey:MaskVersiomKey]; 192 | 193 | return; 194 | }else{ 195 | NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; 196 | NSString *appVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; 197 | 198 | if ([KeyStr isEqualToString:appVersion]) 199 | { 200 | return; 201 | 202 | }else{ 203 | // 版本升级的情况 204 | [[NSUserDefaults standardUserDefaults] setObject:appVersion forKey:MaskVersiomKey]; 205 | 206 | [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:HomePageKey]; 207 | [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:VtSIAIKey]; 208 | [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:VtISMKey]; 209 | [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:VtSIAIKeyListKey]; 210 | [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:VtISMKeyListKey]; 211 | [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:SIAIInstructionKey]; 212 | [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:ISMInstructionKey]; 213 | [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:StockCurveKey]; 214 | 215 | } 216 | 217 | } 218 | 219 | 220 | 221 | */ 222 | 223 | 224 | } 225 | @end 226 | -------------------------------------------------------------------------------- /SingleMask.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5A74B3681E28AB72000D51D1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A74B3671E28AB72000D51D1 /* main.m */; }; 11 | 5A74B36B1E28AB72000D51D1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A74B36A1E28AB72000D51D1 /* AppDelegate.m */; }; 12 | 5A74B36E1E28AB72000D51D1 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A74B36D1E28AB72000D51D1 /* ViewController.m */; }; 13 | 5A74B3711E28AB72000D51D1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5A74B36F1E28AB72000D51D1 /* Main.storyboard */; }; 14 | 5A74B3731E28AB72000D51D1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5A74B3721E28AB72000D51D1 /* Assets.xcassets */; }; 15 | 5A74B3761E28AB72000D51D1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5A74B3741E28AB72000D51D1 /* LaunchScreen.storyboard */; }; 16 | 5A74B3811E28ACE3000D51D1 /* SingleMaskView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A74B37E1E28ACE3000D51D1 /* SingleMaskView.m */; }; 17 | 5A74B3821E28ACE3000D51D1 /* LoadMaskHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A74B3801E28ACE3000D51D1 /* LoadMaskHelper.m */; }; 18 | 5A74B3881E28B28D000D51D1 /* UIView+SetRect.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A74B3871E28B28D000D51D1 /* UIView+SetRect.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 5A74B3631E28AB72000D51D1 /* SingleMask.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SingleMask.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 5A74B3671E28AB72000D51D1 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 24 | 5A74B3691E28AB72000D51D1 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 25 | 5A74B36A1E28AB72000D51D1 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 26 | 5A74B36C1E28AB72000D51D1 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 27 | 5A74B36D1E28AB72000D51D1 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 28 | 5A74B3701E28AB72000D51D1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 29 | 5A74B3721E28AB72000D51D1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 30 | 5A74B3751E28AB72000D51D1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 31 | 5A74B3771E28AB72000D51D1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 5A74B37D1E28ACE3000D51D1 /* SingleMaskView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SingleMaskView.h; sourceTree = ""; }; 33 | 5A74B37E1E28ACE3000D51D1 /* SingleMaskView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SingleMaskView.m; sourceTree = ""; }; 34 | 5A74B37F1E28ACE3000D51D1 /* LoadMaskHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoadMaskHelper.h; sourceTree = ""; }; 35 | 5A74B3801E28ACE3000D51D1 /* LoadMaskHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoadMaskHelper.m; sourceTree = ""; }; 36 | 5A74B3861E28B28D000D51D1 /* UIView+SetRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+SetRect.h"; sourceTree = ""; }; 37 | 5A74B3871E28B28D000D51D1 /* UIView+SetRect.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+SetRect.m"; sourceTree = ""; }; 38 | /* End PBXFileReference section */ 39 | 40 | /* Begin PBXFrameworksBuildPhase section */ 41 | 5A74B3601E28AB72000D51D1 /* Frameworks */ = { 42 | isa = PBXFrameworksBuildPhase; 43 | buildActionMask = 2147483647; 44 | files = ( 45 | ); 46 | runOnlyForDeploymentPostprocessing = 0; 47 | }; 48 | /* End PBXFrameworksBuildPhase section */ 49 | 50 | /* Begin PBXGroup section */ 51 | 5A74B35A1E28AB72000D51D1 = { 52 | isa = PBXGroup; 53 | children = ( 54 | 5A74B3651E28AB72000D51D1 /* SingleMask */, 55 | 5A74B3641E28AB72000D51D1 /* Products */, 56 | ); 57 | sourceTree = ""; 58 | }; 59 | 5A74B3641E28AB72000D51D1 /* Products */ = { 60 | isa = PBXGroup; 61 | children = ( 62 | 5A74B3631E28AB72000D51D1 /* SingleMask.app */, 63 | ); 64 | name = Products; 65 | sourceTree = ""; 66 | }; 67 | 5A74B3651E28AB72000D51D1 /* SingleMask */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 5A74B3851E28B252000D51D1 /* Tools */, 71 | 5A74B3841E28AFEF000D51D1 /* 蒙版逻辑展示 */, 72 | 5A74B3831E28AFDF000D51D1 /* 蒙版实现 */, 73 | 5A74B3691E28AB72000D51D1 /* AppDelegate.h */, 74 | 5A74B36A1E28AB72000D51D1 /* AppDelegate.m */, 75 | 5A74B36C1E28AB72000D51D1 /* ViewController.h */, 76 | 5A74B36D1E28AB72000D51D1 /* ViewController.m */, 77 | 5A74B36F1E28AB72000D51D1 /* Main.storyboard */, 78 | 5A74B3721E28AB72000D51D1 /* Assets.xcassets */, 79 | 5A74B3741E28AB72000D51D1 /* LaunchScreen.storyboard */, 80 | 5A74B3771E28AB72000D51D1 /* Info.plist */, 81 | 5A74B3661E28AB72000D51D1 /* Supporting Files */, 82 | ); 83 | path = SingleMask; 84 | sourceTree = ""; 85 | }; 86 | 5A74B3661E28AB72000D51D1 /* Supporting Files */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 5A74B3671E28AB72000D51D1 /* main.m */, 90 | ); 91 | name = "Supporting Files"; 92 | sourceTree = ""; 93 | }; 94 | 5A74B3831E28AFDF000D51D1 /* 蒙版实现 */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 5A74B37D1E28ACE3000D51D1 /* SingleMaskView.h */, 98 | 5A74B37E1E28ACE3000D51D1 /* SingleMaskView.m */, 99 | ); 100 | name = "蒙版实现"; 101 | sourceTree = ""; 102 | }; 103 | 5A74B3841E28AFEF000D51D1 /* 蒙版逻辑展示 */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 5A74B37F1E28ACE3000D51D1 /* LoadMaskHelper.h */, 107 | 5A74B3801E28ACE3000D51D1 /* LoadMaskHelper.m */, 108 | ); 109 | name = "蒙版逻辑展示"; 110 | sourceTree = ""; 111 | }; 112 | 5A74B3851E28B252000D51D1 /* Tools */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 5A74B3861E28B28D000D51D1 /* UIView+SetRect.h */, 116 | 5A74B3871E28B28D000D51D1 /* UIView+SetRect.m */, 117 | ); 118 | name = Tools; 119 | sourceTree = ""; 120 | }; 121 | /* End PBXGroup section */ 122 | 123 | /* Begin PBXNativeTarget section */ 124 | 5A74B3621E28AB72000D51D1 /* SingleMask */ = { 125 | isa = PBXNativeTarget; 126 | buildConfigurationList = 5A74B37A1E28AB72000D51D1 /* Build configuration list for PBXNativeTarget "SingleMask" */; 127 | buildPhases = ( 128 | 5A74B35F1E28AB72000D51D1 /* Sources */, 129 | 5A74B3601E28AB72000D51D1 /* Frameworks */, 130 | 5A74B3611E28AB72000D51D1 /* Resources */, 131 | ); 132 | buildRules = ( 133 | ); 134 | dependencies = ( 135 | ); 136 | name = SingleMask; 137 | productName = SingleMask; 138 | productReference = 5A74B3631E28AB72000D51D1 /* SingleMask.app */; 139 | productType = "com.apple.product-type.application"; 140 | }; 141 | /* End PBXNativeTarget section */ 142 | 143 | /* Begin PBXProject section */ 144 | 5A74B35B1E28AB72000D51D1 /* Project object */ = { 145 | isa = PBXProject; 146 | attributes = { 147 | LastUpgradeCheck = 0820; 148 | ORGANIZATIONNAME = "刘成利"; 149 | TargetAttributes = { 150 | 5A74B3621E28AB72000D51D1 = { 151 | CreatedOnToolsVersion = 8.2; 152 | ProvisioningStyle = Automatic; 153 | }; 154 | }; 155 | }; 156 | buildConfigurationList = 5A74B35E1E28AB72000D51D1 /* Build configuration list for PBXProject "SingleMask" */; 157 | compatibilityVersion = "Xcode 3.2"; 158 | developmentRegion = English; 159 | hasScannedForEncodings = 0; 160 | knownRegions = ( 161 | en, 162 | Base, 163 | ); 164 | mainGroup = 5A74B35A1E28AB72000D51D1; 165 | productRefGroup = 5A74B3641E28AB72000D51D1 /* Products */; 166 | projectDirPath = ""; 167 | projectRoot = ""; 168 | targets = ( 169 | 5A74B3621E28AB72000D51D1 /* SingleMask */, 170 | ); 171 | }; 172 | /* End PBXProject section */ 173 | 174 | /* Begin PBXResourcesBuildPhase section */ 175 | 5A74B3611E28AB72000D51D1 /* Resources */ = { 176 | isa = PBXResourcesBuildPhase; 177 | buildActionMask = 2147483647; 178 | files = ( 179 | 5A74B3761E28AB72000D51D1 /* LaunchScreen.storyboard in Resources */, 180 | 5A74B3731E28AB72000D51D1 /* Assets.xcassets in Resources */, 181 | 5A74B3711E28AB72000D51D1 /* Main.storyboard in Resources */, 182 | ); 183 | runOnlyForDeploymentPostprocessing = 0; 184 | }; 185 | /* End PBXResourcesBuildPhase section */ 186 | 187 | /* Begin PBXSourcesBuildPhase section */ 188 | 5A74B35F1E28AB72000D51D1 /* Sources */ = { 189 | isa = PBXSourcesBuildPhase; 190 | buildActionMask = 2147483647; 191 | files = ( 192 | 5A74B3811E28ACE3000D51D1 /* SingleMaskView.m in Sources */, 193 | 5A74B3881E28B28D000D51D1 /* UIView+SetRect.m in Sources */, 194 | 5A74B36E1E28AB72000D51D1 /* ViewController.m in Sources */, 195 | 5A74B3821E28ACE3000D51D1 /* LoadMaskHelper.m in Sources */, 196 | 5A74B36B1E28AB72000D51D1 /* AppDelegate.m in Sources */, 197 | 5A74B3681E28AB72000D51D1 /* main.m in Sources */, 198 | ); 199 | runOnlyForDeploymentPostprocessing = 0; 200 | }; 201 | /* End PBXSourcesBuildPhase section */ 202 | 203 | /* Begin PBXVariantGroup section */ 204 | 5A74B36F1E28AB72000D51D1 /* Main.storyboard */ = { 205 | isa = PBXVariantGroup; 206 | children = ( 207 | 5A74B3701E28AB72000D51D1 /* Base */, 208 | ); 209 | name = Main.storyboard; 210 | sourceTree = ""; 211 | }; 212 | 5A74B3741E28AB72000D51D1 /* LaunchScreen.storyboard */ = { 213 | isa = PBXVariantGroup; 214 | children = ( 215 | 5A74B3751E28AB72000D51D1 /* Base */, 216 | ); 217 | name = LaunchScreen.storyboard; 218 | sourceTree = ""; 219 | }; 220 | /* End PBXVariantGroup section */ 221 | 222 | /* Begin XCBuildConfiguration section */ 223 | 5A74B3781E28AB72000D51D1 /* Debug */ = { 224 | isa = XCBuildConfiguration; 225 | buildSettings = { 226 | ALWAYS_SEARCH_USER_PATHS = NO; 227 | CLANG_ANALYZER_NONNULL = YES; 228 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 229 | CLANG_CXX_LIBRARY = "libc++"; 230 | CLANG_ENABLE_MODULES = YES; 231 | CLANG_ENABLE_OBJC_ARC = YES; 232 | CLANG_WARN_BOOL_CONVERSION = YES; 233 | CLANG_WARN_CONSTANT_CONVERSION = YES; 234 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 235 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 236 | CLANG_WARN_EMPTY_BODY = YES; 237 | CLANG_WARN_ENUM_CONVERSION = YES; 238 | CLANG_WARN_INFINITE_RECURSION = YES; 239 | CLANG_WARN_INT_CONVERSION = YES; 240 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 241 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 242 | CLANG_WARN_UNREACHABLE_CODE = YES; 243 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 244 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 245 | COPY_PHASE_STRIP = NO; 246 | DEBUG_INFORMATION_FORMAT = dwarf; 247 | ENABLE_STRICT_OBJC_MSGSEND = YES; 248 | ENABLE_TESTABILITY = YES; 249 | GCC_C_LANGUAGE_STANDARD = gnu99; 250 | GCC_DYNAMIC_NO_PIC = NO; 251 | GCC_NO_COMMON_BLOCKS = YES; 252 | GCC_OPTIMIZATION_LEVEL = 0; 253 | GCC_PREPROCESSOR_DEFINITIONS = ( 254 | "DEBUG=1", 255 | "$(inherited)", 256 | ); 257 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 258 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 259 | GCC_WARN_UNDECLARED_SELECTOR = YES; 260 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 261 | GCC_WARN_UNUSED_FUNCTION = YES; 262 | GCC_WARN_UNUSED_VARIABLE = YES; 263 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 264 | MTL_ENABLE_DEBUG_INFO = YES; 265 | ONLY_ACTIVE_ARCH = YES; 266 | SDKROOT = iphoneos; 267 | }; 268 | name = Debug; 269 | }; 270 | 5A74B3791E28AB72000D51D1 /* Release */ = { 271 | isa = XCBuildConfiguration; 272 | buildSettings = { 273 | ALWAYS_SEARCH_USER_PATHS = NO; 274 | CLANG_ANALYZER_NONNULL = YES; 275 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 276 | CLANG_CXX_LIBRARY = "libc++"; 277 | CLANG_ENABLE_MODULES = YES; 278 | CLANG_ENABLE_OBJC_ARC = YES; 279 | CLANG_WARN_BOOL_CONVERSION = YES; 280 | CLANG_WARN_CONSTANT_CONVERSION = YES; 281 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 282 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 283 | CLANG_WARN_EMPTY_BODY = YES; 284 | CLANG_WARN_ENUM_CONVERSION = YES; 285 | CLANG_WARN_INFINITE_RECURSION = YES; 286 | CLANG_WARN_INT_CONVERSION = YES; 287 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 288 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 289 | CLANG_WARN_UNREACHABLE_CODE = YES; 290 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 291 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 292 | COPY_PHASE_STRIP = NO; 293 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 294 | ENABLE_NS_ASSERTIONS = NO; 295 | ENABLE_STRICT_OBJC_MSGSEND = YES; 296 | GCC_C_LANGUAGE_STANDARD = gnu99; 297 | GCC_NO_COMMON_BLOCKS = YES; 298 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 299 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 300 | GCC_WARN_UNDECLARED_SELECTOR = YES; 301 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 302 | GCC_WARN_UNUSED_FUNCTION = YES; 303 | GCC_WARN_UNUSED_VARIABLE = YES; 304 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 305 | MTL_ENABLE_DEBUG_INFO = NO; 306 | SDKROOT = iphoneos; 307 | VALIDATE_PRODUCT = YES; 308 | }; 309 | name = Release; 310 | }; 311 | 5A74B37B1E28AB72000D51D1 /* Debug */ = { 312 | isa = XCBuildConfiguration; 313 | buildSettings = { 314 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 315 | INFOPLIST_FILE = SingleMask/Info.plist; 316 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 317 | PRODUCT_BUNDLE_IDENTIFIER = liuhcengli.SingleMask; 318 | PRODUCT_NAME = "$(TARGET_NAME)"; 319 | }; 320 | name = Debug; 321 | }; 322 | 5A74B37C1E28AB72000D51D1 /* Release */ = { 323 | isa = XCBuildConfiguration; 324 | buildSettings = { 325 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 326 | INFOPLIST_FILE = SingleMask/Info.plist; 327 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 328 | PRODUCT_BUNDLE_IDENTIFIER = liuhcengli.SingleMask; 329 | PRODUCT_NAME = "$(TARGET_NAME)"; 330 | }; 331 | name = Release; 332 | }; 333 | /* End XCBuildConfiguration section */ 334 | 335 | /* Begin XCConfigurationList section */ 336 | 5A74B35E1E28AB72000D51D1 /* Build configuration list for PBXProject "SingleMask" */ = { 337 | isa = XCConfigurationList; 338 | buildConfigurations = ( 339 | 5A74B3781E28AB72000D51D1 /* Debug */, 340 | 5A74B3791E28AB72000D51D1 /* Release */, 341 | ); 342 | defaultConfigurationIsVisible = 0; 343 | defaultConfigurationName = Release; 344 | }; 345 | 5A74B37A1E28AB72000D51D1 /* Build configuration list for PBXNativeTarget "SingleMask" */ = { 346 | isa = XCConfigurationList; 347 | buildConfigurations = ( 348 | 5A74B37B1E28AB72000D51D1 /* Debug */, 349 | 5A74B37C1E28AB72000D51D1 /* Release */, 350 | ); 351 | defaultConfigurationIsVisible = 0; 352 | defaultConfigurationName = Release; 353 | }; 354 | /* End XCConfigurationList section */ 355 | }; 356 | rootObject = 5A74B35B1E28AB72000D51D1 /* Project object */; 357 | } 358 | --------------------------------------------------------------------------------