├── .gitignore ├── GeometryDemo ├── GeometryDemo.xcodeproj │ └── project.pbxproj ├── GeometryDemo │ ├── AngleViewController.h │ ├── AngleViewController.m │ ├── AngleViewController.xib │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── BordereView.h │ ├── BordereView.m │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── DummyView.h │ ├── DummyView.m │ ├── GeometryDemo-Info.plist │ ├── GeometryDemo-Prefix.pch │ ├── IQPanRecognizerView.h │ ├── IQPanRecognizerView.m │ ├── InfoViewController.h │ ├── InfoViewController.m │ ├── InfoViewController.xib │ ├── TransformInfoViewController.h │ ├── TransformInfoViewController.m │ ├── TransformInfoViewController.xib │ ├── TransformViewController.h │ ├── TransformViewController.m │ ├── TransformViewController.xib │ ├── ViewController.h │ ├── ViewController.m │ ├── en.lproj │ │ ├── InfoPlist.strings │ │ └── ViewController.xib │ ├── main.m │ └── sample1.jpeg └── IQGeometry │ ├── IQGeometry+AffineTransform.h │ ├── IQGeometry+AffineTransform.m │ ├── IQGeometry+Angle.h │ ├── IQGeometry+Angle.m │ ├── IQGeometry+Distance.h │ ├── IQGeometry+Distance.m │ ├── IQGeometry+Line.h │ ├── IQGeometry+Line.m │ ├── IQGeometry+Point.h │ ├── IQGeometry+Point.m │ ├── IQGeometry+Rect.h │ ├── IQGeometry+Rect.m │ ├── IQGeometry+Size.h │ ├── IQGeometry+Size.m │ ├── IQGeometry-Info.plist │ ├── IQGeometry-Prefix.pch │ ├── IQGeometry.h │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | AF3FF7B717E8A64E0032CDF1 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF3FF7B617E8A64E0032CDF1 /* UIKit.framework */; }; 11 | AF3FF7B917E8A64E0032CDF1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF3FF7B817E8A64E0032CDF1 /* Foundation.framework */; }; 12 | AF3FF7BB17E8A64E0032CDF1 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF3FF7BA17E8A64E0032CDF1 /* CoreGraphics.framework */; }; 13 | AF3FF7C117E8A64E0032CDF1 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AF3FF7BF17E8A64E0032CDF1 /* InfoPlist.strings */; }; 14 | AF3FF7C317E8A64E0032CDF1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7C217E8A64E0032CDF1 /* main.m */; }; 15 | AF3FF7C717E8A64E0032CDF1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7C617E8A64E0032CDF1 /* AppDelegate.m */; }; 16 | AF3FF7C917E8A64E0032CDF1 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = AF3FF7C817E8A64E0032CDF1 /* Default.png */; }; 17 | AF3FF7CB17E8A64E0032CDF1 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AF3FF7CA17E8A64E0032CDF1 /* Default@2x.png */; }; 18 | AF3FF7CD17E8A64E0032CDF1 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AF3FF7CC17E8A64E0032CDF1 /* Default-568h@2x.png */; }; 19 | AF3FF7D017E8A64E0032CDF1 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7CF17E8A64E0032CDF1 /* ViewController.m */; }; 20 | AF3FF7D317E8A64E0032CDF1 /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AF3FF7D117E8A64E0032CDF1 /* ViewController.xib */; }; 21 | AF3FF7E917E8A65A0032CDF1 /* IQGeometry+Angle.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7DB17E8A65A0032CDF1 /* IQGeometry+Angle.m */; }; 22 | AF3FF7EA17E8A65A0032CDF1 /* IQGeometry+AffineTransform.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7DD17E8A65A0032CDF1 /* IQGeometry+AffineTransform.m */; }; 23 | AF3FF7EB17E8A65A0032CDF1 /* IQGeometry+Line.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7DF17E8A65A0032CDF1 /* IQGeometry+Line.m */; }; 24 | AF3FF7EC17E8A65A0032CDF1 /* IQGeometry+Point.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7E117E8A65A0032CDF1 /* IQGeometry+Point.m */; }; 25 | AF3FF7ED17E8A65A0032CDF1 /* IQGeometry+Rect.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7E317E8A65A0032CDF1 /* IQGeometry+Rect.m */; }; 26 | AF3FF7EE17E8A65A0032CDF1 /* IQGeometry+Size.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7E517E8A65A0032CDF1 /* IQGeometry+Size.m */; }; 27 | AF3FF7EF17E8A65A0032CDF1 /* IQGeometry+Distance.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7E717E8A65A0032CDF1 /* IQGeometry+Distance.m */; }; 28 | AF3FF7F317E8A8A80032CDF1 /* AngleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7F117E8A8A80032CDF1 /* AngleViewController.m */; }; 29 | AF3FF7F417E8A8A80032CDF1 /* AngleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AF3FF7F217E8A8A80032CDF1 /* AngleViewController.xib */; }; 30 | AF3FF7F617E8A8ED0032CDF1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF3FF7F517E8A8ED0032CDF1 /* QuartzCore.framework */; }; 31 | AF3FF7F917E8A9820032CDF1 /* IQPanRecognizerView.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7F817E8A9820032CDF1 /* IQPanRecognizerView.m */; }; 32 | AF3FF7FE17E8B7020032CDF1 /* TransformViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7FC17E8B7020032CDF1 /* TransformViewController.m */; }; 33 | AF3FF7FF17E8B7020032CDF1 /* TransformViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AF3FF7FD17E8B7020032CDF1 /* TransformViewController.xib */; }; 34 | AF3FF81B17E8BAD00032CDF1 /* DummyView.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF81A17E8BAD00032CDF1 /* DummyView.m */; }; 35 | AF3FF89517E916340032CDF1 /* BordereView.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF89417E916330032CDF1 /* BordereView.m */; }; 36 | AF9020C717EB214D005FC360 /* InfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AF9020C517EB214D005FC360 /* InfoViewController.m */; }; 37 | AF9020C817EB214D005FC360 /* InfoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AF9020C617EB214D005FC360 /* InfoViewController.xib */; }; 38 | AF9020CC17EB3526005FC360 /* TransformInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AF9020CA17EB3526005FC360 /* TransformInfoViewController.m */; }; 39 | AF9020CD17EB3526005FC360 /* TransformInfoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AF9020CB17EB3526005FC360 /* TransformInfoViewController.xib */; }; 40 | AFA6B12117F2610A00988398 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF3FF7B817E8A64E0032CDF1 /* Foundation.framework */; }; 41 | AFA6B12717F2610A00988398 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AFA6B12517F2610A00988398 /* InfoPlist.strings */; }; 42 | AFA6B12D17F2619A00988398 /* sample1.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = AFA6B12C17F2619A00988398 /* sample1.jpeg */; }; 43 | AFA6B12E17F261D900988398 /* IQGeometry+Angle.h in Headers */ = {isa = PBXBuildFile; fileRef = AF3FF7DA17E8A65A0032CDF1 /* IQGeometry+Angle.h */; settings = {ATTRIBUTES = (Public, ); }; }; 44 | AFA6B12F17F261D900988398 /* IQGeometry+Angle.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7DB17E8A65A0032CDF1 /* IQGeometry+Angle.m */; }; 45 | AFA6B13017F261D900988398 /* IQGeometry+AffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = AF3FF7DC17E8A65A0032CDF1 /* IQGeometry+AffineTransform.h */; settings = {ATTRIBUTES = (Public, ); }; }; 46 | AFA6B13117F261D900988398 /* IQGeometry+AffineTransform.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7DD17E8A65A0032CDF1 /* IQGeometry+AffineTransform.m */; }; 47 | AFA6B13217F261D900988398 /* IQGeometry+Line.h in Headers */ = {isa = PBXBuildFile; fileRef = AF3FF7DE17E8A65A0032CDF1 /* IQGeometry+Line.h */; settings = {ATTRIBUTES = (Public, ); }; }; 48 | AFA6B13317F261D900988398 /* IQGeometry+Line.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7DF17E8A65A0032CDF1 /* IQGeometry+Line.m */; }; 49 | AFA6B13417F261D900988398 /* IQGeometry+Point.h in Headers */ = {isa = PBXBuildFile; fileRef = AF3FF7E017E8A65A0032CDF1 /* IQGeometry+Point.h */; settings = {ATTRIBUTES = (Public, ); }; }; 50 | AFA6B13517F261D900988398 /* IQGeometry+Point.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7E117E8A65A0032CDF1 /* IQGeometry+Point.m */; }; 51 | AFA6B13617F261D900988398 /* IQGeometry+Rect.h in Headers */ = {isa = PBXBuildFile; fileRef = AF3FF7E217E8A65A0032CDF1 /* IQGeometry+Rect.h */; settings = {ATTRIBUTES = (Public, ); }; }; 52 | AFA6B13717F261D900988398 /* IQGeometry+Rect.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7E317E8A65A0032CDF1 /* IQGeometry+Rect.m */; }; 53 | AFA6B13817F261D900988398 /* IQGeometry+Size.h in Headers */ = {isa = PBXBuildFile; fileRef = AF3FF7E417E8A65A0032CDF1 /* IQGeometry+Size.h */; settings = {ATTRIBUTES = (Public, ); }; }; 54 | AFA6B13917F261D900988398 /* IQGeometry+Size.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7E517E8A65A0032CDF1 /* IQGeometry+Size.m */; }; 55 | AFA6B13A17F261D900988398 /* IQGeometry+Distance.h in Headers */ = {isa = PBXBuildFile; fileRef = AF3FF7E617E8A65A0032CDF1 /* IQGeometry+Distance.h */; settings = {ATTRIBUTES = (Public, ); }; }; 56 | AFA6B13B17F261D900988398 /* IQGeometry+Distance.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3FF7E717E8A65A0032CDF1 /* IQGeometry+Distance.m */; }; 57 | AFA6B13C17F261D900988398 /* IQGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = AF3FF7E817E8A65A0032CDF1 /* IQGeometry.h */; settings = {ATTRIBUTES = (Public, ); }; }; 58 | AFA6B13D17F2622100988398 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF3FF7BA17E8A64E0032CDF1 /* CoreGraphics.framework */; }; 59 | /* End PBXBuildFile section */ 60 | 61 | /* Begin PBXFileReference section */ 62 | AF3FF7B317E8A64E0032CDF1 /* GeometryDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GeometryDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 63 | AF3FF7B617E8A64E0032CDF1 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 64 | AF3FF7B817E8A64E0032CDF1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 65 | AF3FF7BA17E8A64E0032CDF1 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 66 | AF3FF7BE17E8A64E0032CDF1 /* GeometryDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GeometryDemo-Info.plist"; sourceTree = ""; }; 67 | AF3FF7C017E8A64E0032CDF1 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 68 | AF3FF7C217E8A64E0032CDF1 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 69 | AF3FF7C417E8A64E0032CDF1 /* GeometryDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GeometryDemo-Prefix.pch"; sourceTree = ""; }; 70 | AF3FF7C517E8A64E0032CDF1 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 71 | AF3FF7C617E8A64E0032CDF1 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 72 | AF3FF7C817E8A64E0032CDF1 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 73 | AF3FF7CA17E8A64E0032CDF1 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 74 | AF3FF7CC17E8A64E0032CDF1 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 75 | AF3FF7CE17E8A64E0032CDF1 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 76 | AF3FF7CF17E8A64E0032CDF1 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 77 | AF3FF7D217E8A64E0032CDF1 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController.xib; sourceTree = ""; }; 78 | AF3FF7DA17E8A65A0032CDF1 /* IQGeometry+Angle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IQGeometry+Angle.h"; sourceTree = ""; }; 79 | AF3FF7DB17E8A65A0032CDF1 /* IQGeometry+Angle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IQGeometry+Angle.m"; sourceTree = ""; }; 80 | AF3FF7DC17E8A65A0032CDF1 /* IQGeometry+AffineTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IQGeometry+AffineTransform.h"; sourceTree = ""; }; 81 | AF3FF7DD17E8A65A0032CDF1 /* IQGeometry+AffineTransform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IQGeometry+AffineTransform.m"; sourceTree = ""; }; 82 | AF3FF7DE17E8A65A0032CDF1 /* IQGeometry+Line.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IQGeometry+Line.h"; sourceTree = ""; }; 83 | AF3FF7DF17E8A65A0032CDF1 /* IQGeometry+Line.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IQGeometry+Line.m"; sourceTree = ""; }; 84 | AF3FF7E017E8A65A0032CDF1 /* IQGeometry+Point.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IQGeometry+Point.h"; sourceTree = ""; }; 85 | AF3FF7E117E8A65A0032CDF1 /* IQGeometry+Point.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IQGeometry+Point.m"; sourceTree = ""; }; 86 | AF3FF7E217E8A65A0032CDF1 /* IQGeometry+Rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IQGeometry+Rect.h"; sourceTree = ""; }; 87 | AF3FF7E317E8A65A0032CDF1 /* IQGeometry+Rect.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IQGeometry+Rect.m"; sourceTree = ""; }; 88 | AF3FF7E417E8A65A0032CDF1 /* IQGeometry+Size.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IQGeometry+Size.h"; sourceTree = ""; }; 89 | AF3FF7E517E8A65A0032CDF1 /* IQGeometry+Size.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IQGeometry+Size.m"; sourceTree = ""; }; 90 | AF3FF7E617E8A65A0032CDF1 /* IQGeometry+Distance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IQGeometry+Distance.h"; sourceTree = ""; }; 91 | AF3FF7E717E8A65A0032CDF1 /* IQGeometry+Distance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IQGeometry+Distance.m"; sourceTree = ""; }; 92 | AF3FF7E817E8A65A0032CDF1 /* IQGeometry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IQGeometry.h; sourceTree = ""; }; 93 | AF3FF7F017E8A8A80032CDF1 /* AngleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AngleViewController.h; sourceTree = ""; }; 94 | AF3FF7F117E8A8A80032CDF1 /* AngleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AngleViewController.m; sourceTree = ""; }; 95 | AF3FF7F217E8A8A80032CDF1 /* AngleViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AngleViewController.xib; sourceTree = ""; }; 96 | AF3FF7F517E8A8ED0032CDF1 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 97 | AF3FF7F717E8A9820032CDF1 /* IQPanRecognizerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IQPanRecognizerView.h; sourceTree = ""; }; 98 | AF3FF7F817E8A9820032CDF1 /* IQPanRecognizerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IQPanRecognizerView.m; sourceTree = ""; }; 99 | AF3FF7FB17E8B7020032CDF1 /* TransformViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransformViewController.h; sourceTree = ""; }; 100 | AF3FF7FC17E8B7020032CDF1 /* TransformViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TransformViewController.m; sourceTree = ""; }; 101 | AF3FF7FD17E8B7020032CDF1 /* TransformViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TransformViewController.xib; sourceTree = ""; }; 102 | AF3FF81917E8BAD00032CDF1 /* DummyView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DummyView.h; sourceTree = ""; }; 103 | AF3FF81A17E8BAD00032CDF1 /* DummyView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DummyView.m; sourceTree = ""; }; 104 | AF3FF89317E916320032CDF1 /* BordereView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BordereView.h; sourceTree = ""; }; 105 | AF3FF89417E916330032CDF1 /* BordereView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BordereView.m; sourceTree = ""; }; 106 | AF9020C417EB214D005FC360 /* InfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfoViewController.h; sourceTree = ""; }; 107 | AF9020C517EB214D005FC360 /* InfoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InfoViewController.m; sourceTree = ""; }; 108 | AF9020C617EB214D005FC360 /* InfoViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InfoViewController.xib; sourceTree = ""; }; 109 | AF9020C917EB3526005FC360 /* TransformInfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransformInfoViewController.h; sourceTree = ""; }; 110 | AF9020CA17EB3526005FC360 /* TransformInfoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TransformInfoViewController.m; sourceTree = ""; }; 111 | AF9020CB17EB3526005FC360 /* TransformInfoViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TransformInfoViewController.xib; sourceTree = ""; }; 112 | AFA6B12017F2610A00988398 /* IQGeometry.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework.static; includeInIndex = 0; path = IQGeometry.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 113 | AFA6B12417F2610A00988398 /* IQGeometry-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "IQGeometry-Info.plist"; sourceTree = ""; }; 114 | AFA6B12617F2610A00988398 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 115 | AFA6B12817F2610A00988398 /* IQGeometry-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "IQGeometry-Prefix.pch"; sourceTree = ""; }; 116 | AFA6B12C17F2619A00988398 /* sample1.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = sample1.jpeg; sourceTree = ""; }; 117 | /* End PBXFileReference section */ 118 | 119 | /* Begin PBXFrameworksBuildPhase section */ 120 | AF3FF7B017E8A64E0032CDF1 /* Frameworks */ = { 121 | isa = PBXFrameworksBuildPhase; 122 | buildActionMask = 2147483647; 123 | files = ( 124 | AF3FF7F617E8A8ED0032CDF1 /* QuartzCore.framework in Frameworks */, 125 | AF3FF7B717E8A64E0032CDF1 /* UIKit.framework in Frameworks */, 126 | AF3FF7B917E8A64E0032CDF1 /* Foundation.framework in Frameworks */, 127 | AF3FF7BB17E8A64E0032CDF1 /* CoreGraphics.framework in Frameworks */, 128 | ); 129 | runOnlyForDeploymentPostprocessing = 0; 130 | }; 131 | AFA6B11A17F2610A00988398 /* Frameworks */ = { 132 | isa = PBXFrameworksBuildPhase; 133 | buildActionMask = 2147483647; 134 | files = ( 135 | AFA6B13D17F2622100988398 /* CoreGraphics.framework in Frameworks */, 136 | AFA6B12117F2610A00988398 /* Foundation.framework in Frameworks */, 137 | ); 138 | runOnlyForDeploymentPostprocessing = 0; 139 | }; 140 | /* End PBXFrameworksBuildPhase section */ 141 | 142 | /* Begin PBXGroup section */ 143 | AF3FF7AA17E8A64E0032CDF1 = { 144 | isa = PBXGroup; 145 | children = ( 146 | AF3FF7D917E8A65A0032CDF1 /* IQGeometry */, 147 | AF3FF7BC17E8A64E0032CDF1 /* GeometryDemo */, 148 | AFA6B12217F2610A00988398 /* IQGeometry */, 149 | AF3FF7B517E8A64E0032CDF1 /* Frameworks */, 150 | AF3FF7B417E8A64E0032CDF1 /* Products */, 151 | ); 152 | sourceTree = ""; 153 | }; 154 | AF3FF7B417E8A64E0032CDF1 /* Products */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | AF3FF7B317E8A64E0032CDF1 /* GeometryDemo.app */, 158 | AFA6B12017F2610A00988398 /* IQGeometry.framework */, 159 | ); 160 | name = Products; 161 | sourceTree = ""; 162 | }; 163 | AF3FF7B517E8A64E0032CDF1 /* Frameworks */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | AF3FF7F517E8A8ED0032CDF1 /* QuartzCore.framework */, 167 | AF3FF7B617E8A64E0032CDF1 /* UIKit.framework */, 168 | AF3FF7B817E8A64E0032CDF1 /* Foundation.framework */, 169 | AF3FF7BA17E8A64E0032CDF1 /* CoreGraphics.framework */, 170 | ); 171 | name = Frameworks; 172 | sourceTree = ""; 173 | }; 174 | AF3FF7BC17E8A64E0032CDF1 /* GeometryDemo */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | AFA6B12C17F2619A00988398 /* sample1.jpeg */, 178 | AF3FF7FA17E8B65E0032CDF1 /* ViewControllers */, 179 | AF3FF7C517E8A64E0032CDF1 /* AppDelegate.h */, 180 | AF3FF7C617E8A64E0032CDF1 /* AppDelegate.m */, 181 | AF3FF7CE17E8A64E0032CDF1 /* ViewController.h */, 182 | AF3FF7CF17E8A64E0032CDF1 /* ViewController.m */, 183 | AF3FF7D117E8A64E0032CDF1 /* ViewController.xib */, 184 | AF3FF7BD17E8A64E0032CDF1 /* Supporting Files */, 185 | AF3FF7F717E8A9820032CDF1 /* IQPanRecognizerView.h */, 186 | AF3FF7F817E8A9820032CDF1 /* IQPanRecognizerView.m */, 187 | AF3FF81917E8BAD00032CDF1 /* DummyView.h */, 188 | AF3FF81A17E8BAD00032CDF1 /* DummyView.m */, 189 | AF3FF89317E916320032CDF1 /* BordereView.h */, 190 | AF3FF89417E916330032CDF1 /* BordereView.m */, 191 | ); 192 | path = GeometryDemo; 193 | sourceTree = ""; 194 | }; 195 | AF3FF7BD17E8A64E0032CDF1 /* Supporting Files */ = { 196 | isa = PBXGroup; 197 | children = ( 198 | AF3FF7BE17E8A64E0032CDF1 /* GeometryDemo-Info.plist */, 199 | AF3FF7BF17E8A64E0032CDF1 /* InfoPlist.strings */, 200 | AF3FF7C217E8A64E0032CDF1 /* main.m */, 201 | AF3FF7C417E8A64E0032CDF1 /* GeometryDemo-Prefix.pch */, 202 | AF3FF7C817E8A64E0032CDF1 /* Default.png */, 203 | AF3FF7CA17E8A64E0032CDF1 /* Default@2x.png */, 204 | AF3FF7CC17E8A64E0032CDF1 /* Default-568h@2x.png */, 205 | ); 206 | name = "Supporting Files"; 207 | sourceTree = ""; 208 | }; 209 | AF3FF7D917E8A65A0032CDF1 /* IQGeometry */ = { 210 | isa = PBXGroup; 211 | children = ( 212 | AF3FF7DA17E8A65A0032CDF1 /* IQGeometry+Angle.h */, 213 | AF3FF7DB17E8A65A0032CDF1 /* IQGeometry+Angle.m */, 214 | AF3FF7DC17E8A65A0032CDF1 /* IQGeometry+AffineTransform.h */, 215 | AF3FF7DD17E8A65A0032CDF1 /* IQGeometry+AffineTransform.m */, 216 | AF3FF7DE17E8A65A0032CDF1 /* IQGeometry+Line.h */, 217 | AF3FF7DF17E8A65A0032CDF1 /* IQGeometry+Line.m */, 218 | AF3FF7E017E8A65A0032CDF1 /* IQGeometry+Point.h */, 219 | AF3FF7E117E8A65A0032CDF1 /* IQGeometry+Point.m */, 220 | AF3FF7E217E8A65A0032CDF1 /* IQGeometry+Rect.h */, 221 | AF3FF7E317E8A65A0032CDF1 /* IQGeometry+Rect.m */, 222 | AF3FF7E417E8A65A0032CDF1 /* IQGeometry+Size.h */, 223 | AF3FF7E517E8A65A0032CDF1 /* IQGeometry+Size.m */, 224 | AF3FF7E617E8A65A0032CDF1 /* IQGeometry+Distance.h */, 225 | AF3FF7E717E8A65A0032CDF1 /* IQGeometry+Distance.m */, 226 | AF3FF7E817E8A65A0032CDF1 /* IQGeometry.h */, 227 | ); 228 | path = IQGeometry; 229 | sourceTree = ""; 230 | }; 231 | AF3FF7FA17E8B65E0032CDF1 /* ViewControllers */ = { 232 | isa = PBXGroup; 233 | children = ( 234 | AF3FF7F017E8A8A80032CDF1 /* AngleViewController.h */, 235 | AF3FF7F117E8A8A80032CDF1 /* AngleViewController.m */, 236 | AF3FF7F217E8A8A80032CDF1 /* AngleViewController.xib */, 237 | AF3FF7FB17E8B7020032CDF1 /* TransformViewController.h */, 238 | AF3FF7FC17E8B7020032CDF1 /* TransformViewController.m */, 239 | AF3FF7FD17E8B7020032CDF1 /* TransformViewController.xib */, 240 | AF9020C417EB214D005FC360 /* InfoViewController.h */, 241 | AF9020C517EB214D005FC360 /* InfoViewController.m */, 242 | AF9020C617EB214D005FC360 /* InfoViewController.xib */, 243 | AF9020C917EB3526005FC360 /* TransformInfoViewController.h */, 244 | AF9020CA17EB3526005FC360 /* TransformInfoViewController.m */, 245 | AF9020CB17EB3526005FC360 /* TransformInfoViewController.xib */, 246 | ); 247 | name = ViewControllers; 248 | sourceTree = ""; 249 | }; 250 | AFA6B12217F2610A00988398 /* IQGeometry */ = { 251 | isa = PBXGroup; 252 | children = ( 253 | AFA6B12317F2610A00988398 /* Supporting Files */, 254 | ); 255 | path = IQGeometry; 256 | sourceTree = ""; 257 | }; 258 | AFA6B12317F2610A00988398 /* Supporting Files */ = { 259 | isa = PBXGroup; 260 | children = ( 261 | AFA6B12417F2610A00988398 /* IQGeometry-Info.plist */, 262 | AFA6B12517F2610A00988398 /* InfoPlist.strings */, 263 | AFA6B12817F2610A00988398 /* IQGeometry-Prefix.pch */, 264 | ); 265 | name = "Supporting Files"; 266 | sourceTree = ""; 267 | }; 268 | /* End PBXGroup section */ 269 | 270 | /* Begin PBXHeadersBuildPhase section */ 271 | AFA6B11B17F2610A00988398 /* Headers */ = { 272 | isa = PBXHeadersBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | AFA6B12E17F261D900988398 /* IQGeometry+Angle.h in Headers */, 276 | AFA6B13017F261D900988398 /* IQGeometry+AffineTransform.h in Headers */, 277 | AFA6B13217F261D900988398 /* IQGeometry+Line.h in Headers */, 278 | AFA6B13417F261D900988398 /* IQGeometry+Point.h in Headers */, 279 | AFA6B13617F261D900988398 /* IQGeometry+Rect.h in Headers */, 280 | AFA6B13817F261D900988398 /* IQGeometry+Size.h in Headers */, 281 | AFA6B13A17F261D900988398 /* IQGeometry+Distance.h in Headers */, 282 | AFA6B13C17F261D900988398 /* IQGeometry.h in Headers */, 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | /* End PBXHeadersBuildPhase section */ 287 | 288 | /* Begin PBXNativeTarget section */ 289 | AF3FF7B217E8A64E0032CDF1 /* GeometryDemo */ = { 290 | isa = PBXNativeTarget; 291 | buildConfigurationList = AF3FF7D617E8A64E0032CDF1 /* Build configuration list for PBXNativeTarget "GeometryDemo" */; 292 | buildPhases = ( 293 | AF3FF7AF17E8A64E0032CDF1 /* Sources */, 294 | AF3FF7B017E8A64E0032CDF1 /* Frameworks */, 295 | AF3FF7B117E8A64E0032CDF1 /* Resources */, 296 | ); 297 | buildRules = ( 298 | ); 299 | dependencies = ( 300 | ); 301 | name = GeometryDemo; 302 | productName = GeometryDemo; 303 | productReference = AF3FF7B317E8A64E0032CDF1 /* GeometryDemo.app */; 304 | productType = "com.apple.product-type.application"; 305 | }; 306 | AFA6B11F17F2610A00988398 /* IQGeometry */ = { 307 | isa = PBXNativeTarget; 308 | buildConfigurationList = AFA6B12B17F2610A00988398 /* Build configuration list for PBXNativeTarget "IQGeometry" */; 309 | buildPhases = ( 310 | AFA6B11817F2610A00988398 /* ShellScript */, 311 | AFA6B11917F2610A00988398 /* Sources */, 312 | AFA6B11A17F2610A00988398 /* Frameworks */, 313 | AFA6B11B17F2610A00988398 /* Headers */, 314 | AFA6B11C17F2610A00988398 /* Resources */, 315 | AFA6B11D17F2610A00988398 /* ShellScript */, 316 | AFA6B11E17F2610A00988398 /* ShellScript */, 317 | ); 318 | buildRules = ( 319 | ); 320 | dependencies = ( 321 | ); 322 | name = IQGeometry; 323 | productName = IQGeometry; 324 | productReference = AFA6B12017F2610A00988398 /* IQGeometry.framework */; 325 | productType = "com.apple.product-type.framework.static"; 326 | }; 327 | /* End PBXNativeTarget section */ 328 | 329 | /* Begin PBXProject section */ 330 | AF3FF7AB17E8A64E0032CDF1 /* Project object */ = { 331 | isa = PBXProject; 332 | attributes = { 333 | LastUpgradeCheck = 0460; 334 | ORGANIZATIONNAME = Iftekhar; 335 | }; 336 | buildConfigurationList = AF3FF7AE17E8A64E0032CDF1 /* Build configuration list for PBXProject "GeometryDemo" */; 337 | compatibilityVersion = "Xcode 3.2"; 338 | developmentRegion = English; 339 | hasScannedForEncodings = 0; 340 | knownRegions = ( 341 | en, 342 | ); 343 | mainGroup = AF3FF7AA17E8A64E0032CDF1; 344 | productRefGroup = AF3FF7B417E8A64E0032CDF1 /* Products */; 345 | projectDirPath = ""; 346 | projectRoot = ""; 347 | targets = ( 348 | AF3FF7B217E8A64E0032CDF1 /* GeometryDemo */, 349 | AFA6B11F17F2610A00988398 /* IQGeometry */, 350 | ); 351 | }; 352 | /* End PBXProject section */ 353 | 354 | /* Begin PBXResourcesBuildPhase section */ 355 | AF3FF7B117E8A64E0032CDF1 /* Resources */ = { 356 | isa = PBXResourcesBuildPhase; 357 | buildActionMask = 2147483647; 358 | files = ( 359 | AF3FF7C117E8A64E0032CDF1 /* InfoPlist.strings in Resources */, 360 | AF3FF7C917E8A64E0032CDF1 /* Default.png in Resources */, 361 | AF3FF7CB17E8A64E0032CDF1 /* Default@2x.png in Resources */, 362 | AF3FF7CD17E8A64E0032CDF1 /* Default-568h@2x.png in Resources */, 363 | AF3FF7D317E8A64E0032CDF1 /* ViewController.xib in Resources */, 364 | AF3FF7F417E8A8A80032CDF1 /* AngleViewController.xib in Resources */, 365 | AF3FF7FF17E8B7020032CDF1 /* TransformViewController.xib in Resources */, 366 | AF9020C817EB214D005FC360 /* InfoViewController.xib in Resources */, 367 | AF9020CD17EB3526005FC360 /* TransformInfoViewController.xib in Resources */, 368 | AFA6B12D17F2619A00988398 /* sample1.jpeg in Resources */, 369 | ); 370 | runOnlyForDeploymentPostprocessing = 0; 371 | }; 372 | AFA6B11C17F2610A00988398 /* Resources */ = { 373 | isa = PBXResourcesBuildPhase; 374 | buildActionMask = 2147483647; 375 | files = ( 376 | AFA6B12717F2610A00988398 /* InfoPlist.strings in Resources */, 377 | ); 378 | runOnlyForDeploymentPostprocessing = 0; 379 | }; 380 | /* End PBXResourcesBuildPhase section */ 381 | 382 | /* Begin PBXShellScriptBuildPhase section */ 383 | AFA6B11817F2610A00988398 /* ShellScript */ = { 384 | isa = PBXShellScriptBuildPhase; 385 | buildActionMask = 2147483647; 386 | files = ( 387 | ); 388 | inputPaths = ( 389 | ); 390 | outputPaths = ( 391 | ); 392 | runOnlyForDeploymentPostprocessing = 0; 393 | shellPath = /bin/sh; 394 | shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n\tUFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\nONLY_ACTIVE_PLATFORM=${ONLY_ACTIVE_PLATFORM:-$ONLY_ACTIVE_ARCH}\n\n# Short-circuit if all binaries are up to date\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n ([[ \"${ONLY_ACTIVE_PLATFORM}\" == \"YES\" ]] || \\\n ([[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && \\\n [[ -f \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && \\\n [[ ! \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\n )\n )\nthen\n exit 0\nfi\n\n\n# Clean other platform if needed\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && [[ \"${ONLY_ACTIVE_PLATFORM}\" != \"YES\" ]]\nthen\n\techo \"Platform \\\"$UFW_SDK_PLATFORM\\\" was cleaned recently. Cleaning \\\"$UFW_OTHER_PLATFORM\\\" as well\"\n\techo xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\n\txcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" clean\nfi\n\n\n# Make sure we are building from fresh binaries\n\nrm -rf \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\n\nif [[ \"${ONLY_ACTIVE_PLATFORM}\" != \"YES\" ]]\nthen\n rm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\n rm -rf \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nfi\n"; 395 | }; 396 | AFA6B11D17F2610A00988398 /* ShellScript */ = { 397 | isa = PBXShellScriptBuildPhase; 398 | buildActionMask = 2147483647; 399 | files = ( 400 | ); 401 | inputPaths = ( 402 | ); 403 | outputPaths = ( 404 | ); 405 | runOnlyForDeploymentPostprocessing = 0; 406 | shellPath = /bin/sh; 407 | shellScript = "HEADERS_ROOT=$SRCROOT/$PRODUCT_NAME\nFRAMEWORK_HEADERS_DIR=\"$BUILT_PRODUCTS_DIR/$WRAPPER_NAME/Versions/$FRAMEWORK_VERSION/Headers\"\n\n## only header files expected at this point\nPUBLIC_HEADERS=$(find $FRAMEWORK_HEADERS_DIR/. -not -type d 2> /dev/null | sed -e \"s@.*/@@g\")\n\nFIND_OPTS=\"\"\nfor PUBLIC_HEADER in $PUBLIC_HEADERS; do\n if [ -n \"$FIND_OPTS\" ]; then\n FIND_OPTS=\"$FIND_OPTS -o\"\n fi\n FIND_OPTS=\"$FIND_OPTS -name '$PUBLIC_HEADER'\"\ndone\n\nif [ -n \"$FIND_OPTS\" ]; then\n for ORIG_HEADER in $(eval \"find $HEADERS_ROOT/. $FIND_OPTS\" 2> /dev/null | sed -e \"s@^$HEADERS_ROOT/./@@g\"); do\n PUBLIC_HEADER=$(basename $ORIG_HEADER)\n RELATIVE_PATH=$(dirname $ORIG_HEADER)\n if [ -e $FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER ]; then\n mkdir -p \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH\"\n mv \"$FRAMEWORK_HEADERS_DIR/$PUBLIC_HEADER\" \"$FRAMEWORK_HEADERS_DIR/$RELATIVE_PATH/$PUBLIC_HEADER\"\n fi\n done\nfi\n"; 408 | }; 409 | AFA6B11E17F2610A00988398 /* ShellScript */ = { 410 | isa = PBXShellScriptBuildPhase; 411 | buildActionMask = 2147483647; 412 | files = ( 413 | ); 414 | inputPaths = ( 415 | ); 416 | outputPaths = ( 417 | ); 418 | runOnlyForDeploymentPostprocessing = 0; 419 | shellPath = /bin/sh; 420 | shellScript = "set -e\n\nset +u\nif [[ $UFW_MASTER_SCRIPT_RUNNING ]]\nthen\n # Nothing for the slave script to do\n exit 0\nfi\nset -u\nexport UFW_MASTER_SCRIPT_RUNNING=1\n\n\n# Functions\n\n## List files in the specified directory, storing to the specified array.\n#\n# @param $1 The path to list\n# @param $2 The name of the array to fill\n#\n##\nlist_files ()\n{\n filelist=$(ls \"$1\")\n while read line\n do\n eval \"$2[\\${#$2[*]}]=\\\"\\$line\\\"\"\n done <<< \"$filelist\"\n}\n\n\n# Sanity check\n\nif [[ ! -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]]\nthen\n echo \"Framework target \\\"${TARGET_NAME}\\\" had no source files to build from. Make sure your source files have the correct target membership\"\n exit 1\nfi\n\n\n# Gather information\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n UFW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n UFW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$UFW_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n UFW_OTHER_PLATFORM=iphonesimulator\nelse\n UFW_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$UFW_SDK_PLATFORM$ ]]\nthen\n UFW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${UFW_OTHER_PLATFORM}\"\nelse\n echo \"Could not find $UFW_SDK_PLATFORM in $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\nONLY_ACTIVE_PLATFORM=${ONLY_ACTIVE_PLATFORM:-$ONLY_ACTIVE_ARCH}\n\n# Short-circuit if all binaries are up to date.\n# We already checked the other platform in the prerun script.\n\nif [[ -f \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" ]] && [[ -f \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]] && [[ ! \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -nt \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/${EXECUTABLE_PATH}\" ]]\nthen\n exit 0\nfi\n\nif [ \"${ONLY_ACTIVE_PLATFORM}\" == \"YES\" ]\nthen\n echo \"ONLY_ACTIVE_PLATFORM=${ONLY_ACTIVE_PLATFORM}: Skipping other platform build\"\nelse\n # Make sure the other platform gets built\n \n echo \"Build other platform\"\n \n echo xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\n xcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" CONFIGURATION_TEMP_DIR=\"${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\" $ACTION\n \n \n # Build the fat static library binary\n \n echo \"Create universal static library\"\n \n echo \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n \"$PLATFORM_DEVELOPER_BIN_DIR/libtool\" -static \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" \"${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\" -o \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\"\n \n echo mv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\n mv \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp\" \"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}\"\nfi\n\n# Build embedded framework structure\n\necho \"Build Embedded Framework\"\n\necho rm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\nrm -rf \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework\"\necho mkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\nmkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources\"\necho cp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\ncp -a \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/\"\n\ndeclare -a UFW_FILE_LIST\nlist_files \"${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}\" UFW_FILE_LIST\nfor filename in \"${UFW_FILE_LIST[@]}\"\ndo\n if [[ \"${filename}\" != \"Info.plist\" ]] && [[ ! \"${filename}\" =~ .*\\.lproj$ ]]\n then\n echo ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n ln -sfh \"../${WRAPPER_NAME}/Resources/${filename}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.embeddedframework/Resources/${filename}\"\n fi\ndone\n\n\nif [ \"${ONLY_ACTIVE_PLATFORM}\" != \"YES\" ]\nthen\n # Replace other platform's framework with a copy of this one (so that both have the same universal binary)\n \n echo \"Copy from $UFW_SDK_PLATFORM to $UFW_OTHER_PLATFORM\"\n \n echo rm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\n rm -rf \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\n echo cp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\n cp -a \"${BUILD_DIR}/${CONFIGURATION}-${UFW_SDK_PLATFORM}\" \"${BUILD_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}\"\nfi\n"; 421 | }; 422 | /* End PBXShellScriptBuildPhase section */ 423 | 424 | /* Begin PBXSourcesBuildPhase section */ 425 | AF3FF7AF17E8A64E0032CDF1 /* Sources */ = { 426 | isa = PBXSourcesBuildPhase; 427 | buildActionMask = 2147483647; 428 | files = ( 429 | AF3FF7C317E8A64E0032CDF1 /* main.m in Sources */, 430 | AF3FF7C717E8A64E0032CDF1 /* AppDelegate.m in Sources */, 431 | AF3FF7D017E8A64E0032CDF1 /* ViewController.m in Sources */, 432 | AF3FF7E917E8A65A0032CDF1 /* IQGeometry+Angle.m in Sources */, 433 | AF3FF7EA17E8A65A0032CDF1 /* IQGeometry+AffineTransform.m in Sources */, 434 | AF3FF7EB17E8A65A0032CDF1 /* IQGeometry+Line.m in Sources */, 435 | AF3FF7EC17E8A65A0032CDF1 /* IQGeometry+Point.m in Sources */, 436 | AF3FF7ED17E8A65A0032CDF1 /* IQGeometry+Rect.m in Sources */, 437 | AF3FF7EE17E8A65A0032CDF1 /* IQGeometry+Size.m in Sources */, 438 | AF3FF7EF17E8A65A0032CDF1 /* IQGeometry+Distance.m in Sources */, 439 | AF3FF7F317E8A8A80032CDF1 /* AngleViewController.m in Sources */, 440 | AF3FF7F917E8A9820032CDF1 /* IQPanRecognizerView.m in Sources */, 441 | AF3FF7FE17E8B7020032CDF1 /* TransformViewController.m in Sources */, 442 | AF3FF81B17E8BAD00032CDF1 /* DummyView.m in Sources */, 443 | AF3FF89517E916340032CDF1 /* BordereView.m in Sources */, 444 | AF9020C717EB214D005FC360 /* InfoViewController.m in Sources */, 445 | AF9020CC17EB3526005FC360 /* TransformInfoViewController.m in Sources */, 446 | ); 447 | runOnlyForDeploymentPostprocessing = 0; 448 | }; 449 | AFA6B11917F2610A00988398 /* Sources */ = { 450 | isa = PBXSourcesBuildPhase; 451 | buildActionMask = 2147483647; 452 | files = ( 453 | AFA6B12F17F261D900988398 /* IQGeometry+Angle.m in Sources */, 454 | AFA6B13117F261D900988398 /* IQGeometry+AffineTransform.m in Sources */, 455 | AFA6B13317F261D900988398 /* IQGeometry+Line.m in Sources */, 456 | AFA6B13517F261D900988398 /* IQGeometry+Point.m in Sources */, 457 | AFA6B13717F261D900988398 /* IQGeometry+Rect.m in Sources */, 458 | AFA6B13917F261D900988398 /* IQGeometry+Size.m in Sources */, 459 | AFA6B13B17F261D900988398 /* IQGeometry+Distance.m in Sources */, 460 | ); 461 | runOnlyForDeploymentPostprocessing = 0; 462 | }; 463 | /* End PBXSourcesBuildPhase section */ 464 | 465 | /* Begin PBXVariantGroup section */ 466 | AF3FF7BF17E8A64E0032CDF1 /* InfoPlist.strings */ = { 467 | isa = PBXVariantGroup; 468 | children = ( 469 | AF3FF7C017E8A64E0032CDF1 /* en */, 470 | ); 471 | name = InfoPlist.strings; 472 | sourceTree = ""; 473 | }; 474 | AF3FF7D117E8A64E0032CDF1 /* ViewController.xib */ = { 475 | isa = PBXVariantGroup; 476 | children = ( 477 | AF3FF7D217E8A64E0032CDF1 /* en */, 478 | ); 479 | name = ViewController.xib; 480 | sourceTree = ""; 481 | }; 482 | AFA6B12517F2610A00988398 /* InfoPlist.strings */ = { 483 | isa = PBXVariantGroup; 484 | children = ( 485 | AFA6B12617F2610A00988398 /* en */, 486 | ); 487 | name = InfoPlist.strings; 488 | sourceTree = ""; 489 | }; 490 | /* End PBXVariantGroup section */ 491 | 492 | /* Begin XCBuildConfiguration section */ 493 | AF3FF7D417E8A64E0032CDF1 /* Debug */ = { 494 | isa = XCBuildConfiguration; 495 | buildSettings = { 496 | ALWAYS_SEARCH_USER_PATHS = NO; 497 | ARCHS = ( 498 | armv7s, 499 | armv7, 500 | i386, 501 | ); 502 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 503 | CLANG_CXX_LIBRARY = "libc++"; 504 | CLANG_ENABLE_OBJC_ARC = YES; 505 | CLANG_WARN_CONSTANT_CONVERSION = YES; 506 | CLANG_WARN_EMPTY_BODY = YES; 507 | CLANG_WARN_ENUM_CONVERSION = YES; 508 | CLANG_WARN_INT_CONVERSION = YES; 509 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 510 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 511 | COPY_PHASE_STRIP = NO; 512 | GCC_C_LANGUAGE_STANDARD = gnu99; 513 | GCC_DYNAMIC_NO_PIC = NO; 514 | GCC_OPTIMIZATION_LEVEL = 0; 515 | GCC_PREPROCESSOR_DEFINITIONS = ( 516 | "DEBUG=1", 517 | "$(inherited)", 518 | ); 519 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 520 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 521 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 522 | GCC_WARN_UNUSED_VARIABLE = YES; 523 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 524 | ONLY_ACTIVE_ARCH = YES; 525 | SDKROOT = iphoneos; 526 | VALID_ARCHS = "armv7 armv7s i386"; 527 | }; 528 | name = Debug; 529 | }; 530 | AF3FF7D517E8A64E0032CDF1 /* Release */ = { 531 | isa = XCBuildConfiguration; 532 | buildSettings = { 533 | ALWAYS_SEARCH_USER_PATHS = NO; 534 | ARCHS = ( 535 | armv7s, 536 | armv7, 537 | i386, 538 | ); 539 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 540 | CLANG_CXX_LIBRARY = "libc++"; 541 | CLANG_ENABLE_OBJC_ARC = YES; 542 | CLANG_WARN_CONSTANT_CONVERSION = YES; 543 | CLANG_WARN_EMPTY_BODY = YES; 544 | CLANG_WARN_ENUM_CONVERSION = YES; 545 | CLANG_WARN_INT_CONVERSION = YES; 546 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 547 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 548 | COPY_PHASE_STRIP = YES; 549 | GCC_C_LANGUAGE_STANDARD = gnu99; 550 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 551 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 552 | GCC_WARN_UNUSED_VARIABLE = YES; 553 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 554 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 555 | SDKROOT = iphoneos; 556 | VALIDATE_PRODUCT = YES; 557 | VALID_ARCHS = "armv7 armv7s i386"; 558 | }; 559 | name = Release; 560 | }; 561 | AF3FF7D717E8A64E0032CDF1 /* Debug */ = { 562 | isa = XCBuildConfiguration; 563 | buildSettings = { 564 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 565 | GCC_PREFIX_HEADER = "GeometryDemo/GeometryDemo-Prefix.pch"; 566 | INFOPLIST_FILE = "GeometryDemo/GeometryDemo-Info.plist"; 567 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 568 | PRODUCT_NAME = "$(TARGET_NAME)"; 569 | WRAPPER_EXTENSION = app; 570 | }; 571 | name = Debug; 572 | }; 573 | AF3FF7D817E8A64E0032CDF1 /* Release */ = { 574 | isa = XCBuildConfiguration; 575 | buildSettings = { 576 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 577 | GCC_PREFIX_HEADER = "GeometryDemo/GeometryDemo-Prefix.pch"; 578 | INFOPLIST_FILE = "GeometryDemo/GeometryDemo-Info.plist"; 579 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 580 | PRODUCT_NAME = "$(TARGET_NAME)"; 581 | WRAPPER_EXTENSION = app; 582 | }; 583 | name = Release; 584 | }; 585 | AFA6B12917F2610A00988398 /* Debug */ = { 586 | isa = XCBuildConfiguration; 587 | buildSettings = { 588 | ARCHS = ( 589 | armv7, 590 | armv7s, 591 | i386, 592 | ); 593 | DYLIB_COMPATIBILITY_VERSION = 1; 594 | DYLIB_CURRENT_VERSION = 1; 595 | FRAMEWORK_VERSION = A; 596 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 597 | GCC_PREFIX_HEADER = "IQGeometry/IQGeometry-Prefix.pch"; 598 | INFOPLIST_FILE = "IQGeometry/IQGeometry-Info.plist"; 599 | PRODUCT_NAME = "$(TARGET_NAME)"; 600 | SKIP_INSTALL = YES; 601 | VALID_ARCHS = "armv7 armv7s i386"; 602 | WRAPPER_EXTENSION = framework; 603 | }; 604 | name = Debug; 605 | }; 606 | AFA6B12A17F2610A00988398 /* Release */ = { 607 | isa = XCBuildConfiguration; 608 | buildSettings = { 609 | ARCHS = ( 610 | armv7, 611 | armv7s, 612 | i386, 613 | ); 614 | DYLIB_COMPATIBILITY_VERSION = 1; 615 | DYLIB_CURRENT_VERSION = 1; 616 | FRAMEWORK_VERSION = A; 617 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 618 | GCC_PREFIX_HEADER = "IQGeometry/IQGeometry-Prefix.pch"; 619 | INFOPLIST_FILE = "IQGeometry/IQGeometry-Info.plist"; 620 | PRODUCT_NAME = "$(TARGET_NAME)"; 621 | SKIP_INSTALL = YES; 622 | VALID_ARCHS = "armv7 armv7s i386"; 623 | WRAPPER_EXTENSION = framework; 624 | }; 625 | name = Release; 626 | }; 627 | /* End XCBuildConfiguration section */ 628 | 629 | /* Begin XCConfigurationList section */ 630 | AF3FF7AE17E8A64E0032CDF1 /* Build configuration list for PBXProject "GeometryDemo" */ = { 631 | isa = XCConfigurationList; 632 | buildConfigurations = ( 633 | AF3FF7D417E8A64E0032CDF1 /* Debug */, 634 | AF3FF7D517E8A64E0032CDF1 /* Release */, 635 | ); 636 | defaultConfigurationIsVisible = 0; 637 | defaultConfigurationName = Release; 638 | }; 639 | AF3FF7D617E8A64E0032CDF1 /* Build configuration list for PBXNativeTarget "GeometryDemo" */ = { 640 | isa = XCConfigurationList; 641 | buildConfigurations = ( 642 | AF3FF7D717E8A64E0032CDF1 /* Debug */, 643 | AF3FF7D817E8A64E0032CDF1 /* Release */, 644 | ); 645 | defaultConfigurationIsVisible = 0; 646 | defaultConfigurationName = Release; 647 | }; 648 | AFA6B12B17F2610A00988398 /* Build configuration list for PBXNativeTarget "IQGeometry" */ = { 649 | isa = XCConfigurationList; 650 | buildConfigurations = ( 651 | AFA6B12917F2610A00988398 /* Debug */, 652 | AFA6B12A17F2610A00988398 /* Release */, 653 | ); 654 | defaultConfigurationIsVisible = 0; 655 | defaultConfigurationName = Release; 656 | }; 657 | /* End XCConfigurationList section */ 658 | }; 659 | rootObject = AF3FF7AB17E8A64E0032CDF1 /* Project object */; 660 | } 661 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/AngleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AngleViewController.h 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/17/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DummyView; 12 | 13 | @interface AngleViewController : UIViewController 14 | { 15 | IBOutlet DummyView *dummyView; 16 | IBOutlet UILabel *labelDegree; 17 | IBOutlet UILabel *labelRadian; 18 | IBOutlet UILabel *labelDistance; 19 | IBOutlet UILabel *labelPointDistance; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/AngleViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AngleViewController.m 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/17/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "AngleViewController.h" 10 | #import "IQPanRecognizerView.h" 11 | #import "IQGeometry.h" 12 | #import "DummyView.h" 13 | #import 14 | #import "InfoViewController.h" 15 | 16 | @interface AngleViewController () 17 | 18 | @end 19 | 20 | @implementation AngleViewController 21 | { 22 | IQPanRecognizerView* lineBeginPoint; 23 | IQPanRecognizerView* lineEndPoint; 24 | 25 | IQPanRecognizerView* centerPoint; 26 | IQPanRecognizerView* firstPoint; 27 | IQPanRecognizerView* secondPoint; 28 | 29 | IQPanRecognizerView* angleFirstPoint; 30 | IQPanRecognizerView* angleSecondPoint; 31 | 32 | IQPanRecognizerView* midFirstPoint; 33 | IQPanRecognizerView* midSecondPoint; 34 | 35 | IQPanRecognizerView* intersectFirstPoint; 36 | IQPanRecognizerView* intersectSecondPoint; 37 | 38 | IQPanRecognizerView* centroidPoint; 39 | IQPanRecognizerView* angledPoint; 40 | } 41 | 42 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 43 | { 44 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 45 | if (self) { 46 | self.title = @"Angle"; 47 | // Custom initialization 48 | } 49 | return self; 50 | } 51 | 52 | -(IQPanRecognizerView*)createAView 53 | { 54 | IQPanRecognizerView *view = [[IQPanRecognizerView alloc] initWithFrame:CGRectMake(0, 0, 10, 10)]; 55 | [view setBackgroundColor:[UIColor blackColor]]; 56 | [view.layer setCornerRadius:5.0]; 57 | [view setDelegate:self]; 58 | [self.view addSubview:view]; 59 | return view; 60 | } 61 | 62 | - (void)infoClicked:(UIButton *)sender { 63 | InfoViewController *info = [[InfoViewController alloc] init]; 64 | [info setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal]; 65 | [self presentViewController:info animated:YES completion:nil]; 66 | } 67 | 68 | - (void)viewDidLoad 69 | { 70 | [super viewDidLoad]; 71 | 72 | UIButton *button = [UIButton buttonWithType:UIButtonTypeInfoLight]; 73 | [button addTarget:self action:@selector(infoClicked:) forControlEvents:UIControlEventTouchUpInside]; 74 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button]; 75 | 76 | 77 | lineBeginPoint = [self createAView]; 78 | [lineBeginPoint setCenter:CGPointMake(50, 150)]; 79 | [lineBeginPoint setBackgroundColor:[UIColor blackColor]]; 80 | 81 | lineEndPoint = [self createAView]; 82 | [lineEndPoint setCenter:CGPointMake(270, 150)]; 83 | [lineEndPoint setBackgroundColor:[UIColor blackColor]]; 84 | 85 | centerPoint = [self createAView]; 86 | [centerPoint setCenter:CGPointMake(160, 50)]; 87 | [centerPoint setBackgroundColor:[UIColor redColor]]; 88 | 89 | firstPoint = [self createAView]; 90 | [firstPoint setCenter:CGPointMake(270, 300)]; 91 | [firstPoint setBackgroundColor:[UIColor purpleColor]]; 92 | 93 | secondPoint = [self createAView]; 94 | [secondPoint setCenter:CGPointMake(50, 300)]; 95 | [secondPoint setBackgroundColor:[UIColor greenColor]]; 96 | 97 | angleFirstPoint = [self createAView]; 98 | [angleFirstPoint setUserInteractionEnabled:NO]; 99 | [angleFirstPoint setBackgroundColor:[UIColor darkGrayColor]]; 100 | 101 | angleSecondPoint = [self createAView]; 102 | [angleSecondPoint setUserInteractionEnabled:NO]; 103 | [angleSecondPoint setBackgroundColor:[UIColor darkGrayColor]]; 104 | 105 | midFirstPoint = [self createAView]; 106 | [midFirstPoint setUserInteractionEnabled:NO]; 107 | [midFirstPoint setBackgroundColor:[UIColor blueColor]]; 108 | 109 | midSecondPoint = [self createAView]; 110 | [midSecondPoint setUserInteractionEnabled:NO]; 111 | [midSecondPoint setBackgroundColor:[UIColor blueColor]]; 112 | 113 | intersectFirstPoint = [self createAView]; 114 | [intersectFirstPoint setUserInteractionEnabled:NO]; 115 | [intersectFirstPoint setBackgroundColor:[UIColor orangeColor]]; 116 | 117 | intersectSecondPoint = [self createAView]; 118 | [intersectSecondPoint setUserInteractionEnabled:NO]; 119 | [intersectSecondPoint setBackgroundColor:[UIColor orangeColor]]; 120 | 121 | centroidPoint = [self createAView]; 122 | [centroidPoint setUserInteractionEnabled:NO]; 123 | [centroidPoint setBackgroundColor:[UIColor brownColor]]; 124 | 125 | angledPoint = [self createAView]; 126 | [angledPoint setUserInteractionEnabled:NO]; 127 | [angledPoint setBackgroundColor:[UIColor magentaColor]]; 128 | 129 | 130 | [labelDegree.layer setCornerRadius:10.0]; 131 | [labelDegree.layer setBorderColor:[UIColor cyanColor].CGColor]; 132 | [labelDegree.layer setBorderWidth:1.0]; 133 | 134 | } 135 | 136 | -(void)viewWillAppear:(BOOL)animated 137 | { 138 | [super viewWillAppear:animated]; 139 | [self updateUI]; 140 | } 141 | 142 | - (void)didReceiveMemoryWarning 143 | { 144 | [super didReceiveMemoryWarning]; 145 | // Dispose of any resources that can be recreated. 146 | } 147 | 148 | -(void)updateUI 149 | { 150 | IQLine lineFirstPoint; 151 | lineFirstPoint.beginPoint = centerPoint.center; 152 | lineFirstPoint.endPoint = firstPoint.center; 153 | 154 | IQLine lineSecondPoint; 155 | lineSecondPoint.beginPoint = centerPoint.center; 156 | lineSecondPoint.endPoint = secondPoint.center; 157 | 158 | IQLine line; 159 | line.beginPoint = lineBeginPoint.center; 160 | line.endPoint = lineEndPoint.center; 161 | 162 | 163 | angleFirstPoint.center = IQPointWithDistance(centerPoint.center, firstPoint.center, 50); 164 | angleSecondPoint.center = IQPointWithDistance(centerPoint.center, secondPoint.center, 50); 165 | 166 | midFirstPoint.center = IQPointGetMidPoint(centerPoint.center, firstPoint.center); 167 | midSecondPoint.center = IQPointGetMidPoint(centerPoint.center, secondPoint.center); 168 | 169 | intersectFirstPoint.center = IQPointOfIntersect(lineFirstPoint, line); 170 | intersectSecondPoint.center = IQPointOfIntersect(lineSecondPoint, line); 171 | 172 | centroidPoint.center = IQPointCentroidOfPoints([NSArray arrayWithObjects:[NSValue valueWithCGPoint:centerPoint.center],[NSValue valueWithCGPoint:firstPoint.center],[NSValue valueWithCGPoint:secondPoint.center], nil]); 173 | 174 | angledPoint.center = IQPointRotate(centerPoint.center, firstPoint.center, IQDegreeToRadian(10)); 175 | 176 | 177 | dummyView.centerPoint = centerPoint.center; 178 | dummyView.startPoint = angleFirstPoint.center; 179 | dummyView.endPoint = angleSecondPoint.center; 180 | 181 | 182 | dummyView.lines = [[NSArray alloc] initWithObjects:[NSValue valueWithIQLine:lineFirstPoint],[NSValue valueWithIQLine:lineSecondPoint],[NSValue valueWithIQLine:line],nil]; 183 | [dummyView setNeedsDisplay]; 184 | 185 | CGFloat angle = IQPointGetAngle(centerPoint.center, firstPoint.center, secondPoint.center); 186 | CGFloat distance = IQPointGetDistance(intersectFirstPoint.center, intersectSecondPoint.center); 187 | CGFloat distanceOfPoint = IQPointGetDistanceOfPoint(centerPoint.center, line); 188 | 189 | labelDegree.center = IQPointGetMidPoint(centerPoint.center, IQPointRotate(centerPoint.center, angleFirstPoint.center, angle/2)); 190 | 191 | labelPointDistance.text = [NSString stringWithFormat:@"%.2f",distanceOfPoint]; 192 | labelDistance.text = [NSString stringWithFormat:@"%.2f",distance]; 193 | labelRadian.text = [NSString stringWithFormat:@"%.2f",angle]; 194 | labelDegree.text = [NSString stringWithFormat:@"%.2f",IQRadianToDegree(angle)]; 195 | } 196 | 197 | -(void)panRecognizer:(IQPanRecognizerView*)panRecognizer beginTouchAtPoint:(CGPoint)point 198 | { 199 | [self updateUI]; 200 | } 201 | 202 | -(void)panRecognizer:(IQPanRecognizerView*)panRecognizer moveTouchAtPoint:(CGPoint)point 203 | { 204 | [self updateUI]; 205 | } 206 | 207 | -(void)panRecognizer:(IQPanRecognizerView*)panRecognizer endTouchAtPoint:(CGPoint)point 208 | { 209 | [self updateUI]; 210 | } 211 | 212 | 213 | - (void)viewDidUnload { 214 | labelDegree = nil; 215 | labelRadian = nil; 216 | dummyView = nil; 217 | labelDistance = nil; 218 | labelPointDistance = nil; 219 | [super viewDidUnload]; 220 | } 221 | @end 222 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/AngleViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1552 5 | 12C54 6 | 3084 7 | 1187.34 8 | 625.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 2083 12 | 13 | 14 | IBProxyObject 15 | IBUILabel 16 | IBUIView 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 274 41 | 42 | 43 | 44 | 301 45 | {{10, 439}, {150, 21}} 46 | 47 | 48 | 49 | _NS:9 50 | NO 51 | YES 52 | 7 53 | NO 54 | IBCocoaTouchFramework 55 | Angle in Radian 56 | 57 | 1 58 | MCAwIDAAA 59 | darkTextColor 60 | 61 | 62 | 0 63 | 64 | 2 65 | 12 66 | 67 | 68 | Helvetica-Bold 69 | 12 70 | 16 71 | 72 | NO 73 | 74 | 75 | 76 | 301 77 | {{280, 0}, {40, 20}} 78 | 79 | 80 | 81 | _NS:9 82 | NO 83 | YES 84 | 7 85 | NO 86 | IBCocoaTouchFramework 87 | 0 88 | 89 | 90 | 0 91 | 1 92 | 93 | 2 94 | 10 95 | 96 | 97 | Helvetica-Bold 98 | 10 99 | 16 100 | 101 | NO 102 | 103 | 104 | 105 | 301 106 | {{205, 439}, {105, 21}} 107 | 108 | 109 | 110 | _NS:9 111 | NO 112 | YES 113 | 7 114 | NO 115 | IBCocoaTouchFramework 116 | 0 117 | 118 | 119 | 0 120 | 121 | 1 122 | 17 123 | 124 | 125 | Helvetica 126 | 17 127 | 16 128 | 129 | NO 130 | 131 | 132 | 133 | 301 134 | {{10, 410}, {150, 21}} 135 | 136 | 137 | 138 | _NS:9 139 | NO 140 | YES 141 | 7 142 | NO 143 | IBCocoaTouchFramework 144 | Black Points Distance 145 | 146 | 147 | 0 148 | 149 | 150 | NO 151 | 152 | 153 | 154 | 301 155 | {{205, 410}, {105, 21}} 156 | 157 | 158 | 159 | _NS:9 160 | NO 161 | YES 162 | 7 163 | NO 164 | IBCocoaTouchFramework 165 | 0 166 | 167 | 168 | 0 169 | 170 | 171 | NO 172 | 173 | 174 | 175 | 301 176 | {{10, 381}, {187, 21}} 177 | 178 | 179 | 180 | _NS:9 181 | NO 182 | YES 183 | 7 184 | NO 185 | IBCocoaTouchFramework 186 | YES 187 | 188 | Red Point Distance From Line 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 0 199 | NO 200 | 201 | 202 | 203 | 301 204 | {{205, 381}, {105, 21}} 205 | 206 | 207 | 208 | _NS:9 209 | NO 210 | YES 211 | 7 212 | NO 213 | IBCocoaTouchFramework 214 | 0 215 | 216 | 217 | 0 218 | 219 | 220 | NO 221 | 222 | 223 | {320, 460} 224 | 225 | 226 | 227 | _NS:9 228 | 229 | 3 230 | MQA 231 | 232 | 2 233 | 234 | 235 | IBCocoaTouchFramework 236 | 237 | 238 | {{0, 20}, {320, 460}} 239 | 240 | 241 | 242 | 243 | 3 244 | MQA 245 | 246 | 247 | 248 | 249 | IBUIScreenMetrics 250 | 251 | YES 252 | 253 | 254 | 255 | 256 | 257 | {320, 480} 258 | {480, 320} 259 | 260 | 261 | IBCocoaTouchFramework 262 | Retina 3.5 Full Screen 263 | 0 264 | 265 | IBCocoaTouchFramework 266 | 267 | 268 | 269 | 270 | 271 | 272 | view 273 | 274 | 275 | 276 | 3 277 | 278 | 279 | 280 | labelDegree 281 | 282 | 283 | 284 | 13 285 | 286 | 287 | 288 | labelRadian 289 | 290 | 291 | 292 | 14 293 | 294 | 295 | 296 | dummyView 297 | 298 | 299 | 300 | 28 301 | 302 | 303 | 304 | labelDistance 305 | 306 | 307 | 308 | 31 309 | 310 | 311 | 312 | labelPointDistance 313 | 314 | 315 | 316 | 34 317 | 318 | 319 | 320 | 321 | 322 | 0 323 | 324 | 325 | 326 | 327 | 328 | 1 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | -1 337 | 338 | 339 | File's Owner 340 | 341 | 342 | -2 343 | 344 | 345 | 346 | 347 | 27 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 33 362 | 363 | 364 | 365 | 366 | 32 367 | 368 | 369 | 370 | 371 | 30 372 | 373 | 374 | 375 | 376 | 29 377 | 378 | 379 | 380 | 381 | 10 382 | 383 | 384 | 385 | 386 | 8 387 | 388 | 389 | 390 | 391 | 11 392 | 393 | 394 | 395 | 396 | 397 | 398 | AngleViewController 399 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 400 | UIResponder 401 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 402 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 403 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 404 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 405 | DummyView 406 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 407 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 408 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 409 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 410 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 411 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 412 | 413 | 414 | 415 | 416 | 417 | 39 418 | 419 | 420 | 421 | 422 | AngleViewController 423 | UIViewController 424 | 425 | DummyView 426 | UILabel 427 | UILabel 428 | UILabel 429 | UILabel 430 | 431 | 432 | 433 | dummyView 434 | DummyView 435 | 436 | 437 | labelDegree 438 | UILabel 439 | 440 | 441 | labelDistance 442 | UILabel 443 | 444 | 445 | labelPointDistance 446 | UILabel 447 | 448 | 449 | labelRadian 450 | UILabel 451 | 452 | 453 | 454 | IBProjectSource 455 | ./Classes/AngleViewController.h 456 | 457 | 458 | 459 | DummyView 460 | UIView 461 | 462 | IBProjectSource 463 | ./Classes/DummyView.h 464 | 465 | 466 | 467 | 468 | 0 469 | IBCocoaTouchFramework 470 | YES 471 | 3 472 | 2083 473 | 474 | 475 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/17/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ViewController; 12 | 13 | @interface AppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) ViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/17/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "ViewController.h" 12 | 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 19 | // Override point for customization after application launch. 20 | 21 | 22 | UIViewController *rootController = [[ViewController alloc] init]; 23 | 24 | UINavigationController *controller = [[UINavigationController alloc] initWithRootViewController:rootController]; 25 | 26 | self.window.rootViewController = controller; 27 | 28 | [self.window makeKeyAndVisible]; 29 | return YES; 30 | } 31 | 32 | - (void)applicationWillResignActive:(UIApplication *)application 33 | { 34 | // 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. 35 | // 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. 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | // 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. 41 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 42 | } 43 | 44 | - (void)applicationWillEnterForeground:(UIApplication *)application 45 | { 46 | // 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. 47 | } 48 | 49 | - (void)applicationDidBecomeActive:(UIApplication *)application 50 | { 51 | // 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. 52 | } 53 | 54 | - (void)applicationWillTerminate:(UIApplication *)application 55 | { 56 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/BordereView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BordereView.h 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/18/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BordereView : UIView 12 | 13 | -(void)setBorderColor:(UIColor*)color; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/BordereView.m: -------------------------------------------------------------------------------- 1 | // 2 | // BordereView.m 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/18/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "BordereView.h" 10 | #import 11 | 12 | @implementation BordereView 13 | 14 | - (id)initWithFrame:(CGRect)frame 15 | { 16 | self = [super initWithFrame:frame]; 17 | if (self) { 18 | [self setBackgroundColor:[UIColor clearColor]]; 19 | [self setUserInteractionEnabled:NO]; 20 | 21 | [self.layer setBorderWidth:1.0]; 22 | // Initialization code 23 | } 24 | return self; 25 | } 26 | 27 | -(void)setBorderColor:(UIColor*)color 28 | { 29 | [self.layer setBorderColor:color.CGColor]; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackiftekhar/IQGeometry/41a80b808e6f58199c2ea2b7cb813a8add327a4c/GeometryDemo/GeometryDemo/Default-568h@2x.png -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackiftekhar/IQGeometry/41a80b808e6f58199c2ea2b7cb813a8add327a4c/GeometryDemo/GeometryDemo/Default.png -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackiftekhar/IQGeometry/41a80b808e6f58199c2ea2b7cb813a8add327a4c/GeometryDemo/GeometryDemo/Default@2x.png -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/DummyView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DummyView.h 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/17/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DummyView : UIView 12 | 13 | @property(nonatomic, assign) CGPoint centerPoint; 14 | @property(nonatomic, assign) CGPoint startPoint; 15 | @property(nonatomic, assign) CGPoint endPoint; 16 | 17 | @property(nonatomic, strong) NSArray* lines; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/DummyView.m: -------------------------------------------------------------------------------- 1 | // 2 | // DummyView.m 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/17/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "DummyView.h" 10 | #import "IQGeometry.h" 11 | 12 | @implementation DummyView 13 | 14 | - (id)initWithFrame:(CGRect)frame 15 | { 16 | self = [super initWithFrame:frame]; 17 | if (self) { 18 | // Initialization code 19 | } 20 | return self; 21 | } 22 | 23 | - (void)drawRect:(CGRect)rect 24 | { 25 | for (NSValue* lineValue in _lines) 26 | { 27 | IQLine line = [lineValue lineValue]; 28 | 29 | CGContextRef context = UIGraphicsGetCurrentContext(); 30 | CGContextSaveGState (context); 31 | CGContextSetStrokeColorWithColor (context, [[UIColor blackColor]CGColor]); 32 | CGContextSetLineWidth (context, 1.0); 33 | CGContextMoveToPoint (context, line.beginPoint.x, line.beginPoint.y); 34 | CGContextAddLineToPoint (context, line.endPoint.x, line.endPoint.y); 35 | CGContextStrokePath (context); 36 | CGContextRestoreGState (context); 37 | } 38 | 39 | CGContextRef context = UIGraphicsGetCurrentContext(); 40 | // CGContextSaveGState (context); 41 | 42 | CGFloat beginAngle = IQPointGetAngle(_centerPoint, CGPointMake(_centerPoint.x+10, _centerPoint.y), _startPoint); 43 | CGFloat endAngle = IQPointGetAngle(_centerPoint, CGPointMake(_centerPoint.x+10, _centerPoint.y), _endPoint); 44 | CGFloat radius = IQPointGetDistance(_centerPoint, _startPoint); 45 | 46 | CGContextAddArc(context, 47 | _centerPoint.x, 48 | _centerPoint.y, 49 | radius, 50 | beginAngle, 51 | endAngle, 52 | 0); 53 | 54 | // CGContextMoveToPoint(context, _centerPoint.x, _centerPoint.y); 55 | // 56 | // CGContextAddLineToPoint(context, _centerPoint.x, _centerPoint.y); 57 | // 58 | // CGContextAddArcToPoint(context,100,100,200,100,30); 59 | // 60 | // CGContextAddLineToPoint(context, _centerPoint.x, _centerPoint.y); 61 | CGContextStrokePath(context); 62 | // CGContextRestoreGState (context); 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/GeometryDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.Iftekharapps.hhs.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/GeometryDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'GeometryDemo' target in the 'GeometryDemo' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/IQPanRecognizerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQPanRecognizerView.h 3 | // IQPhotoEditor 4 | // 5 | // Created by Mohd Iftekhar Qurashi on 25/08/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class IQPanRecognizerView; 12 | 13 | @protocol IQPanRecognizerViewDelegate 14 | @optional 15 | -(void)panRecognizer:(IQPanRecognizerView*)panRecognizer beginTouchAtPoint:(CGPoint)point; 16 | -(void)panRecognizer:(IQPanRecognizerView*)panRecognizer moveTouchAtPoint:(CGPoint)point; 17 | -(void)panRecognizer:(IQPanRecognizerView*)panRecognizer endTouchAtPoint:(CGPoint)point; 18 | 19 | @end 20 | 21 | @interface IQPanRecognizerView : UIView 22 | { 23 | 24 | } 25 | 26 | @property(nonatomic, unsafe_unretained) id delegate; 27 | 28 | @property(nonatomic, assign) CGSize recommendSize; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/IQPanRecognizerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQPanRecognizerView.m 3 | // IQPhotoEditor 4 | // 5 | // Created by Mohd Iftekhar Qurashi on 25/08/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "IQPanRecognizerView.h" 10 | #import "IQGeometry.h" 11 | 12 | @implementation IQPanRecognizerView 13 | { 14 | UILabel *labelPoint; 15 | CGPoint _beginTouchPoint; 16 | CGPoint _beginCenter; 17 | } 18 | 19 | @synthesize delegate = _delegate; 20 | 21 | - (id)initWithFrame:(CGRect)frame 22 | { 23 | self = [super initWithFrame:frame]; 24 | if (self) 25 | { 26 | [self setUserInteractionEnabled:YES]; 27 | [self initialize]; 28 | } 29 | return self; 30 | } 31 | 32 | -(void)awakeFromNib 33 | { 34 | [super awakeFromNib]; 35 | [self initialize]; 36 | } 37 | 38 | -(void)initialize 39 | { 40 | labelPoint = [[UILabel alloc] initWithFrame:CGRectMake(-15, -10, 40, 10)]; 41 | [labelPoint setBackgroundColor:[UIColor clearColor]]; 42 | [labelPoint setTextAlignment:NSTextAlignmentCenter]; 43 | [labelPoint setFont:[UIFont boldSystemFontOfSize:8.0]]; 44 | [self addSubview:labelPoint]; 45 | 46 | UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureRecognizer:)]; 47 | [longPress setMinimumPressDuration:0.1]; 48 | [self addGestureRecognizer:longPress]; 49 | 50 | _recommendSize = CGSizeMake(44.0, 44.0); 51 | } 52 | 53 | -(void)setFrame:(CGRect)frame 54 | { 55 | [super setFrame:frame]; 56 | [labelPoint setText:[NSString stringWithFormat:@"{%d,%d}",(int)self.center.x,(int)self.center.y]]; 57 | } 58 | 59 | -(void)setCenter:(CGPoint)center 60 | { 61 | @try { 62 | [super setCenter:center]; 63 | [labelPoint setText:[NSString stringWithFormat:@"{%d,%d}",(int)self.center.x,(int)self.center.y]]; 64 | } 65 | @catch (NSException *exception) { 66 | NSLog(@"%@",exception); 67 | } 68 | @finally { 69 | 70 | } 71 | } 72 | 73 | - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event 74 | { 75 | //Getting bounds. 76 | CGRect bounds = self.bounds; 77 | 78 | //Calculating delta size movement. 79 | CGFloat widthDelta = _recommendSize.width - bounds.size.width; 80 | CGFloat heightDelta = _recommendSize.height - bounds.size.height; 81 | 82 | CGSize scale = IQAffineTransformGetScale(self.transform); 83 | 84 | widthDelta = widthDelta/scale.width; 85 | heightDelta = heightDelta/scale.height; 86 | 87 | //If values less than 0. Then view size should be larger than it's bounds. 88 | widthDelta = (widthDelta>0)?widthDelta:0; 89 | heightDelta = (heightDelta>0)?heightDelta:0; 90 | 91 | //Calculating it's dummy bounds. 92 | bounds = CGRectInset(bounds, -0.5*widthDelta, -0.5*heightDelta); 93 | 94 | //If point contains in it's bounds. then return yes. Else no. 95 | return CGRectContainsPoint(bounds, point); 96 | } 97 | 98 | -(void)panGestureRecognizer:(UILongPressGestureRecognizer*)gesture 99 | { 100 | CGPoint location = [gesture locationInView:self.superview]; 101 | 102 | if (gesture.state == UIGestureRecognizerStateBegan) 103 | { 104 | _beginTouchPoint = location; 105 | _beginCenter = self.center; 106 | 107 | if ([_delegate respondsToSelector:@selector(panRecognizer:beginTouchAtPoint:)]) 108 | [_delegate panRecognizer:self beginTouchAtPoint:location]; 109 | } 110 | else if(gesture.state == UIGestureRecognizerStateChanged) 111 | { 112 | self.center = CGPointMake(_beginCenter.x+(location.x-_beginTouchPoint.x), _beginCenter.y+(location.y-_beginTouchPoint.y)); 113 | 114 | if ([_delegate respondsToSelector:@selector(panRecognizer:moveTouchAtPoint:)]) 115 | [_delegate panRecognizer:self moveTouchAtPoint:location]; 116 | } 117 | else if(gesture.state == UIGestureRecognizerStateEnded) 118 | { 119 | if ([_delegate respondsToSelector:@selector(panRecognizer:endTouchAtPoint:)]) 120 | [_delegate panRecognizer:self endTouchAtPoint:location]; 121 | } 122 | } 123 | 124 | @end 125 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/InfoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // InfoViewController.h 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/19/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface InfoViewController : UIViewController 12 | { 13 | IBOutlet UIView *viewCyan; 14 | IBOutlet UIView *viewMajenta; 15 | IBOutlet UIView *viewBrown; 16 | IBOutlet UIView *viewOrange; 17 | IBOutlet UIView *viewBlue; 18 | IBOutlet UIView *viewGray; 19 | IBOutlet UIView *viewGreen; 20 | IBOutlet UIView *viewPurple; 21 | IBOutlet UIView *viewBlack; 22 | IBOutlet UIView *viewRed; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/InfoViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // InfoViewController.m 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/19/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "InfoViewController.h" 10 | #import 11 | 12 | 13 | @interface InfoViewController () 14 | 15 | @end 16 | 17 | @implementation InfoViewController 18 | 19 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 20 | { 21 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 22 | if (self) { 23 | // Custom initialization 24 | } 25 | return self; 26 | } 27 | - (IBAction)doneClicked:(UIBarButtonItem *)sender { 28 | [self dismissModalViewControllerAnimated:YES]; 29 | } 30 | 31 | - (void)viewDidLoad 32 | { 33 | [super viewDidLoad]; 34 | 35 | [viewCyan setBackgroundColor:[UIColor clearColor]]; 36 | [viewCyan.layer setBorderColor:[UIColor cyanColor].CGColor]; 37 | [viewCyan.layer setBorderWidth:1.0]; 38 | 39 | [viewCyan.layer setCornerRadius:viewCyan.bounds.size.height/3]; 40 | [viewBrown.layer setCornerRadius:viewBrown.bounds.size.height/2]; 41 | [viewMajenta.layer setCornerRadius:viewMajenta.bounds.size.height/2]; 42 | [viewOrange.layer setCornerRadius:viewOrange.bounds.size.height/2]; 43 | [viewBlue.layer setCornerRadius:viewBlue.bounds.size.height/2]; 44 | [viewGray.layer setCornerRadius:viewGray.bounds.size.height/2]; 45 | [viewGreen.layer setCornerRadius:viewGreen.bounds.size.height/2]; 46 | [viewPurple.layer setCornerRadius:viewPurple.bounds.size.height/2]; 47 | [viewBlack.layer setCornerRadius:viewBlack.bounds.size.height/2]; 48 | [viewRed.layer setCornerRadius:viewRed.bounds.size.height/2]; 49 | 50 | // Do any additional setup after loading the view from its nib. 51 | } 52 | 53 | - (void)didReceiveMemoryWarning 54 | { 55 | [super didReceiveMemoryWarning]; 56 | // Dispose of any resources that can be recreated. 57 | } 58 | 59 | - (void)viewDidUnload { 60 | viewMajenta = nil; 61 | viewBrown = nil; 62 | viewOrange = nil; 63 | viewBlue = nil; 64 | viewGray = nil; 65 | viewGreen = nil; 66 | viewPurple = nil; 67 | viewBlack = nil; 68 | viewRed = nil; 69 | [super viewDidUnload]; 70 | } 71 | @end 72 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/TransformInfoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TransformInfoViewController.h 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/19/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TransformInfoViewController : UIViewController 12 | { 13 | IBOutlet UIView *viewRed; 14 | IBOutlet UIView *viewGreen; 15 | 16 | } 17 | @end 18 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/TransformInfoViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TransformInfoViewController.m 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/19/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "TransformInfoViewController.h" 10 | #import 11 | 12 | @interface TransformInfoViewController () 13 | 14 | @end 15 | 16 | @implementation TransformInfoViewController 17 | 18 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 19 | { 20 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 21 | if (self) { 22 | // Custom initialization 23 | } 24 | return self; 25 | } 26 | 27 | - (IBAction)doneClicked:(UIBarButtonItem *)sender { 28 | [self dismissModalViewControllerAnimated:YES]; 29 | } 30 | 31 | - (void)viewDidLoad 32 | { 33 | [super viewDidLoad]; 34 | 35 | [viewRed setBackgroundColor:[UIColor clearColor]]; 36 | [viewRed.layer setBorderColor:[UIColor redColor].CGColor]; 37 | [viewRed.layer setBorderWidth:1.0]; 38 | 39 | [viewGreen setBackgroundColor:[UIColor clearColor]]; 40 | [viewGreen.layer setBorderColor:[UIColor greenColor].CGColor]; 41 | [viewGreen.layer setBorderWidth:1.0]; 42 | 43 | // Do any additional setup after loading the view from its nib. 44 | } 45 | 46 | - (void)didReceiveMemoryWarning 47 | { 48 | [super didReceiveMemoryWarning]; 49 | // Dispose of any resources that can be recreated. 50 | } 51 | 52 | - (void)viewDidUnload { 53 | viewRed = nil; 54 | viewGreen = nil; 55 | [super viewDidUnload]; 56 | } 57 | @end 58 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/TransformInfoViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1552 5 | 12C54 6 | 3084 7 | 1187.34 8 | 625.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 2083 12 | 13 | 14 | IBProxyObject 15 | IBUIBarButtonItem 16 | IBUILabel 17 | IBUINavigationBar 18 | IBUINavigationItem 19 | IBUIView 20 | 21 | 22 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 23 | 24 | 25 | PluginDependencyRecalculationVersion 26 | 27 | 28 | 29 | 30 | IBFilesOwner 31 | IBCocoaTouchFramework 32 | 33 | 34 | IBFirstResponder 35 | IBCocoaTouchFramework 36 | 37 | 38 | 39 | 274 40 | 41 | 42 | 43 | 274 44 | {{20, 60}, {60, 60}} 45 | 46 | 47 | 48 | _NS:9 49 | 50 | 1 51 | MSAwIDAAA 52 | 53 | IBCocoaTouchFramework 54 | 55 | 56 | 57 | 274 58 | 59 | {{20, 140}, {60, 60}} 60 | 61 | 62 | 63 | _NS:9 64 | 65 | 1 66 | MCAxIDAAA 67 | 68 | IBCocoaTouchFramework 69 | 70 | 71 | 72 | 292 73 | {{150, 80}, {150, 20}} 74 | 75 | 76 | 77 | _NS:9 78 | NO 79 | YES 80 | 7 81 | NO 82 | IBCocoaTouchFramework 83 | IQRectAspectFit; 84 | 85 | 1 86 | MCAwIDAAA 87 | darkTextColor 88 | 89 | 90 | 0 91 | 0 92 | 93 | 2 94 | 12 95 | 96 | 97 | Helvetica-Bold 98 | 12 99 | 16 100 | 101 | NO 102 | 150 103 | 104 | 105 | 106 | 290 107 | {320, 44} 108 | 109 | 110 | 111 | _NS:9 112 | IBCocoaTouchFramework 113 | 114 | 115 | 116 | Info 117 | 118 | IBCocoaTouchFramework 119 | 1 120 | 121 | 0 122 | 123 | IBCocoaTouchFramework 124 | 125 | 126 | 127 | 128 | 129 | 292 130 | {{150, 160}, {150, 20}} 131 | 132 | 133 | _NS:9 134 | NO 135 | YES 136 | 7 137 | NO 138 | IBCocoaTouchFramework 139 | IQRectAspectFillRect; 140 | 141 | 142 | 0 143 | 0 144 | 145 | 146 | NO 147 | 150 148 | 149 | 150 | {{0, 20}, {320, 460}} 151 | 152 | 153 | 154 | 155 | 3 156 | MQA 157 | 158 | 2 159 | 160 | 161 | 162 | 163 | IBUIScreenMetrics 164 | 165 | YES 166 | 167 | 168 | 169 | 170 | 171 | {320, 480} 172 | {480, 320} 173 | 174 | 175 | IBCocoaTouchFramework 176 | Retina 3.5 Full Screen 177 | 0 178 | 179 | IBCocoaTouchFramework 180 | 181 | 182 | 183 | 184 | 185 | 186 | view 187 | 188 | 189 | 190 | 3 191 | 192 | 193 | 194 | viewRed 195 | 196 | 197 | 198 | 36 199 | 200 | 201 | 202 | viewGreen 203 | 204 | 205 | 206 | 37 207 | 208 | 209 | 210 | doneClicked: 211 | 212 | 213 | 214 | 38 215 | 216 | 217 | 218 | 219 | 220 | 0 221 | 222 | 223 | 224 | 225 | 226 | 1 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | -1 239 | 240 | 241 | File's Owner 242 | 243 | 244 | -2 245 | 246 | 247 | 248 | 249 | 4 250 | 251 | 252 | 253 | 254 | 9 255 | 256 | 257 | 258 | 259 | 12 260 | 261 | 262 | 263 | 264 | 13 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 19 273 | 274 | 275 | 276 | 277 | 34 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 35 286 | 287 | 288 | 289 | 290 | 291 | 292 | TransformInfoViewController 293 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 294 | UIResponder 295 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 296 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 297 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 298 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 299 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 300 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 301 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 302 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 303 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 304 | 305 | 306 | 307 | 308 | 309 | 38 310 | 311 | 312 | 313 | 314 | TransformInfoViewController 315 | UIViewController 316 | 317 | doneClicked: 318 | UIBarButtonItem 319 | 320 | 321 | doneClicked: 322 | 323 | doneClicked: 324 | UIBarButtonItem 325 | 326 | 327 | 328 | UIView 329 | UIView 330 | 331 | 332 | 333 | viewGreen 334 | UIView 335 | 336 | 337 | viewRed 338 | UIView 339 | 340 | 341 | 342 | IBProjectSource 343 | ./Classes/TransformInfoViewController.h 344 | 345 | 346 | 347 | 348 | 0 349 | IBCocoaTouchFramework 350 | YES 351 | 3 352 | 2083 353 | 354 | 355 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/TransformViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TransformViewController.h 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/17/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TransformViewController : UIViewController 12 | { 13 | IBOutlet UIImageView *myImageView; 14 | IBOutlet UILabel *labelScale; 15 | IBOutlet UILabel *labelAngle; 16 | 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/TransformViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TransformViewController.m 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/17/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "TransformViewController.h" 10 | #import "TransformInfoViewController.h" 11 | #import "IQGeometry.h" 12 | #import 13 | 14 | @interface TransformViewController () 15 | 16 | @end 17 | 18 | @implementation TransformViewController 19 | { 20 | UIView *aspectFitView; 21 | UIView *aspectFillView; 22 | } 23 | 24 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 25 | { 26 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 27 | if (self) { 28 | // Custom initialization 29 | } 30 | return self; 31 | } 32 | 33 | 34 | - (IBAction)infoClicked:(UIButton *)sender { 35 | TransformInfoViewController *info = [[TransformInfoViewController alloc] init]; 36 | [info setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal]; 37 | [self presentViewController:info animated:YES completion:nil]; 38 | } 39 | 40 | 41 | - (void)viewDidLoad 42 | { 43 | [super viewDidLoad]; 44 | 45 | 46 | UIButton *button = [UIButton buttonWithType:UIButtonTypeInfoLight]; 47 | [button addTarget:self action:@selector(infoClicked:) forControlEvents:UIControlEventTouchUpInside]; 48 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button]; 49 | 50 | 51 | 52 | aspectFitView = [[UIView alloc] init]; 53 | [aspectFitView setUserInteractionEnabled:NO]; 54 | [aspectFitView.layer setBorderColor:[UIColor redColor].CGColor]; 55 | [aspectFitView.layer setBorderWidth:1.0]; 56 | [self.view addSubview:aspectFitView]; 57 | 58 | aspectFillView = [[UIView alloc] init]; 59 | [aspectFillView setUserInteractionEnabled:NO]; 60 | [aspectFillView.layer setBorderColor:[UIColor greenColor].CGColor]; 61 | [aspectFillView.layer setBorderWidth:1.0]; 62 | [self.view addSubview:aspectFillView]; 63 | 64 | UIRotationGestureRecognizer *rotateGesture = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(rotateGestureRecognized:)]; 65 | rotateGesture.delegate = self; 66 | UIPinchGestureRecognizer *pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchGestureRecognized:)]; 67 | pinchGesture.delegate = self; 68 | 69 | [myImageView.layer setBorderColor:[UIColor blackColor].CGColor]; 70 | [myImageView.layer setBorderWidth:1.0]; 71 | 72 | [myImageView addGestureRecognizer:rotateGesture]; 73 | [myImageView addGestureRecognizer:pinchGesture]; 74 | } 75 | 76 | -(void)viewWillAppear:(BOOL)animated 77 | { 78 | [super viewWillAppear:animated]; 79 | [self updateUI]; 80 | } 81 | 82 | 83 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer 84 | { 85 | return YES; 86 | } 87 | 88 | -(void)updateUI 89 | { 90 | [labelAngle setText:[NSString stringWithFormat:@"%.2f", IQRadianToDegree(IQAffineTransformGetAngle(myImageView.transform))]]; 91 | CGSize scale = IQAffineTransformGetScale(myImageView.transform); 92 | [labelScale setText:[NSString stringWithFormat:@"{%.2f, %.2f}",scale.width, scale.height]]; 93 | 94 | aspectFitView.frame = IQRectAspectFit(myImageView.image.size, myImageView.frame); 95 | aspectFitView.center = myImageView.center; 96 | 97 | aspectFillView.frame = IQRectAspectFillRect(myImageView.image.size, myImageView.frame); 98 | aspectFillView.center = myImageView.center; 99 | } 100 | 101 | 102 | -(void)rotateGestureRecognized:(UIRotationGestureRecognizer*)gesture 103 | { 104 | [myImageView setTransform:CGAffineTransformRotate(myImageView.transform, gesture.rotation)]; 105 | gesture.rotation = 0; 106 | [self updateUI]; 107 | } 108 | 109 | -(void)pinchGestureRecognized:(UIPinchGestureRecognizer*)gesture 110 | { 111 | [myImageView setTransform:CGAffineTransformScale(myImageView.transform, gesture.scale, gesture.scale)]; 112 | gesture.scale = 1.0; 113 | [self updateUI]; 114 | } 115 | 116 | 117 | - (void)didReceiveMemoryWarning 118 | { 119 | [super didReceiveMemoryWarning]; 120 | // Dispose of any resources that can be recreated. 121 | } 122 | 123 | - (void)viewDidUnload { 124 | myImageView = nil; 125 | labelScale = nil; 126 | labelAngle = nil; 127 | [super viewDidUnload]; 128 | } 129 | @end 130 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/TransformViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1552 5 | 12C54 6 | 3084 7 | 1187.34 8 | 625.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 2083 12 | 13 | 14 | IBProxyObject 15 | IBUIImageView 16 | IBUILabel 17 | IBUIView 18 | 19 | 20 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 21 | 22 | 23 | PluginDependencyRecalculationVersion 24 | 25 | 26 | 27 | 28 | IBFilesOwner 29 | IBCocoaTouchFramework 30 | 31 | 32 | IBFirstResponder 33 | IBCocoaTouchFramework 34 | 35 | 36 | 37 | 274 38 | 39 | 40 | 41 | 274 42 | {{80, 80}, {133, 163}} 43 | 44 | 45 | 46 | _NS:9 47 | 0.69999998807907104 48 | 1 49 | IBCocoaTouchFramework 50 | 51 | NSImage 52 | sample1.jpeg 53 | 54 | 55 | 56 | 57 | 301 58 | {{10, 410}, {150, 21}} 59 | 60 | 61 | 62 | _NS:9 63 | NO 64 | YES 65 | 7 66 | NO 67 | IBCocoaTouchFramework 68 | Scale 69 | 70 | 1 71 | MCAwIDAAA 72 | darkTextColor 73 | 74 | 75 | 0 76 | 77 | 1 78 | 17 79 | 80 | 81 | Helvetica 82 | 17 83 | 16 84 | 85 | NO 86 | 87 | 88 | 89 | 301 90 | {{10, 439}, {150, 21}} 91 | 92 | 93 | 94 | _NS:9 95 | NO 96 | YES 97 | 7 98 | NO 99 | IBCocoaTouchFramework 100 | Angle 101 | 102 | 103 | 0 104 | 105 | 106 | NO 107 | 108 | 109 | 110 | 301 111 | {{160, 410}, {150, 21}} 112 | 113 | 114 | 115 | _NS:9 116 | NO 117 | YES 118 | 7 119 | NO 120 | IBCocoaTouchFramework 121 | 0 122 | 123 | 124 | 0 125 | 126 | 127 | NO 128 | 129 | 130 | 131 | 301 132 | {{160, 439}, {150, 21}} 133 | 134 | 135 | _NS:9 136 | NO 137 | YES 138 | 7 139 | NO 140 | IBCocoaTouchFramework 141 | 0 142 | 143 | 144 | 0 145 | 146 | 147 | NO 148 | 149 | 150 | {{0, 20}, {320, 460}} 151 | 152 | 153 | 154 | 155 | 3 156 | MQA 157 | 158 | 2 159 | 160 | 161 | 162 | 163 | IBUIScreenMetrics 164 | 165 | YES 166 | 167 | 168 | 169 | 170 | 171 | {320, 480} 172 | {480, 320} 173 | 174 | 175 | IBCocoaTouchFramework 176 | Retina 3.5 Full Screen 177 | 0 178 | 179 | IBCocoaTouchFramework 180 | 181 | 182 | 183 | 184 | 185 | 186 | view 187 | 188 | 189 | 190 | 3 191 | 192 | 193 | 194 | myImageView 195 | 196 | 197 | 198 | 5 199 | 200 | 201 | 202 | labelScale 203 | 204 | 205 | 206 | 11 207 | 208 | 209 | 210 | labelAngle 211 | 212 | 213 | 214 | 12 215 | 216 | 217 | 218 | 219 | 220 | 0 221 | 222 | 223 | 224 | 225 | 226 | 1 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | -1 239 | 240 | 241 | File's Owner 242 | 243 | 244 | -2 245 | 246 | 247 | 248 | 249 | 4 250 | 251 | 252 | 253 | 254 | 7 255 | 256 | 257 | 258 | 259 | 8 260 | 261 | 262 | 263 | 264 | 9 265 | 266 | 267 | 268 | 269 | 10 270 | 271 | 272 | 273 | 274 | 275 | 276 | TransformViewController 277 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 278 | UIResponder 279 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 280 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 281 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 282 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 283 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 284 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 285 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 286 | 287 | 288 | 289 | 290 | 291 | 12 292 | 293 | 294 | 295 | 296 | TransformViewController 297 | UIViewController 298 | 299 | infoClicked: 300 | UIButton 301 | 302 | 303 | infoClicked: 304 | 305 | infoClicked: 306 | UIButton 307 | 308 | 309 | 310 | UILabel 311 | UILabel 312 | UIImageView 313 | 314 | 315 | 316 | labelAngle 317 | UILabel 318 | 319 | 320 | labelScale 321 | UILabel 322 | 323 | 324 | myImageView 325 | UIImageView 326 | 327 | 328 | 329 | IBProjectSource 330 | ./Classes/TransformViewController.h 331 | 332 | 333 | 334 | 335 | 0 336 | IBCocoaTouchFramework 337 | YES 338 | 3 339 | 340 | sample1.jpeg 341 | {181, 278} 342 | 343 | 2083 344 | 345 | 346 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/17/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | { 13 | IBOutlet UITableView *tableViewGeometry; 14 | 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/17/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "AngleViewController.h" 11 | #import "TransformViewController.h" 12 | 13 | @interface ViewController () 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | { 19 | NSArray *demonstrations; 20 | } 21 | 22 | - (void)viewDidLoad 23 | { 24 | [super viewDidLoad]; 25 | 26 | self.title = @"Geometry Demo"; 27 | 28 | demonstrations = [[NSArray alloc] initWithObjects: 29 | @"Angle+Point+Distance", 30 | @"AffineTransform+Rect", 31 | nil]; 32 | 33 | // Do any additional setup after loading the view, typically from a nib. 34 | } 35 | 36 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 37 | { 38 | return demonstrations.count; 39 | } 40 | 41 | -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 42 | { 43 | UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil]; 44 | 45 | [cell.textLabel setText:[demonstrations objectAtIndex:indexPath.row]]; 46 | 47 | return cell; 48 | } 49 | 50 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 51 | { 52 | switch (indexPath.row) 53 | { 54 | case 0: 55 | [self.navigationController pushViewController:[[AngleViewController alloc] init] animated:YES]; 56 | break; 57 | 58 | case 1: 59 | [self.navigationController pushViewController:[[TransformViewController alloc] init] animated:YES]; 60 | break; 61 | 62 | default: 63 | break; 64 | } 65 | 66 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 67 | } 68 | 69 | - (void)didReceiveMemoryWarning 70 | { 71 | [super didReceiveMemoryWarning]; 72 | // Dispose of any resources that can be recreated. 73 | } 74 | 75 | - (void)viewDidUnload { 76 | tableViewGeometry = nil; 77 | [super viewDidUnload]; 78 | } 79 | @end 80 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/en.lproj/ViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1552 5 | 12C54 6 | 3084 7 | 1187.34 8 | 625.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 2083 12 | 13 | 14 | IBProxyObject 15 | IBUITableView 16 | IBUIView 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 274 41 | {320, 460} 42 | 43 | 44 | _NS:9 45 | 46 | 3 47 | MQA 48 | 49 | YES 50 | IBCocoaTouchFramework 51 | YES 52 | 1 53 | 0 54 | YES 55 | 44 56 | 22 57 | 22 58 | 59 | 60 | {{0, 20}, {320, 460}} 61 | 62 | 63 | 64 | 65 | 3 66 | MC43NQA 67 | 68 | 2 69 | 70 | 71 | NO 72 | 73 | 74 | IBUIScreenMetrics 75 | 76 | YES 77 | 78 | 79 | 80 | 81 | 82 | {320, 480} 83 | {480, 320} 84 | 85 | 86 | IBCocoaTouchFramework 87 | Retina 3.5 Full Screen 88 | 0 89 | 90 | IBCocoaTouchFramework 91 | 92 | 93 | 94 | 95 | 96 | 97 | view 98 | 99 | 100 | 101 | 7 102 | 103 | 104 | 105 | tableViewGeometry 106 | 107 | 108 | 109 | 9 110 | 111 | 112 | 113 | dataSource 114 | 115 | 116 | 117 | 10 118 | 119 | 120 | 121 | delegate 122 | 123 | 124 | 125 | 11 126 | 127 | 128 | 129 | 130 | 131 | 0 132 | 133 | 134 | 135 | 136 | 137 | -1 138 | 139 | 140 | File's Owner 141 | 142 | 143 | -2 144 | 145 | 146 | 147 | 148 | 6 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 8 157 | 158 | 159 | 160 | 161 | 162 | 163 | ViewController 164 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 165 | UIResponder 166 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 167 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 168 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 169 | 170 | 171 | 172 | 173 | 174 | 11 175 | 176 | 177 | 178 | 179 | ViewController 180 | UIViewController 181 | 182 | tableViewGeometry 183 | UITableView 184 | 185 | 186 | tableViewGeometry 187 | 188 | tableViewGeometry 189 | UITableView 190 | 191 | 192 | 193 | IBProjectSource 194 | ./Classes/ViewController.h 195 | 196 | 197 | 198 | 199 | 0 200 | IBCocoaTouchFramework 201 | YES 202 | 3 203 | 2083 204 | 205 | 206 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // GeometryDemo 4 | // 5 | // Created by Iftekhar Mac Pro on 9/17/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /GeometryDemo/GeometryDemo/sample1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackiftekhar/IQGeometry/41a80b808e6f58199c2ea2b7cb813a8add327a4c/GeometryDemo/GeometryDemo/sample1.jpeg -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry+AffineTransform.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry+CGAffineTransform.h 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | CGFloat IQAffineTransformGetAngle(CGAffineTransform t); 12 | 13 | CGSize IQAffineTransformGetScale(CGAffineTransform t); 14 | 15 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry+AffineTransform.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry+CGAffineTransform.m 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "IQGeometry+AffineTransform.h" 10 | 11 | CGFloat IQAffineTransformGetAngle(CGAffineTransform t) 12 | { 13 | return atan2(t.b, t.a); 14 | } 15 | 16 | CGSize IQAffineTransformGetScale(CGAffineTransform t) 17 | { 18 | return CGSizeMake(sqrt(t.a * t.a + t.c * t.c), sqrt(t.b * t.b + t.d * t.d)) ; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry+Angle.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry+Angle.h 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /*Angle conversion*/ 12 | CGFloat IQDegreeToRadian(CGFloat angle); 13 | CGFloat IQRadianToDegree(CGFloat radians); 14 | 15 | /*Angle between two point*/ 16 | // Say the distances are P1-P2 = A, P2-P3 = B and P3-P1 = C: 17 | // Angle = arccos ( (B^2-A^2-C^2) / 2AC ) 18 | CGFloat IQPointGetAngle(CGPoint centerPoint, CGPoint point1, CGPoint point2); 19 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry+Angle.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry+Angle.m 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "IQGeometry+Angle.h" 10 | #import "IQGeometry+Distance.h" 11 | 12 | CGFloat IQDegreeToRadian(CGFloat angle) 13 | { 14 | return angle*(M_PI/180.0); 15 | } 16 | 17 | CGFloat IQRadianToDegree(CGFloat radians) 18 | { 19 | return radians*(180.0/M_PI); 20 | } 21 | 22 | CGFloat IQPointGetAngle(CGPoint centerPoint, CGPoint point1, CGPoint point2) 23 | { 24 | //Find angle. 25 | CGFloat angle = atan2(point2.y-centerPoint.y, point2.x-centerPoint.x) - atan2(point1.y-centerPoint.y, point1.x-centerPoint.x); 26 | 27 | //If angle is less than 0. then adding 360 degree to it. 28 | return (angle>0 ? angle : angle+M_PI*2); 29 | } 30 | 31 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry+Distance.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry+Distance.h 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /* 12 | A (x1, y1) and B (x2, y2) = sqrt( (x2−x1)2+(y2−y1)2) 13 | */ 14 | CGFloat IQPointGetDistance(CGPoint point1, CGPoint point2); 15 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry+Distance.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry+Distance.m 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "IQGeometry+Distance.h" 10 | 11 | CGFloat IQPointGetDistance(CGPoint point1, CGPoint point2) 12 | { 13 | //Saving Variables. 14 | CGFloat fx = (point2.x - point1.x); 15 | CGFloat fy = (point2.y - point1.y); 16 | 17 | return sqrt((fx*fx + fy*fy)); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry+Line.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry+CGLine.h 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | struct IQLine { 12 | CGPoint beginPoint; 13 | CGPoint endPoint; 14 | }; 15 | typedef struct IQLine IQLine; 16 | 17 | IQLine IQLineMake(CGPoint beginPoint, CGPoint endPoint); 18 | 19 | 20 | 21 | @interface NSValue (Line) 22 | 23 | + (id)valueWithIQLine:(IQLine)line; 24 | 25 | - (IQLine)lineValue; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry+Line.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry+CGLine.m 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "IQGeometry+Line.h" 10 | 11 | IQLine IQLineMake(CGPoint beginPoint, CGPoint endPoint) 12 | { 13 | IQLine line; line.beginPoint = beginPoint; line.endPoint = endPoint; return line; 14 | } 15 | 16 | 17 | 18 | @implementation NSValue (Line) 19 | 20 | + (id)valueWithIQLine:(IQLine)line 21 | { 22 | return [NSValue value:&line withObjCType:@encode(IQLine)]; 23 | } 24 | 25 | - (IQLine)lineValue; 26 | { 27 | IQLine line; [self getValue:&line]; return line; 28 | } 29 | 30 | @end -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry+Point.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry+CGPoint.h 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "IQGeometry+Line.h" 11 | 12 | CGPoint IQPointGetMidPoint(CGPoint point1, CGPoint point2); 13 | 14 | /* (x1,y1) (x,y) (x2,y2) */ 15 | /* *-----------------*----------------------------------* */ 16 | /* <----distance-----> */ 17 | //Returns a point(x,y) lies between point1(x1,y1) and point2(x2,y2) by distance from point1(x1,y1). 18 | CGPoint IQPointWithDistance(CGPoint point1, CGPoint point2, CGFloat distance); 19 | 20 | /* 21 | line1.beginPoint line2.endPoint 22 | \ / 23 | \ / 24 | \/ 25 | /\ 26 | / \ 27 | / \ 28 | line2.beginPoint line1.endPoint 29 | */ 30 | CGPoint IQPointOfIntersect(IQLine line1, IQLine line2); 31 | 32 | CGFloat IQPointGetDistanceOfPoint(CGPoint point, IQLine line); 33 | 34 | /* Centroid of points, A, B and C is (x1+x2+x3)/3, (y1+y2+y3)/3 */ 35 | CGPoint IQPointCentroidOfPoints(NSArray* points); 36 | 37 | CGPoint IQPointRotate(CGPoint basePoint,CGPoint point, CGFloat angle); 38 | 39 | CGPoint IQPointGetNearPoint(CGPoint basePoint, NSArray *points); 40 | 41 | CGPoint IQPointFlipHorizontal(CGPoint point, CGRect outerRect); 42 | 43 | CGPoint IQPointFlipVertical(CGPoint point, CGRect outerRect); 44 | 45 | CGPoint IQPointAspectFill(CGPoint point, CGSize destSize, CGRect sourceRect); 46 | 47 | CGPoint IQPointOffset(CGPoint aPoint, CGFloat dx, CGFloat dy); 48 | 49 | CGPoint IQPointScale(CGPoint aPoint, CGFloat wScale, CGFloat hScale); 50 | 51 | // Flipping coordinates 52 | CGPoint IQPointFlip(CGPoint point); 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry+Point.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry+CGPoint.m 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "IQGeometry+Point.h" 10 | #import "IQGeometry+Distance.h" 11 | #import 12 | 13 | CGPoint IQPointGetMidPoint(CGPoint point1, CGPoint point2) 14 | { 15 | return CGPointMake((point1.x+point2.x)/2, (point1.y+point2.y)/2); 16 | } 17 | 18 | CGPoint IQPointWithDistance(CGPoint point1, CGPoint point2, CGFloat distance) 19 | { 20 | if (CGPointEqualToPoint(point1, point2)) 21 | { 22 | return CGPointZero; 23 | } 24 | else 25 | { 26 | //Finding relative percent from point1 till distance ( 0.0 - 1.0). 27 | CGFloat relativePercent = distance/IQPointGetDistance(point1, point2); 28 | //Calculating distance from point1. 29 | CGFloat px = point1.x + relativePercent * (point2.x - point1.x); 30 | CGFloat py = point1.y + relativePercent * (point2.y - point1.y); 31 | 32 | //Returning Points 33 | return CGPointMake(px, py); 34 | } 35 | } 36 | 37 | CGPoint IQPointOfIntersect(IQLine line1, IQLine line2) 38 | { 39 | CGFloat d = (line1.beginPoint.x-line1.endPoint.x)*(line2.beginPoint.y-line2.endPoint.y) - (line1.beginPoint.y-line1.endPoint.y)*(line2.beginPoint.x-line2.endPoint.x); 40 | 41 | CGFloat xi = ((line2.beginPoint.x-line2.endPoint.x)*(line1.beginPoint.x*line1.endPoint.y-line1.beginPoint.y*line1.endPoint.x)-(line1.beginPoint.x-line1.endPoint.x)*(line2.beginPoint.x*line2.endPoint.y-line2.beginPoint.y*line2.endPoint.x))/d; 42 | CGFloat yi = ((line2.beginPoint.y-line2.endPoint.y)*(line1.beginPoint.x*line1.endPoint.y-line1.beginPoint.y*line1.endPoint.x)-(line1.beginPoint.y-line1.endPoint.y)*(line2.beginPoint.x*line2.endPoint.y-line2.beginPoint.y*line2.endPoint.x))/d; 43 | 44 | return CGPointMake(xi, yi); 45 | } 46 | 47 | CGFloat IQPointGetDistanceOfPoint(CGPoint point, IQLine line) 48 | { 49 | CGFloat normalLength = sqrt((line.endPoint.x-line.beginPoint.x)*(line.endPoint.x-line.beginPoint.x)+(line.endPoint.y-line.beginPoint.y)*(line.endPoint.y-line.beginPoint.y)); 50 | return abs((point.x-line.beginPoint.x)*(line.endPoint.y-line.beginPoint.y)-(point.y-line.beginPoint.y)*(line.endPoint.x-line.beginPoint.x))/normalLength; 51 | } 52 | 53 | CGPoint IQPointCentroidOfPoints(NSArray* points) 54 | { 55 | CGFloat x = 0; 56 | CGFloat y = 0; 57 | 58 | for (NSValue *value in points) 59 | { 60 | x += [value CGPointValue].x; 61 | y += [value CGPointValue].y; 62 | } 63 | 64 | x = x/[points count]; 65 | y = y/[points count]; 66 | 67 | return CGPointMake(x, y); 68 | } 69 | 70 | CGPoint IQPointRotate(CGPoint basePoint, CGPoint point, CGFloat angle) 71 | { 72 | CGFloat x = cos(angle) * (point.x-basePoint.x) - sin(angle) * (point.y-basePoint.y) + basePoint.x; 73 | CGFloat y = sin(angle) * (point.x-basePoint.x) + cos(angle) * (point.y-basePoint.y) + basePoint.y; 74 | 75 | // CGFloat x = cos(angle) * (basePoint.x-point.x) - sin(angle) * (basePoint.y-point.y) + point.x; 76 | // CGFloat y = sin(angle) * (basePoint.x-point.x) + cos(angle) * (basePoint.y-point.y) + point.y; 77 | 78 | return CGPointMake(x,y); 79 | } 80 | 81 | CGPoint IQPointGetNearPoint(CGPoint basePoint, NSArray *points) 82 | { 83 | CGFloat minimumDistance = 10000; 84 | CGPoint nearbyPoint; 85 | 86 | for (NSValue *aValue in points) 87 | { 88 | CGPoint aPoint = [aValue CGPointValue]; 89 | 90 | CGFloat currentDistance = IQPointGetDistance(basePoint, aPoint); 91 | if (minimumDistance>currentDistance) 92 | { 93 | nearbyPoint = aPoint; 94 | minimumDistance = currentDistance; 95 | } 96 | } 97 | return nearbyPoint; 98 | } 99 | 100 | //CGPoint CGPointAspectFit(CGPoint point, CGSize destSize, CGRect sourceRect) 101 | //{ 102 | // CGRect innerRect = CGRectAspectFitRect(destSize, sourceRect); 103 | // 104 | // point = CGPointAspectFill(point, destSize, sourceRect); 105 | // 106 | // CGFloat ratioPointWidth = point.x/CGRectGetWidth(sourceRect); 107 | // CGFloat ratioPointHeight = point.y/CGRectGetHeight(sourceRect); 108 | // 109 | // CGFloat pointX = (innerRect.origin.x+CGRectGetWidth(innerRect)*ratioPointWidth);; 110 | // CGFloat pointY = (innerRect.origin.y+CGRectGetHeight(innerRect)*ratioPointHeight); 111 | // 112 | // return CGPointMake(pointX, pointY); 113 | //} 114 | 115 | CGPoint IQPointFlipHorizontal(CGPoint point, CGRect outerRect) 116 | { 117 | CGPoint newPoint = point; 118 | newPoint.x = outerRect.origin.x + outerRect.size.width - point.x; 119 | return newPoint; 120 | 121 | } 122 | 123 | CGPoint IQPointFlipVertical(CGPoint point, CGRect outerRect) 124 | { 125 | CGPoint newPoint = point; 126 | newPoint.y = outerRect.origin.y + outerRect.size.height - point.y; 127 | return newPoint; 128 | } 129 | 130 | CGPoint IQPointAspectFill(CGPoint point, CGSize destSize, CGRect sourceRect) 131 | { 132 | return CGPointMake(point.x*(sourceRect.size.width/destSize.width), point.y*(sourceRect.size.height/destSize.height)); 133 | } 134 | 135 | CGPoint IQPointOffset(CGPoint aPoint, CGFloat dx, CGFloat dy) 136 | { 137 | return CGPointMake(aPoint.x + dx, aPoint.y + dy); 138 | } 139 | 140 | CGPoint IQPointScale(CGPoint aPoint, CGFloat wScale, CGFloat hScale) 141 | { 142 | return CGPointMake(aPoint.x * wScale, aPoint.y * hScale); 143 | } 144 | 145 | CGPoint IQPointFlip(CGPoint point) 146 | { 147 | return CGPointMake(point.y, point.x); 148 | } 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry+Rect.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry+Convenience.h 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /*Set Origin*/ 12 | CGRect IQRectSetX(CGRect rect, CGFloat x); 13 | CGRect IQRectSetY(CGRect rect, CGFloat y); 14 | CGRect IQRectSetOrigin(CGRect rect, CGPoint origin); 15 | CGRect IQRectMakeOrigin(CGRect rect, CGFloat x, CGFloat y); 16 | 17 | /*Set Size*/ 18 | CGRect IQRectSetHeight(CGRect rect, CGFloat height); 19 | CGRect IQRectSetWidth(CGRect rect, CGFloat width); 20 | CGRect IQRectSetSize(CGRect rect, CGSize size); 21 | CGRect IQRectMakeSize(CGRect rect, CGFloat width, CGFloat height); 22 | 23 | /*Set Center*/ 24 | CGRect IQRectSetCenter(CGRect rect, CGPoint center); 25 | CGPoint IQRectGetCenter(CGRect rect); 26 | CGRect IQRectWithCenterSize(CGPoint center, CGSize size); 27 | CGRect IQRectCenteredInRect(CGRect rect, CGRect mainRect); 28 | 29 | /*Rect from Points*/ 30 | CGRect IQRectFromPoint(CGPoint startPoint, CGPoint endPoint); 31 | 32 | /*Flip Rect Origin and Size*/ 33 | CGRect IQRectFlipHorizontal(CGRect rect, CGRect outerRect); 34 | CGRect IQRectFlipVertical(CGRect rect, CGRect outerRect); 35 | CGRect IQRectFlipFlop(CGRect rect); 36 | // Does not affect size 37 | CGRect IQRectFlipOrigin(CGRect rect); 38 | // Does not affect point of origin 39 | CGRect IQRectFlipSize(CGRect rect); 40 | 41 | /*Scale*/ 42 | CGRect IQRectScale(CGRect rect, CGFloat wScale, CGFloat hScale); 43 | CGRect IQRectScaleOrigin(CGRect rect, CGFloat wScale, CGFloat hScale); 44 | CGRect IQRectScaleSize(CGRect rect, CGFloat wScale, CGFloat hScale); 45 | 46 | /*Aspect Fit*/ 47 | CGRect IQRectAspectFit(CGSize sourceSize, CGRect destRect); 48 | CGFloat IQAspectScaleFit(CGSize sourceSize, CGRect destRect); 49 | // Only scales down, not up, and centers result 50 | CGRect IQRectFitSizeInRect(CGSize sourceSize, CGRect destRect); 51 | 52 | /*Aspect Fill*/ 53 | CGRect IQRectAspectFillRect(CGSize sourceSize, CGRect destRect); 54 | CGFloat IQAspectScaleFill(CGSize sourceSize, CGRect destRect); 55 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry+Rect.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry+Convenience.m 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "IQGeometry+Rect.h" 10 | #import "IQGeometry+Size.h" 11 | 12 | CGRect IQRectSetX(CGRect rect, CGFloat x) 13 | { 14 | rect.origin.x = x; return rect; 15 | } 16 | 17 | CGRect IQRectSetY(CGRect rect, CGFloat y) 18 | { 19 | rect.origin.y = y; return rect; 20 | } 21 | 22 | CGRect IQRectSetOrigin(CGRect rect, CGPoint origin) 23 | { 24 | rect.origin = origin; return rect; 25 | } 26 | 27 | CGRect IQRectMakeOrigin(CGRect rect, CGFloat x, CGFloat y) 28 | { 29 | rect.origin = CGPointMake(x, y); return rect; 30 | } 31 | 32 | 33 | CGRect IQRectSetWidth(CGRect rect, CGFloat width) 34 | { 35 | rect.size.width = width; return rect; 36 | } 37 | 38 | CGRect IQRectSetHeight(CGRect rect, CGFloat height) 39 | { 40 | rect.size.height = height; return rect; 41 | } 42 | 43 | CGRect IQRectSetSize(CGRect rect, CGSize size) 44 | { 45 | rect.size = size; return rect; 46 | } 47 | 48 | CGRect IQRectMakeSize(CGRect rect, CGFloat width, CGFloat height) 49 | { 50 | rect.size = CGSizeMake(width, height); return rect; 51 | } 52 | 53 | 54 | 55 | CGRect IQRectFromPoint(CGPoint startPoint, CGPoint endPoint) 56 | { 57 | return CGRectMake(startPoint.x, startPoint.y, endPoint.x-startPoint.x, endPoint.y-startPoint.y); 58 | } 59 | 60 | CGRect IQRectSetCenter(CGRect rect, CGPoint center) 61 | { 62 | return CGRectMake(center.x-CGRectGetWidth(rect)/2, center.y-CGRectGetHeight(rect)/2, CGRectGetWidth(rect), CGRectGetHeight(rect)); 63 | } 64 | 65 | CGPoint IQRectGetCenter(CGRect rect) 66 | { 67 | return CGPointMake(rect.origin.x+rect.size.width/2, rect.origin.y+rect.size.height/2); 68 | } 69 | 70 | CGRect IQRectWithCenterSize(CGPoint center, CGSize size) 71 | { 72 | return CGRectMake(center.x - size.width/2, center.y - size.height/2, size.width, size.height); 73 | } 74 | 75 | CGRect IQRectCenteredInRect(CGRect rect, CGRect mainRect) 76 | { 77 | CGFloat dx = CGRectGetMidX(mainRect)-CGRectGetMidX(rect); 78 | CGFloat dy = CGRectGetMidY(mainRect)-CGRectGetMidY(rect); 79 | return CGRectOffset(rect, dx, dy); 80 | } 81 | 82 | CGRect IQRectFlipHorizontal(CGRect innerRect, CGRect outerRect) 83 | { 84 | CGRect rect = innerRect; 85 | rect.origin.x = outerRect.origin.x + outerRect.size.width - (rect.origin.x + rect.size.width); 86 | return rect; 87 | } 88 | 89 | CGRect IQRectFlipVertical(CGRect innerRect, CGRect outerRect) 90 | { 91 | CGRect rect = innerRect; 92 | rect.origin.y = outerRect.origin.y + outerRect.size.height - (rect.origin.y + rect.size.height); 93 | return rect; 94 | } 95 | 96 | CGRect IQRectScale(CGRect rect, CGFloat wScale, CGFloat hScale) 97 | { 98 | return CGRectMake(rect.origin.x * wScale, rect.origin.y * hScale, rect.size.width * wScale, rect.size.height * hScale); 99 | } 100 | 101 | CGRect IQRectScaleSize(CGRect rect, CGFloat wScale, CGFloat hScale) 102 | { 103 | return CGRectMake(rect.origin.x, rect.origin.y, rect.size.width * wScale, rect.size.height * hScale); 104 | } 105 | 106 | CGRect IQRectScaleOrigin(CGRect rect, CGFloat wScale, CGFloat hScale) 107 | { 108 | return CGRectMake(rect.origin.x * wScale, rect.origin.y * hScale, rect.size.width, rect.size.height); 109 | } 110 | 111 | CGRect IQRectFitSizeInRect(CGSize sourceSize, CGRect destRect) 112 | { 113 | CGSize destSize = destRect.size; 114 | CGSize targetSize = IQSizeFitInSize(sourceSize, destSize); 115 | float dWidth = destSize.width - targetSize.width; 116 | float dHeight = destSize.height - targetSize.height; 117 | 118 | return CGRectMake(dWidth / 2.0f, dHeight / 2.0f, targetSize.width, targetSize.height); 119 | } 120 | 121 | CGFloat IQAspectScaleFill(CGSize sourceSize, CGRect destRect) 122 | { 123 | CGSize destSize = destRect.size; 124 | CGFloat scaleW = destSize.width / sourceSize.width; 125 | CGFloat scaleH = destSize.height / sourceSize.height; 126 | return MAX(scaleW, scaleH); 127 | } 128 | 129 | CGRect IQRectAspectFit(CGSize sourceSize, CGRect destRect) 130 | { 131 | CGSize destSize = destRect.size; 132 | CGFloat destScale = IQAspectScaleFit(sourceSize, destRect); 133 | 134 | CGFloat newWidth = sourceSize.width * destScale; 135 | CGFloat newHeight = sourceSize.height * destScale; 136 | 137 | float dWidth = ((destSize.width - newWidth) / 2.0f); 138 | float dHeight = ((destSize.height - newHeight) / 2.0f); 139 | 140 | CGRect rect = CGRectMake(dWidth, dHeight, newWidth, newHeight); 141 | return rect; 142 | } 143 | 144 | CGFloat IQAspectScaleFit(CGSize sourceSize, CGRect destRect) 145 | { 146 | CGSize destSize = destRect.size; 147 | CGFloat scaleW = destSize.width / sourceSize.width; 148 | CGFloat scaleH = destSize.height / sourceSize.height; 149 | return MIN(scaleW, scaleH); 150 | } 151 | 152 | CGRect IQRectAspectFillRect(CGSize sourceSize, CGRect destRect) 153 | { 154 | CGSize destSize = destRect.size; 155 | CGFloat destScale = IQAspectScaleFill(sourceSize, destRect); 156 | 157 | CGFloat newWidth = sourceSize.width * destScale; 158 | CGFloat newHeight = sourceSize.height * destScale; 159 | 160 | float dWidth = ((destSize.width - newWidth) / 2.0f); 161 | float dHeight = ((destSize.height - newHeight) / 2.0f); 162 | 163 | CGRect rect = CGRectMake(dWidth, dHeight, newWidth, newHeight); 164 | return rect; 165 | } 166 | 167 | CGRect IQRectFlipFlop(CGRect rect) 168 | { 169 | return CGRectMake(rect.origin.y, rect.origin.x, rect.size.height, rect.size.width); 170 | } 171 | 172 | CGRect IQRectFlipSize(CGRect rect) 173 | { 174 | return CGRectMake(rect.origin.x, rect.origin.y, rect.size.height, rect.size.width); 175 | } 176 | 177 | CGRect IQRectFlipOrigin(CGRect rect) 178 | { 179 | return CGRectMake(rect.origin.y, rect.origin.x, rect.size.width, rect.size.height); 180 | } 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry+Size.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry+CGSize.h 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | CGSize IQSizeScale(CGSize aSize, CGFloat wScale, CGFloat hScale); 12 | 13 | CGSize IQSizeFlip(CGSize size); 14 | 15 | CGSize IQSizeFitInSize(CGSize sourceSize, CGSize destSize); 16 | 17 | CGSize IQSizeGetScale(CGSize sourceSize, CGSize destSize); 18 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry+Size.m: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry+CGSize.m 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import "IQGeometry+Size.h" 10 | 11 | CGSize IQSizeScale(CGSize aSize, CGFloat wScale, CGFloat hScale) 12 | { 13 | return CGSizeMake(aSize.width * wScale, aSize.height * hScale); 14 | } 15 | 16 | CGSize IQSizeGetScale(CGSize sourceSize, CGSize destSize) 17 | { 18 | CGFloat scaleW = destSize.width / sourceSize.width; 19 | CGFloat scaleH = destSize.height / sourceSize.height; 20 | 21 | return CGSizeMake(scaleW, scaleH); 22 | } 23 | 24 | CGSize IQSizeFlip(CGSize size) 25 | { 26 | return CGSizeMake(size.height, size.width); 27 | } 28 | 29 | CGSize IQSizeFitInSize(CGSize sourceSize, CGSize destSize) 30 | { 31 | CGFloat destScale; 32 | CGSize newSize = sourceSize; 33 | 34 | if (newSize.height && (newSize.height > destSize.height)) 35 | { 36 | destScale = destSize.height / newSize.height; 37 | newSize.width *= destScale; 38 | newSize.height *= destScale; 39 | } 40 | 41 | if (newSize.width && (newSize.width >= destSize.width)) 42 | { 43 | destScale = destSize.width / newSize.width; 44 | newSize.width *= destScale; 45 | newSize.height *= destScale; 46 | } 47 | 48 | return newSize; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.iftekhar.geometry.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'IQGeometry' target in the 'IQGeometry' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/IQGeometry.h: -------------------------------------------------------------------------------- 1 | // 2 | // IQGeometry.h 3 | // Geometry Extension 4 | // 5 | // Created by Iftekhar Mac Pro on 8/25/13. 6 | // Copyright (c) 2013 Iftekhar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | -------------------------------------------------------------------------------- /GeometryDemo/IQGeometry/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Mohd Iftekhar Qurashi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | IQGeometry 2 | ========== 3 | IQGeometry is the extension of CGGeometry. It provide easy functions for Geometry calculations in iOS. 4 | 5 | LICENSE 6 | --- 7 | Distributed under the MIT License. 8 | 9 | Contributions 10 | --- 11 | Any contribution is more than welcome! You can contribute through pull requests and issues on GitHub. 12 | 13 | Author 14 | --- 15 | If you wish to contact me, email at: hack.iftekhar@gmail.com 16 | 17 | 18 | Credits 19 | ========== 20 | [iOS-5-Cookbook](https://github.com/erica/iOS-5-Cookbook/blob/master/C07/07b-Extracting%20Faces/Geometry.h). 21 | --------------------------------------------------------------------------------