├── HitTestViewDemo ├── Assets.xcassets │ ├── Contents.json │ ├── The_Martian.imageset │ │ ├── The_Martian@2x.jpg │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── AppDelegate.h ├── main.m ├── Info.plist ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard └── AppDelegate.m ├── HitTestViewDemo.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ ├── Dalong.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── Slemon.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── xcuserdata │ ├── Dalong.xcuserdatad │ │ ├── xcschemes │ │ │ ├── xcschememanagement.plist │ │ │ └── HitTestViewDemo.xcscheme │ │ └── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ └── Slemon.xcuserdatad │ │ ├── xcschemes │ │ ├── xcschememanagement.plist │ │ └── HitTestViewDemo.xcscheme │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist └── project.pbxproj ├── HitTest ├── AView.h ├── BView.h ├── CView.h ├── DView.h ├── EView.h ├── HitTestView.h ├── ForthHitTestView.h ├── ForthViewController.h ├── ThirdViewController.h ├── ViewController.h ├── SecondViewController.h ├── UIButton+HitAreaExpand.h ├── HitTestTool.h ├── HitButton.h ├── HitButton.m ├── HitTestProtocol.h ├── ViewController.m ├── HitTestTool.m ├── HitTestView.m ├── ForthViewController.m ├── ThirdViewController.m ├── DView.m ├── BView.m ├── CView.m ├── EView.m ├── SecondViewController.m ├── AView.m ├── UIButton+HitAreaExpand.m └── ForthHitTestView.m ├── LICENSE.md └── DLHitTest.podspec /HitTestViewDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /HitTestViewDemo/Assets.xcassets/The_Martian.imageset/The_Martian@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slemon/HitTestViewUsage/HEAD/HitTestViewDemo/Assets.xcassets/The_Martian.imageset/The_Martian@2x.jpg -------------------------------------------------------------------------------- /HitTestViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HitTest/AView.h: -------------------------------------------------------------------------------- 1 | // 2 | // AView.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HitTest/BView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BView.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HitTest/CView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CView.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HitTest/DView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DView.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HitTest/EView.h: -------------------------------------------------------------------------------- 1 | // 2 | // EView.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface EView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HitTestViewDemo.xcodeproj/project.xcworkspace/xcuserdata/Dalong.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slemon/HitTestViewUsage/HEAD/HitTestViewDemo.xcodeproj/project.xcworkspace/xcuserdata/Dalong.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /HitTestViewDemo.xcodeproj/project.xcworkspace/xcuserdata/Slemon.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slemon/HitTestViewUsage/HEAD/HitTestViewDemo.xcodeproj/project.xcworkspace/xcuserdata/Slemon.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /HitTest/HitTestView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HitTestView.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/29. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HitTestView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HitTest/ForthHitTestView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ForthHitTestView.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/29. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ForthHitTestView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HitTest/ForthViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ForthViewController.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/29. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ForthViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HitTest/ThirdViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ThirdViewController.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/29. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ThirdViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HitTest/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /HitTest/SecondViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/25. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SecondViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HitTestViewDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. 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 | -------------------------------------------------------------------------------- /HitTest/UIButton+HitAreaExpand.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+HitAreaExpand.h 3 | // HitTestViewDemo 4 | // 5 | // Created by DalongSun on 15/12/8. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIButton (HitAreaExpand) 12 | 13 | @property (nonatomic) CGFloat minHitTestWidth; 14 | @property (nonatomic) CGFloat minHitTestHeight; 15 | 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /HitTestViewDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. 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 | -------------------------------------------------------------------------------- /HitTest/HitTestTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // HitTestTool.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/29. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface HitTestTool : NSObject 13 | 14 | CGRect HitTestingBounds(CGRect bounds, CGFloat minimumHitTestWidth, CGFloat minimumHitTestHeight); 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /HitTest/HitButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // HitButton.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/25. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HitTestProtocol.h" 11 | 12 | @interface HitButton : UIButton 13 | 14 | @property (nonatomic) IBInspectable CGFloat minimumHitTestWidth; 15 | @property (nonatomic) IBInspectable CGFloat minimumHitTestHeight; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /HitTestViewDemo/Assets.xcassets/The_Martian.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "The_Martian@2x.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /HitTest/HitButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // HitButton.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/25. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import "HitButton.h" 10 | #import "HitTestTool.h" 11 | @implementation HitButton 12 | 13 | - (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event { 14 | return CGRectContainsPoint(HitTestingBounds(self.bounds, self.minimumHitTestWidth, self.minimumHitTestHeight), point); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /HitTest/HitTestProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // HitTestProtocol.h 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/29. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol HitTestProtocol 12 | 13 | @required 14 | 15 | @property (nonatomic) IBInspectable CGFloat minimumHitTestWidth; 16 | @property (nonatomic) IBInspectable CGFloat minimumHitTestHeight; 17 | 18 | - (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /HitTest/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /HitTestViewDemo.xcodeproj/xcuserdata/Dalong.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | HitTestViewDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 9FFBEA6D1C04B0EC003BA382 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /HitTestViewDemo.xcodeproj/xcuserdata/Slemon.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | HitTestViewDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 9FFBEA6D1C04B0EC003BA382 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /HitTestViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /HitTest/HitTestTool.m: -------------------------------------------------------------------------------- 1 | // 2 | // HitTestTool.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/29. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import "HitTestTool.h" 10 | 11 | @implementation HitTestTool 12 | 13 | CGRect HitTestingBounds(CGRect bounds, CGFloat minimumHitTestWidth, CGFloat minimumHitTestHeight) { 14 | 15 | CGRect hitTestingBounds = bounds; 16 | 17 | if (minimumHitTestWidth > bounds.size.width) { 18 | hitTestingBounds.size.width = minimumHitTestWidth; 19 | hitTestingBounds.origin.x -= (hitTestingBounds.size.width - bounds.size.width)/2; 20 | } 21 | 22 | if (minimumHitTestHeight > bounds.size.height) { 23 | hitTestingBounds.size.height = minimumHitTestHeight; 24 | hitTestingBounds.origin.y -= (hitTestingBounds.size.height - bounds.size.height)/2; 25 | } 26 | 27 | return hitTestingBounds; 28 | } 29 | 30 | 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /HitTest/HitTestView.m: -------------------------------------------------------------------------------- 1 | // 2 | // HitTestView.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/29. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import "HitTestView.h" 10 | 11 | @implementation HitTestView 12 | 13 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 14 | 15 | if (!self.isUserInteractionEnabled || self.isHidden || self.alpha <= 0.01) { 16 | return nil; 17 | } 18 | /** 19 | * 此注释掉的方法用来判断点击是否在父View Bounds内, 20 | * 如果不在父view内,就会直接不会去其子View中寻找HitTestView,return 返回 21 | */ 22 | // if ([self pointInside:point withEvent:event]) { 23 | for (UIView *subview in [self.subviews reverseObjectEnumerator]) { 24 | CGPoint convertedPoint = [subview convertPoint:point fromView:self]; 25 | UIView *hitTestView = [subview hitTest:convertedPoint withEvent:event]; 26 | if (hitTestView) { 27 | return hitTestView; 28 | } 29 | } 30 | return self; 31 | // } 32 | return nil; 33 | } 34 | 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /HitTest/ForthViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ForthViewController.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/29. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import "ForthViewController.h" 10 | 11 | @interface ForthViewController () 12 | 13 | @end 14 | 15 | @implementation ForthViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | 21 | [self setAutomaticallyAdjustsScrollViewInsets:NO]; 22 | } 23 | 24 | - (void)didReceiveMemoryWarning { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | /* 30 | #pragma mark - Navigation 31 | 32 | // In a storyboard-based application, you will often want to do a little preparation before navigation 33 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 34 | // Get the new view controller using [segue destinationViewController]. 35 | // Pass the selected object to the new view controller. 36 | } 37 | */ 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /HitTest/ThirdViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ThirdViewController.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/29. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import "ThirdViewController.h" 10 | 11 | @interface ThirdViewController () 12 | 13 | - (IBAction)buttonAction:(id)sender; 14 | 15 | @end 16 | 17 | @implementation ThirdViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view. 22 | } 23 | 24 | - (void)didReceiveMemoryWarning { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | /* 30 | #pragma mark - Navigation 31 | 32 | // In a storyboard-based application, you will often want to do a little preparation before navigation 33 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 34 | // Get the new view controller using [segue destinationViewController]. 35 | // Pass the selected object to the new view controller. 36 | } 37 | */ 38 | 39 | - (IBAction)buttonAction:(id)sender { 40 | 41 | 42 | } 43 | @end 44 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Lemon Sun 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 | -------------------------------------------------------------------------------- /HitTest/DView.m: -------------------------------------------------------------------------------- 1 | // 2 | // DView.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import "DView.h" 10 | 11 | @implementation DView 12 | 13 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 14 | NSLog(@"进入D_View---hitTest withEvent ---"); 15 | UIView * view = [super hitTest:point withEvent:event]; 16 | NSLog(@"离开D_View---hitTest withEvent ---hitTestView:%@",view); 17 | return view; 18 | } 19 | 20 | - (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event { 21 | NSLog(@"D_view---pointInside withEvent ---"); 22 | BOOL isInside = [super pointInside:point withEvent:event]; 23 | NSLog(@"D_view---pointInside withEvent --- isInside:%d",isInside); 24 | return isInside; 25 | } 26 | 27 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 28 | { 29 | NSLog(@"D_touchesBegan"); 30 | } 31 | 32 | - (void)touchesMoved:(NSSet *)touches withEvent:(nullable UIEvent *)event { 33 | NSLog(@"D_touchesMoved"); 34 | } 35 | 36 | - (void)touchesEnded:(NSSet *)touches withEvent:(nullable UIEvent *)event { 37 | NSLog(@"D_touchesEnded"); 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /HitTest/BView.m: -------------------------------------------------------------------------------- 1 | // 2 | // BView.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import "BView.h" 10 | 11 | @implementation BView 12 | 13 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 14 | NSLog(@"进入B_View---hitTest withEvent ---"); 15 | UIView * view = [super hitTest:point withEvent:event]; 16 | NSLog(@"离开B_View---hitTest withEvent ---hitTestView:%@",view); 17 | return view; 18 | } 19 | 20 | - (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event { 21 | NSLog(@"B_view---pointInside withEvent ---"); 22 | BOOL isInside = [super pointInside:point withEvent:event]; 23 | NSLog(@"B_view---pointInside withEvent --- isInside:%d",isInside); 24 | return isInside; 25 | } 26 | 27 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 28 | { 29 | NSLog(@"B_touchesBegan"); 30 | } 31 | 32 | - (void)touchesMoved:(NSSet *)touches withEvent:(nullable UIEvent *)event { 33 | NSLog(@"B_touchesMoved"); 34 | } 35 | 36 | - (void)touchesEnded:(NSSet *)touches withEvent:(nullable UIEvent *)event { 37 | NSLog(@"B_touchesEnded"); 38 | } 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /HitTest/CView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CView.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import "CView.h" 10 | 11 | @implementation CView 12 | 13 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 14 | NSLog(@"进入C_View---hitTest withEvent ---"); 15 | UIView * view = [super hitTest:point withEvent:event]; 16 | NSLog(@"离开C_View---hitTest withEvent ---hitTestView:%@",view); 17 | return view; 18 | } 19 | 20 | - (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event { 21 | NSLog(@"C_view---pointInside withEvent ---"); 22 | BOOL isInside = [super pointInside:point withEvent:event]; 23 | NSLog(@"C_view---pointInside withEvent --- isInside:%d",isInside); 24 | return isInside; 25 | } 26 | 27 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 28 | { 29 | NSLog(@"C_touchesBegan"); 30 | } 31 | 32 | - (void)touchesMoved:(NSSet *)touches withEvent:(nullable UIEvent *)event { 33 | NSLog(@"C_touchesMoved"); 34 | } 35 | 36 | - (void)touchesEnded:(NSSet *)touches withEvent:(nullable UIEvent *)event { 37 | NSLog(@"C_touchesEnded"); 38 | } 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /HitTest/EView.m: -------------------------------------------------------------------------------- 1 | // 2 | // EView.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import "EView.h" 10 | 11 | @implementation EView 12 | 13 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 14 | NSLog(@"进入E_View---hitTest withEvent ---"); 15 | UIView * view = [super hitTest:point withEvent:event]; 16 | NSLog(@"离开E_View---hitTest withEvent ---hitTestView:%@",view); 17 | return view; 18 | } 19 | 20 | - (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event { 21 | NSLog(@"E_view---pointInside withEvent ---"); 22 | BOOL isInside = [super pointInside:point withEvent:event]; 23 | NSLog(@"E_view---pointInside withEvent --- isInside:%d",isInside); 24 | return isInside; 25 | } 26 | 27 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 28 | { 29 | NSLog(@"E_touchesBegan"); 30 | } 31 | 32 | - (void)touchesMoved:(NSSet *)touches withEvent:(nullable UIEvent *)event { 33 | NSLog(@"E_touchesMoved"); 34 | } 35 | 36 | - (void)touchesEnded:(NSSet *)touches withEvent:(nullable UIEvent *)event { 37 | NSLog(@"E_touchesEnded"); 38 | } 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /HitTestViewDemo/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /HitTest/SecondViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/25. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import "SecondViewController.h" 10 | #import "UIButton+HitAreaExpand.h" 11 | 12 | @interface SecondViewController () 13 | 14 | - (IBAction)buttonAction:(id)sender; 15 | 16 | @end 17 | 18 | @implementation SecondViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | // Do any additional setup after loading the view. 23 | 24 | UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom]; 25 | button.frame = CGRectMake(100, 100, 20, 20); 26 | button.backgroundColor = [UIColor yellowColor]; 27 | [button addTarget:self action:@selector(testButtonAction:) forControlEvents:UIControlEventTouchUpInside]; 28 | [self.view addSubview:button]; 29 | 30 | button.minHitTestWidth = 80; 31 | button.minHitTestHeight = 80; 32 | } 33 | 34 | - (void)testButtonAction:(UIButton *)button { 35 | 36 | } 37 | 38 | 39 | - (void)didReceiveMemoryWarning { 40 | [super didReceiveMemoryWarning]; 41 | // Dispose of any resources that can be recreated. 42 | } 43 | 44 | /* 45 | #pragma mark - Navigation 46 | 47 | // In a storyboard-based application, you will often want to do a little preparation before navigation 48 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 49 | // Get the new view controller using [segue destinationViewController]. 50 | // Pass the selected object to the new view controller. 51 | } 52 | */ 53 | 54 | - (IBAction)buttonAction:(id)sender { 55 | NSLog(@"button has been pressed!!!!"); 56 | } 57 | @end 58 | -------------------------------------------------------------------------------- /HitTestViewDemo/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 | -------------------------------------------------------------------------------- /HitTest/AView.m: -------------------------------------------------------------------------------- 1 | // 2 | // AView.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import "AView.h" 10 | 11 | @implementation AView 12 | 13 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 14 | NSLog(@"进入A_View---hitTest withEvent ---"); 15 | UIView * view = [super hitTest:point withEvent:event]; 16 | NSLog(@"离开A_View--- hitTest withEvent ---hitTestView:%@",view); 17 | return view; 18 | } 19 | 20 | - (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event { 21 | NSLog(@"A_view--- pointInside withEvent ---"); 22 | BOOL isInside = [super pointInside:point withEvent:event]; 23 | NSLog(@"A_view--- pointInside withEvent --- isInside:%d",isInside); 24 | return isInside; 25 | } 26 | 27 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 28 | { 29 | NSLog(@"A_touchesBegan"); 30 | } 31 | 32 | - (void)touchesMoved:(NSSet *)touches withEvent:(nullable UIEvent *)event { 33 | NSLog(@"A_touchesMoved"); 34 | } 35 | 36 | - (void)touchesEnded:(NSSet *)touches withEvent:(nullable UIEvent *)event { 37 | NSLog(@"A_touchesEnded"); 38 | } 39 | 40 | //- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 41 | // if (!self.isUserInteractionEnabled || self.isHidden || self.alpha <= 0.01) { 42 | // return nil; 43 | // } 44 | // if ([self pointInside:point withEvent:event]) { 45 | // for (UIView *subview in [self.subviews reverseObjectEnumerator]) { 46 | // CGPoint convertedPoint = [subview convertPoint:point fromView:self]; 47 | // UIView *hitTestView = [subview hitTest:convertedPoint withEvent:event]; 48 | // if (hitTestView) { 49 | // return hitTestView; 50 | // } 51 | // } 52 | // return self; 53 | // } 54 | // return nil; 55 | //} 56 | 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /HitTest/UIButton+HitAreaExpand.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+HitAreaExpand.m 3 | // HitTestViewDemo 4 | // 5 | // Created by DalongSun on 15/12/8. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import "UIButton+HitAreaExpand.h" 10 | #import "HitTestTool.h" 11 | #import 12 | 13 | @implementation UIButton (HitAreaExpand) 14 | //@dynamic minHitTestWidth; 15 | //@dynamic minHitTestHeight; 16 | 17 | - (CGFloat)minHitTestWidth { 18 | NSNumber * width = objc_getAssociatedObject(self, @selector(minHitTestWidth)); 19 | return [width floatValue]; 20 | } 21 | 22 | - (void)setMinHitTestWidth:(CGFloat)minHitTestWidth { 23 | objc_setAssociatedObject(self, @selector(minHitTestWidth), [NSNumber numberWithFloat:minHitTestWidth], OBJC_ASSOCIATION_ASSIGN); 24 | } 25 | 26 | - (CGFloat)minHitTestHeight { 27 | NSNumber * height = objc_getAssociatedObject(self, @selector(minHitTestHeight)); 28 | return [height floatValue]; 29 | } 30 | 31 | - (void)setMinHitTestHeight:(CGFloat)minHitTestHeight { 32 | objc_setAssociatedObject(self, @selector(minHitTestHeight), [NSNumber numberWithFloat:minHitTestHeight], OBJC_ASSOCIATION_ASSIGN); 33 | } 34 | 35 | - (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event { 36 | 37 | return CGRectContainsPoint(HitTestingBounds(self.bounds, self.minHitTestWidth, self.minHitTestHeight), point); 38 | } 39 | 40 | //CGRect HitTestingBounds(CGRect bounds, CGFloat minimumHitTestWidth, CGFloat minimumHitTestHeight) { 41 | // 42 | // CGRect hitTestingBounds = bounds; 43 | // if (minimumHitTestWidth > bounds.size.width) { 44 | // hitTestingBounds.size.width = minimumHitTestWidth; 45 | // hitTestingBounds.origin.x -= (hitTestingBounds.size.width - bounds.size.width)/2; 46 | // } 47 | // if (minimumHitTestHeight > bounds.size.height) { 48 | // hitTestingBounds.size.height = minimumHitTestHeight; 49 | // hitTestingBounds.origin.y -= (hitTestingBounds.size.height - bounds.size.height)/2; 50 | // } 51 | // return hitTestingBounds; 52 | //} 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /HitTestViewDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/24. 6 | // Copyright © 2015年 Lemons. 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 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /HitTestViewDemo.xcodeproj/xcuserdata/Dalong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 38 | 40 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /HitTest/ForthHitTestView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ForthHitTestView.m 3 | // HitTestViewDemo 4 | // 5 | // Created by Slemon on 15/11/29. 6 | // Copyright © 2015年 Lemons. All rights reserved. 7 | // 8 | 9 | #import "ForthHitTestView.h" 10 | 11 | static const NSInteger PosterW = 150; 12 | 13 | @interface ForthHitTestView () 14 | 15 | @property (nonatomic, weak) IBOutlet UIScrollView *scrollView; 16 | 17 | @property (nonatomic, strong) NSMutableArray *posterArray; 18 | 19 | @property (nonatomic, assign) NSInteger centerIndex; 20 | 21 | 22 | @end 23 | 24 | @implementation ForthHitTestView 25 | 26 | - (instancetype)initWithFrame:(CGRect)frame 27 | { 28 | self = [super initWithFrame:frame]; 29 | if (self) { 30 | 31 | 32 | } 33 | return self; 34 | } 35 | 36 | - (void) awakeFromNib 37 | { 38 | [super awakeFromNib]; 39 | 40 | _posterArray = NSMutableArray.new; 41 | 42 | NSInteger posterCount = 10; 43 | CGFloat posterGap = 0; 44 | for (int i = 0; i < posterCount; i ++) { 45 | UIImageView * posterImageView = [[UIImageView alloc] init]; 46 | posterImageView.frame = CGRectMake(i * (PosterW + posterGap), 0, PosterW, CGRectGetHeight(self.scrollView.frame)); 47 | posterImageView.image = [UIImage imageNamed:@"The_Martian"]; 48 | posterImageView.tag = 1000 + i; 49 | [self.scrollView addSubview:posterImageView]; 50 | [_posterArray addObject:posterImageView]; 51 | } 52 | self.scrollView.contentSize = CGSizeMake(posterCount * PosterW +(posterCount - 1) * posterGap, CGRectGetHeight(self.scrollView.frame)); 53 | self.scrollView.pagingEnabled = YES; 54 | self.scrollView.clipsToBounds = NO; 55 | self.scrollView.delegate = self; 56 | 57 | _centerIndex = 0; 58 | UIImageView * centerPoster = _posterArray[_centerIndex]; 59 | centerPoster.transform = CGAffineTransformMakeScale(1.3, 1.3); 60 | [self.scrollView bringSubviewToFront:centerPoster]; 61 | 62 | } 63 | 64 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 65 | 66 | NSInteger contentOffsetX = scrollView.contentOffset.x; 67 | 68 | NSLog(@"---------%ld , -----%ld",contentOffsetX % PosterW ,contentOffsetX/PosterW); 69 | 70 | NSInteger OffsetX = contentOffsetX % PosterW; 71 | 72 | 73 | _centerIndex = contentOffsetX/150; 74 | 75 | NSLog(@"_centerIndex %ld",_centerIndex); 76 | 77 | //中间永远是变小的 78 | UIImageView * centerPoster = _posterArray[_centerIndex]; 79 | CGFloat factor = 1 + ((PosterW - OffsetX) /150.0)*0.3; 80 | centerPoster.transform = CGAffineTransformMakeScale(factor, factor); 81 | NSLog(@"centerPoster %ld",centerPoster.tag); 82 | [self.scrollView bringSubviewToFront:centerPoster]; 83 | 84 | if (_centerIndex - 1 > 0 && _centerIndex - 1 < [_posterArray count]) { 85 | 86 | UIImageView * leftPoster = _posterArray[_centerIndex - 1]; 87 | 88 | NSLog(@"leftPoster %ld",leftPoster.tag); 89 | 90 | } 91 | 92 | if (_centerIndex + 1 < [_posterArray count]) { 93 | 94 | UIImageView * rightPoster = _posterArray[_centerIndex + 1]; 95 | 96 | NSLog(@"rightPoster %ld",rightPoster.tag); 97 | 98 | CGFloat factor = 1 + (OffsetX /150.0)*0.3; 99 | rightPoster.transform = CGAffineTransformMakeScale(factor, factor); 100 | 101 | } 102 | } 103 | 104 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 105 | 106 | UIView *hitTestView = [super hitTest:point withEvent:event]; 107 | if (hitTestView) { 108 | hitTestView = self.scrollView; 109 | } 110 | return hitTestView; 111 | } 112 | 113 | @end 114 | -------------------------------------------------------------------------------- /HitTestViewDemo.xcodeproj/xcuserdata/Dalong.xcuserdatad/xcschemes/HitTestViewDemo.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 | -------------------------------------------------------------------------------- /HitTestViewDemo.xcodeproj/xcuserdata/Slemon.xcuserdatad/xcschemes/HitTestViewDemo.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 | -------------------------------------------------------------------------------- /HitTestViewDemo.xcodeproj/xcuserdata/Slemon.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 38 | 40 | 52 | 53 | 54 | 56 | 68 | 69 | 70 | 72 | 84 | 85 | 86 | 88 | 100 | 101 | 102 | 104 | 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /DLHitTest.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint DLHitTest.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 12 | # 13 | # These will help people to find your library, and whilst it 14 | # can feel like a chore to fill in it's definitely to your advantage. The 15 | # summary should be tweet-length, and the description more in depth. 16 | # 17 | 18 | s.name = "DLHitTest" 19 | s.version = "0.0.1" 20 | s.summary = "A short description of DLHitTest." 21 | 22 | # This description is used to generate tags and improve search results. 23 | # * Think: What does it do? Why did you write it? What is the focus? 24 | # * Try to keep it short, snappy and to the point. 25 | # * Write the description between the DESC delimiters below. 26 | # * Finally, don't worry about the indent, CocoaPods strips it! 27 | s.description = "Just for Test" 28 | s.homepage = "http://blog.dalong.com" 29 | # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" 30 | 31 | 32 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 33 | # 34 | # Licensing your code is important. See http://choosealicense.com for more info. 35 | # CocoaPods will detect a license file if there is a named LICENSE* 36 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. 37 | # 38 | 39 | # s.license = "MIT" 40 | # s.license = { :type => "MIT", :file => "FILE_LICENSE" } 41 | 42 | 43 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 44 | # 45 | # Specify the authors of the library, with email addresses. Email addresses 46 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also 47 | # accepts just a name if you'd rather not provide an email address. 48 | # 49 | # Specify a social_media_url where others can refer to, for example a twitter 50 | # profile URL. 51 | # 52 | 53 | s.author = { "Dalong" => "sunyl1990@qq.com" } 54 | # Or just: s.author = "Dalong" 55 | # s.authors = { "Dalong" => "sunyl1990@qq.com" } 56 | # s.social_media_url = "http://twitter.com/Dalong" 57 | 58 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 59 | # 60 | # If this Pod runs only on iOS or OS X, then specify the platform and 61 | # the deployment target. You can optionally include the target after the platform. 62 | # 63 | 64 | # s.platform = :ios 65 | s.platform = :ios, "8.0" 66 | 67 | # When using multiple platforms 68 | # s.ios.deployment_target = "5.0" 69 | # s.osx.deployment_target = "10.7" 70 | # s.watchos.deployment_target = "2.0" 71 | # s.tvos.deployment_target = "9.0" 72 | 73 | 74 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 75 | # 76 | # Specify the location from where the source should be retrieved. 77 | # Supports git, hg, bzr, svn and HTTP. 78 | # 79 | 80 | s.source = { :git => "https://github.com/slemon/HitTestViewUsage.git", :tag => "0.0.1" } 81 | 82 | 83 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 84 | # 85 | # CocoaPods is smart about how it includes source code. For source files 86 | # giving a folder will include any swift, h, m, mm, c & cpp files. 87 | # For header files it will include any header in the folder. 88 | # Not including the public_header_files will make all headers public. 89 | # 90 | 91 | s.source_files = "HitTest", "HitTest/**/*.{h,m}" 92 | # s.exclude_files = "HitTest/Exclude" 93 | 94 | # s.public_header_files = "Classes/**/*.h" 95 | 96 | 97 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 98 | # 99 | # A list of resources included with the Pod. These are copied into the 100 | # target bundle with a build phase script. Anything else will be cleaned. 101 | # You can preserve files from being cleaned, please don't preserve 102 | # non-essential files like tests, examples and documentation. 103 | # 104 | 105 | # s.resource = "icon.png" 106 | # s.resources = "Resources/*.png" 107 | 108 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 109 | 110 | 111 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 112 | # 113 | # Link your library with frameworks, or libraries. Libraries do not include 114 | # the lib prefix of their name. 115 | # 116 | 117 | # s.framework = "SomeFramework" 118 | # s.frameworks = "SomeFramework", "AnotherFramework" 119 | 120 | # s.library = "iconv" 121 | # s.libraries = "iconv", "xml2" 122 | 123 | 124 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 125 | # 126 | # If your library depends on compiler flags you can set them in the xcconfig hash 127 | # where they will only apply to your library. If you depend on other Podspecs 128 | # you can include multiple dependencies to ensure it works. 129 | 130 | # s.requires_arc = true 131 | 132 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 133 | # s.dependency "JSONKit", "~> 1.4" 134 | 135 | end 136 | -------------------------------------------------------------------------------- /HitTestViewDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9FFBEA731C04B0EC003BA382 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FFBEA721C04B0EC003BA382 /* main.m */; }; 11 | 9FFBEA761C04B0EC003BA382 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FFBEA751C04B0EC003BA382 /* AppDelegate.m */; }; 12 | 9FFBEA7C1C04B0EC003BA382 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9FFBEA7A1C04B0EC003BA382 /* Main.storyboard */; }; 13 | 9FFBEA7E1C04B0EC003BA382 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9FFBEA7D1C04B0EC003BA382 /* Assets.xcassets */; }; 14 | 9FFBEA811C04B0EC003BA382 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9FFBEA7F1C04B0EC003BA382 /* LaunchScreen.storyboard */; }; 15 | F464B41D1C7D556400371330 /* AView.m in Sources */ = {isa = PBXBuildFile; fileRef = F464B4011C7D556400371330 /* AView.m */; }; 16 | F464B41E1C7D556400371330 /* BView.m in Sources */ = {isa = PBXBuildFile; fileRef = F464B4031C7D556400371330 /* BView.m */; }; 17 | F464B41F1C7D556400371330 /* CView.m in Sources */ = {isa = PBXBuildFile; fileRef = F464B4051C7D556400371330 /* CView.m */; }; 18 | F464B4201C7D556400371330 /* DView.m in Sources */ = {isa = PBXBuildFile; fileRef = F464B4071C7D556400371330 /* DView.m */; }; 19 | F464B4211C7D556400371330 /* EView.m in Sources */ = {isa = PBXBuildFile; fileRef = F464B4091C7D556400371330 /* EView.m */; }; 20 | F464B4221C7D556400371330 /* ForthHitTestView.m in Sources */ = {isa = PBXBuildFile; fileRef = F464B40B1C7D556400371330 /* ForthHitTestView.m */; }; 21 | F464B4231C7D556400371330 /* ForthViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F464B40D1C7D556400371330 /* ForthViewController.m */; }; 22 | F464B4241C7D556400371330 /* HitButton.m in Sources */ = {isa = PBXBuildFile; fileRef = F464B40F1C7D556400371330 /* HitButton.m */; }; 23 | F464B4251C7D556400371330 /* HitTestTool.m in Sources */ = {isa = PBXBuildFile; fileRef = F464B4121C7D556400371330 /* HitTestTool.m */; }; 24 | F464B4261C7D556400371330 /* HitTestView.m in Sources */ = {isa = PBXBuildFile; fileRef = F464B4141C7D556400371330 /* HitTestView.m */; }; 25 | F464B4271C7D556400371330 /* SecondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F464B4161C7D556400371330 /* SecondViewController.m */; }; 26 | F464B4281C7D556400371330 /* ThirdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F464B4181C7D556400371330 /* ThirdViewController.m */; }; 27 | F464B4291C7D556400371330 /* UIButton+HitAreaExpand.m in Sources */ = {isa = PBXBuildFile; fileRef = F464B41A1C7D556400371330 /* UIButton+HitAreaExpand.m */; }; 28 | F464B42A1C7D556400371330 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F464B41C1C7D556400371330 /* ViewController.m */; }; 29 | /* End PBXBuildFile section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 9FFBEA6E1C04B0EC003BA382 /* HitTestViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HitTestViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 9FFBEA721C04B0EC003BA382 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 34 | 9FFBEA741C04B0EC003BA382 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 35 | 9FFBEA751C04B0EC003BA382 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 36 | 9FFBEA7B1C04B0EC003BA382 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 37 | 9FFBEA7D1C04B0EC003BA382 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 38 | 9FFBEA801C04B0EC003BA382 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 39 | 9FFBEA821C04B0EC003BA382 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 40 | F464B4001C7D556400371330 /* AView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AView.h; sourceTree = ""; }; 41 | F464B4011C7D556400371330 /* AView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AView.m; sourceTree = ""; }; 42 | F464B4021C7D556400371330 /* BView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BView.h; sourceTree = ""; }; 43 | F464B4031C7D556400371330 /* BView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BView.m; sourceTree = ""; }; 44 | F464B4041C7D556400371330 /* CView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CView.h; sourceTree = ""; }; 45 | F464B4051C7D556400371330 /* CView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CView.m; sourceTree = ""; }; 46 | F464B4061C7D556400371330 /* DView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DView.h; sourceTree = ""; }; 47 | F464B4071C7D556400371330 /* DView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DView.m; sourceTree = ""; }; 48 | F464B4081C7D556400371330 /* EView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EView.h; sourceTree = ""; }; 49 | F464B4091C7D556400371330 /* EView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EView.m; sourceTree = ""; }; 50 | F464B40A1C7D556400371330 /* ForthHitTestView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForthHitTestView.h; sourceTree = ""; }; 51 | F464B40B1C7D556400371330 /* ForthHitTestView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ForthHitTestView.m; sourceTree = ""; }; 52 | F464B40C1C7D556400371330 /* ForthViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForthViewController.h; sourceTree = ""; }; 53 | F464B40D1C7D556400371330 /* ForthViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ForthViewController.m; sourceTree = ""; }; 54 | F464B40E1C7D556400371330 /* HitButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HitButton.h; sourceTree = ""; }; 55 | F464B40F1C7D556400371330 /* HitButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HitButton.m; sourceTree = ""; }; 56 | F464B4101C7D556400371330 /* HitTestProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HitTestProtocol.h; sourceTree = ""; }; 57 | F464B4111C7D556400371330 /* HitTestTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HitTestTool.h; sourceTree = ""; }; 58 | F464B4121C7D556400371330 /* HitTestTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HitTestTool.m; sourceTree = ""; }; 59 | F464B4131C7D556400371330 /* HitTestView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HitTestView.h; sourceTree = ""; }; 60 | F464B4141C7D556400371330 /* HitTestView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HitTestView.m; sourceTree = ""; }; 61 | F464B4151C7D556400371330 /* SecondViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecondViewController.h; sourceTree = ""; }; 62 | F464B4161C7D556400371330 /* SecondViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecondViewController.m; sourceTree = ""; }; 63 | F464B4171C7D556400371330 /* ThirdViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThirdViewController.h; sourceTree = ""; }; 64 | F464B4181C7D556400371330 /* ThirdViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThirdViewController.m; sourceTree = ""; }; 65 | F464B4191C7D556400371330 /* UIButton+HitAreaExpand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+HitAreaExpand.h"; sourceTree = ""; }; 66 | F464B41A1C7D556400371330 /* UIButton+HitAreaExpand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+HitAreaExpand.m"; sourceTree = ""; }; 67 | F464B41B1C7D556400371330 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 68 | F464B41C1C7D556400371330 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 69 | /* End PBXFileReference section */ 70 | 71 | /* Begin PBXFrameworksBuildPhase section */ 72 | 9FFBEA6B1C04B0EC003BA382 /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | /* End PBXFrameworksBuildPhase section */ 80 | 81 | /* Begin PBXGroup section */ 82 | 9FFBEA651C04B0EC003BA382 = { 83 | isa = PBXGroup; 84 | children = ( 85 | 9FFBEA701C04B0EC003BA382 /* HitTestViewDemo */, 86 | 9FFBEA6F1C04B0EC003BA382 /* Products */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | 9FFBEA6F1C04B0EC003BA382 /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 9FFBEA6E1C04B0EC003BA382 /* HitTestViewDemo.app */, 94 | ); 95 | name = Products; 96 | sourceTree = ""; 97 | }; 98 | 9FFBEA701C04B0EC003BA382 /* HitTestViewDemo */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | F464B3FF1C7D556400371330 /* HitTest */, 102 | 9FFBEA741C04B0EC003BA382 /* AppDelegate.h */, 103 | 9FFBEA751C04B0EC003BA382 /* AppDelegate.m */, 104 | 9FFBEA7A1C04B0EC003BA382 /* Main.storyboard */, 105 | 9FFBEA7D1C04B0EC003BA382 /* Assets.xcassets */, 106 | 9FFBEA7F1C04B0EC003BA382 /* LaunchScreen.storyboard */, 107 | 9FFBEA821C04B0EC003BA382 /* Info.plist */, 108 | 9FFBEA711C04B0EC003BA382 /* Supporting Files */, 109 | ); 110 | path = HitTestViewDemo; 111 | sourceTree = ""; 112 | }; 113 | 9FFBEA711C04B0EC003BA382 /* Supporting Files */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 9FFBEA721C04B0EC003BA382 /* main.m */, 117 | ); 118 | name = "Supporting Files"; 119 | sourceTree = ""; 120 | }; 121 | F464B3FF1C7D556400371330 /* HitTest */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | F464B4001C7D556400371330 /* AView.h */, 125 | F464B4011C7D556400371330 /* AView.m */, 126 | F464B4021C7D556400371330 /* BView.h */, 127 | F464B4031C7D556400371330 /* BView.m */, 128 | F464B4041C7D556400371330 /* CView.h */, 129 | F464B4051C7D556400371330 /* CView.m */, 130 | F464B4061C7D556400371330 /* DView.h */, 131 | F464B4071C7D556400371330 /* DView.m */, 132 | F464B4081C7D556400371330 /* EView.h */, 133 | F464B4091C7D556400371330 /* EView.m */, 134 | F464B40A1C7D556400371330 /* ForthHitTestView.h */, 135 | F464B40B1C7D556400371330 /* ForthHitTestView.m */, 136 | F464B40C1C7D556400371330 /* ForthViewController.h */, 137 | F464B40D1C7D556400371330 /* ForthViewController.m */, 138 | F464B40E1C7D556400371330 /* HitButton.h */, 139 | F464B40F1C7D556400371330 /* HitButton.m */, 140 | F464B4101C7D556400371330 /* HitTestProtocol.h */, 141 | F464B4111C7D556400371330 /* HitTestTool.h */, 142 | F464B4121C7D556400371330 /* HitTestTool.m */, 143 | F464B4131C7D556400371330 /* HitTestView.h */, 144 | F464B4141C7D556400371330 /* HitTestView.m */, 145 | F464B4151C7D556400371330 /* SecondViewController.h */, 146 | F464B4161C7D556400371330 /* SecondViewController.m */, 147 | F464B4171C7D556400371330 /* ThirdViewController.h */, 148 | F464B4181C7D556400371330 /* ThirdViewController.m */, 149 | F464B4191C7D556400371330 /* UIButton+HitAreaExpand.h */, 150 | F464B41A1C7D556400371330 /* UIButton+HitAreaExpand.m */, 151 | F464B41B1C7D556400371330 /* ViewController.h */, 152 | F464B41C1C7D556400371330 /* ViewController.m */, 153 | ); 154 | path = HitTest; 155 | sourceTree = SOURCE_ROOT; 156 | }; 157 | /* End PBXGroup section */ 158 | 159 | /* Begin PBXNativeTarget section */ 160 | 9FFBEA6D1C04B0EC003BA382 /* HitTestViewDemo */ = { 161 | isa = PBXNativeTarget; 162 | buildConfigurationList = 9FFBEA851C04B0EC003BA382 /* Build configuration list for PBXNativeTarget "HitTestViewDemo" */; 163 | buildPhases = ( 164 | 9FFBEA6A1C04B0EC003BA382 /* Sources */, 165 | 9FFBEA6B1C04B0EC003BA382 /* Frameworks */, 166 | 9FFBEA6C1C04B0EC003BA382 /* Resources */, 167 | ); 168 | buildRules = ( 169 | ); 170 | dependencies = ( 171 | ); 172 | name = HitTestViewDemo; 173 | productName = HitTestViewDemo; 174 | productReference = 9FFBEA6E1C04B0EC003BA382 /* HitTestViewDemo.app */; 175 | productType = "com.apple.product-type.application"; 176 | }; 177 | /* End PBXNativeTarget section */ 178 | 179 | /* Begin PBXProject section */ 180 | 9FFBEA661C04B0EC003BA382 /* Project object */ = { 181 | isa = PBXProject; 182 | attributes = { 183 | LastUpgradeCheck = 0710; 184 | ORGANIZATIONNAME = Lemons; 185 | TargetAttributes = { 186 | 9FFBEA6D1C04B0EC003BA382 = { 187 | CreatedOnToolsVersion = 7.1; 188 | }; 189 | }; 190 | }; 191 | buildConfigurationList = 9FFBEA691C04B0EC003BA382 /* Build configuration list for PBXProject "HitTestViewDemo" */; 192 | compatibilityVersion = "Xcode 3.2"; 193 | developmentRegion = English; 194 | hasScannedForEncodings = 0; 195 | knownRegions = ( 196 | en, 197 | Base, 198 | ); 199 | mainGroup = 9FFBEA651C04B0EC003BA382; 200 | productRefGroup = 9FFBEA6F1C04B0EC003BA382 /* Products */; 201 | projectDirPath = ""; 202 | projectRoot = ""; 203 | targets = ( 204 | 9FFBEA6D1C04B0EC003BA382 /* HitTestViewDemo */, 205 | ); 206 | }; 207 | /* End PBXProject section */ 208 | 209 | /* Begin PBXResourcesBuildPhase section */ 210 | 9FFBEA6C1C04B0EC003BA382 /* Resources */ = { 211 | isa = PBXResourcesBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | 9FFBEA811C04B0EC003BA382 /* LaunchScreen.storyboard in Resources */, 215 | 9FFBEA7E1C04B0EC003BA382 /* Assets.xcassets in Resources */, 216 | 9FFBEA7C1C04B0EC003BA382 /* Main.storyboard in Resources */, 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXResourcesBuildPhase section */ 221 | 222 | /* Begin PBXSourcesBuildPhase section */ 223 | 9FFBEA6A1C04B0EC003BA382 /* Sources */ = { 224 | isa = PBXSourcesBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | F464B4221C7D556400371330 /* ForthHitTestView.m in Sources */, 228 | F464B4271C7D556400371330 /* SecondViewController.m in Sources */, 229 | F464B41F1C7D556400371330 /* CView.m in Sources */, 230 | F464B4231C7D556400371330 /* ForthViewController.m in Sources */, 231 | F464B4241C7D556400371330 /* HitButton.m in Sources */, 232 | F464B4211C7D556400371330 /* EView.m in Sources */, 233 | F464B4281C7D556400371330 /* ThirdViewController.m in Sources */, 234 | F464B4291C7D556400371330 /* UIButton+HitAreaExpand.m in Sources */, 235 | F464B4251C7D556400371330 /* HitTestTool.m in Sources */, 236 | F464B41D1C7D556400371330 /* AView.m in Sources */, 237 | F464B42A1C7D556400371330 /* ViewController.m in Sources */, 238 | 9FFBEA761C04B0EC003BA382 /* AppDelegate.m in Sources */, 239 | F464B4261C7D556400371330 /* HitTestView.m in Sources */, 240 | F464B4201C7D556400371330 /* DView.m in Sources */, 241 | 9FFBEA731C04B0EC003BA382 /* main.m in Sources */, 242 | F464B41E1C7D556400371330 /* BView.m in Sources */, 243 | ); 244 | runOnlyForDeploymentPostprocessing = 0; 245 | }; 246 | /* End PBXSourcesBuildPhase section */ 247 | 248 | /* Begin PBXVariantGroup section */ 249 | 9FFBEA7A1C04B0EC003BA382 /* Main.storyboard */ = { 250 | isa = PBXVariantGroup; 251 | children = ( 252 | 9FFBEA7B1C04B0EC003BA382 /* Base */, 253 | ); 254 | name = Main.storyboard; 255 | sourceTree = ""; 256 | }; 257 | 9FFBEA7F1C04B0EC003BA382 /* LaunchScreen.storyboard */ = { 258 | isa = PBXVariantGroup; 259 | children = ( 260 | 9FFBEA801C04B0EC003BA382 /* Base */, 261 | ); 262 | name = LaunchScreen.storyboard; 263 | sourceTree = ""; 264 | }; 265 | /* End PBXVariantGroup section */ 266 | 267 | /* Begin XCBuildConfiguration section */ 268 | 9FFBEA831C04B0EC003BA382 /* Debug */ = { 269 | isa = XCBuildConfiguration; 270 | buildSettings = { 271 | ALWAYS_SEARCH_USER_PATHS = NO; 272 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 273 | CLANG_CXX_LIBRARY = "libc++"; 274 | CLANG_ENABLE_MODULES = YES; 275 | CLANG_ENABLE_OBJC_ARC = YES; 276 | CLANG_WARN_BOOL_CONVERSION = YES; 277 | CLANG_WARN_CONSTANT_CONVERSION = YES; 278 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 279 | CLANG_WARN_EMPTY_BODY = YES; 280 | CLANG_WARN_ENUM_CONVERSION = YES; 281 | CLANG_WARN_INT_CONVERSION = YES; 282 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 283 | CLANG_WARN_UNREACHABLE_CODE = YES; 284 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 285 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 286 | COPY_PHASE_STRIP = NO; 287 | DEBUG_INFORMATION_FORMAT = dwarf; 288 | ENABLE_STRICT_OBJC_MSGSEND = YES; 289 | ENABLE_TESTABILITY = YES; 290 | GCC_C_LANGUAGE_STANDARD = gnu99; 291 | GCC_DYNAMIC_NO_PIC = NO; 292 | GCC_NO_COMMON_BLOCKS = YES; 293 | GCC_OPTIMIZATION_LEVEL = 0; 294 | GCC_PREPROCESSOR_DEFINITIONS = ( 295 | "DEBUG=1", 296 | "$(inherited)", 297 | ); 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 = 9.1; 305 | MTL_ENABLE_DEBUG_INFO = YES; 306 | ONLY_ACTIVE_ARCH = YES; 307 | SDKROOT = iphoneos; 308 | }; 309 | name = Debug; 310 | }; 311 | 9FFBEA841C04B0EC003BA382 /* Release */ = { 312 | isa = XCBuildConfiguration; 313 | buildSettings = { 314 | ALWAYS_SEARCH_USER_PATHS = NO; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BOOL_CONVERSION = YES; 320 | CLANG_WARN_CONSTANT_CONVERSION = YES; 321 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 322 | CLANG_WARN_EMPTY_BODY = YES; 323 | CLANG_WARN_ENUM_CONVERSION = YES; 324 | CLANG_WARN_INT_CONVERSION = YES; 325 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 326 | CLANG_WARN_UNREACHABLE_CODE = YES; 327 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 328 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 329 | COPY_PHASE_STRIP = NO; 330 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 331 | ENABLE_NS_ASSERTIONS = NO; 332 | ENABLE_STRICT_OBJC_MSGSEND = YES; 333 | GCC_C_LANGUAGE_STANDARD = gnu99; 334 | GCC_NO_COMMON_BLOCKS = YES; 335 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 336 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 337 | GCC_WARN_UNDECLARED_SELECTOR = YES; 338 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 339 | GCC_WARN_UNUSED_FUNCTION = YES; 340 | GCC_WARN_UNUSED_VARIABLE = YES; 341 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 342 | MTL_ENABLE_DEBUG_INFO = NO; 343 | SDKROOT = iphoneos; 344 | VALIDATE_PRODUCT = YES; 345 | }; 346 | name = Release; 347 | }; 348 | 9FFBEA861C04B0EC003BA382 /* Debug */ = { 349 | isa = XCBuildConfiguration; 350 | buildSettings = { 351 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 352 | INFOPLIST_FILE = HitTestViewDemo/Info.plist; 353 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 354 | PRODUCT_BUNDLE_IDENTIFIER = com.koudai.HitTestViewDemo; 355 | PRODUCT_NAME = "$(TARGET_NAME)"; 356 | }; 357 | name = Debug; 358 | }; 359 | 9FFBEA871C04B0EC003BA382 /* Release */ = { 360 | isa = XCBuildConfiguration; 361 | buildSettings = { 362 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 363 | INFOPLIST_FILE = HitTestViewDemo/Info.plist; 364 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 365 | PRODUCT_BUNDLE_IDENTIFIER = com.koudai.HitTestViewDemo; 366 | PRODUCT_NAME = "$(TARGET_NAME)"; 367 | }; 368 | name = Release; 369 | }; 370 | /* End XCBuildConfiguration section */ 371 | 372 | /* Begin XCConfigurationList section */ 373 | 9FFBEA691C04B0EC003BA382 /* Build configuration list for PBXProject "HitTestViewDemo" */ = { 374 | isa = XCConfigurationList; 375 | buildConfigurations = ( 376 | 9FFBEA831C04B0EC003BA382 /* Debug */, 377 | 9FFBEA841C04B0EC003BA382 /* Release */, 378 | ); 379 | defaultConfigurationIsVisible = 0; 380 | defaultConfigurationName = Release; 381 | }; 382 | 9FFBEA851C04B0EC003BA382 /* Build configuration list for PBXNativeTarget "HitTestViewDemo" */ = { 383 | isa = XCConfigurationList; 384 | buildConfigurations = ( 385 | 9FFBEA861C04B0EC003BA382 /* Debug */, 386 | 9FFBEA871C04B0EC003BA382 /* Release */, 387 | ); 388 | defaultConfigurationIsVisible = 0; 389 | defaultConfigurationName = Release; 390 | }; 391 | /* End XCConfigurationList section */ 392 | }; 393 | rootObject = 9FFBEA661C04B0EC003BA382 /* Project object */; 394 | } 395 | -------------------------------------------------------------------------------- /HitTestViewDemo/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 | 30 | 31 | 32 | 33 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 54 | 55 | 56 | 57 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | --------------------------------------------------------------------------------