-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
自定义遮罩视图(引导, 功能说明) 主要实现了如下功能: 1. 添加多种样式聚光灯效果。(圆形, 矩形, 圆角矩形, 自定义视图) 2. 点击该区域支持delegate回调 3. UIView 中的控件事件穿透。(demo中的按钮, 是在遮罩层下方, 但是正确响应点击事件, 这就是事件穿透)
- Loading branch information
Showing
6 changed files
with
440 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
HoledViewTest.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Bucket | ||
type = "1" | ||
version = "2.0"> | ||
</Bucket> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// YLZHoledView.h | ||
// HoledViewTest | ||
// | ||
// Created by Colin on 15/4/7. | ||
// Copyright (c) 2015年 icephone. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
typedef NS_ENUM(NSInteger, YLZHoleType) | ||
{ | ||
YLZHoleTypeCirle, | ||
YLZHoleTypeRect, | ||
YLZHoleTypeRoundedRect, | ||
YLZHoleTypeCustomRect | ||
}; | ||
|
||
|
||
@class YLZHoledView; | ||
@protocol YLZHoledViewDelegate <NSObject> | ||
|
||
- (void)holedView:(YLZHoledView *)holedView didSelectHoleAtIndex:(NSUInteger)index; | ||
|
||
@end | ||
|
||
|
||
@interface YLZHoledView : UIView | ||
|
||
@property (strong, nonatomic) UIColor *dimingColor; | ||
@property (weak, nonatomic) id <YLZHoledViewDelegate> holeViewDelegate; | ||
|
||
- (NSInteger)addHoleCircleCenteredOnPosition:(CGPoint)centerPoint andDiameter:(CGFloat)diamter; | ||
- (NSInteger)addHoleRectOnRect:(CGRect)rect; | ||
- (NSInteger)addHoleRoundedRectOnRect:(CGRect)rect withCornerRadius:(CGFloat)cornerRadius; | ||
- (NSInteger)addHCustomView:(UIView *)customView onRect:(CGRect)rect; | ||
|
||
- (void)addFocusView:(UIView *)focus; | ||
|
||
- (void)removeHoles; | ||
|
||
|
||
@end |
Oops, something went wrong.