├── .gitignore
├── LICENSE
├── Logo
└── logo_1024_300.png
├── README.md
├── Sensitive.podspec
├── Sensitive
├── Sensitive.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── Sensitive
│ ├── Sensitive.xcodeproj
│ │ └── project.pbxproj
│ └── Sensitive
│ │ ├── Info.plist
│ │ └── Sensitive.h
└── SensitiveDemo
│ ├── SensitiveDemo.xcodeproj
│ └── project.pbxproj
│ ├── SensitiveDemo
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── Contents.json
│ ├── Info.plist
│ └── LaunchScreen.xib
│ ├── ViewControllers
│ └── Main
│ │ ├── MainViewController.swift
│ │ └── MainViewController.xib
│ └── Views
│ └── Circle
│ └── CircleView.swift
└── Source
├── Classes
├── Gesture
│ ├── Gesture.swift
│ └── GestureRetainer.swift
└── Recognizers
│ ├── LongPress
│ └── LongPressGestureRecognizer.swift
│ ├── Pan
│ └── PanGestureRecognizer.swift
│ ├── Pinch
│ └── PinchGestureRecognizer.swift
│ ├── Rotation
│ └── RotationGestureRecognizer.swift
│ ├── ScreenEdgePan
│ └── ScreenEdgePanGestureRecognizer.swift
│ ├── Swipe
│ └── SwipeGestureRecognizer.swift
│ └── Tap
│ └── TapGestureRecognizer.swift
├── Extensions
└── View
│ └── UIViewExtensionGestures.swift
└── Types
└── GestureRecognizerHandlers.swift
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 |
4 | .*
5 | !/.gitignore
6 |
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 |
24 | # CocoaPods
25 | #
26 | # We recommend against adding the Pods directory to your .gitignore. However
27 | # you should judge for yourself, the pros and cons are mentioned at:
28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
29 | #
30 | # Pods/
31 |
32 | # Carthage
33 | #
34 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
35 | # Carthage/Checkouts
36 |
37 | Carthage/Build
38 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Igor Matyushkin
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/Logo/logo_1024_300.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/simplisticated/Sensitive/d620ddeff0000149a7f44bf5a66e871de9f6beaf/Logo/logo_1024_300.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | ## At a Glance
11 |
12 | `Sensitive` is a library that simplifies work with gestures in iOS. Forget about target/action pattern of primitive `UIGestureRecognizer`. With `Sensitive` you can call `onTap`, `onPinch`, `onSwipe` on any `UIView` instance and implement handler for the gesture. That's all that you should know to start. For details, see [Usage](#usage) section.
13 |
14 | ## How To Get Started
15 |
16 | - Copy content of `Source` folder to your project.
17 |
18 | or
19 |
20 | - Use `Sensitive` cocoapod.
21 |
22 | ## Requirements
23 |
24 | * iOS 9.0 and later
25 | * Xcode 9.0 and later
26 | * Swift 4.1 or later
27 |
28 | ## Usage
29 |
30 | ### Adding Gesture Recognizers to View
31 |
32 | All gestures are available via special variables that you can call on any `UIView` instance. Examples:
33 |
34 | ```swift
35 | view.onTap
36 | .configure(with: { (gestureRecognizer) in
37 | // Configure `UITapGestureRecognizer` instance
38 | gestureRecognizer.numberOfTapsRequired = 2
39 | })
40 | .handle { (gestureRecognizer) in
41 | // Handle tap on view
42 | gestureRecognizer.view!.backgroundColor = .green
43 | }
44 |
45 | view.onSwipe
46 | .configure(with: { (gestureRecognizer) in
47 | // Configure `UISwipeGestureRecognizer` instance
48 | gestureRecognizer.direction = .left
49 | })
50 | .handle { (gestureRecognizer) in
51 | // Handle tap on view
52 | gestureRecognizer.view!.backgroundColor = .green
53 | }
54 | ```
55 |
56 | Full list of available gestures:
57 |
58 | - `onTap`
59 | - `onLongPress`
60 | - `onPan`
61 | - `onPinch`
62 | - `onRotation`
63 | - `onSwipe`
64 | - `onScreenEdgePan`
65 |
66 | ### Simultaneous Recognition
67 |
68 | If you need few gestures to work together on the same view, you can also use `recognizeSimultaneously` method:
69 |
70 | ```swift
71 | view.onTap
72 | .handle { (gestureRecognizer) in
73 | // Your implementation here...
74 | }
75 | .recognizeSimultaneously(true)
76 |
77 | view.onPinch
78 | .handle { (gestureRecognizer) in
79 | // Your implementation here...
80 | }
81 | .recognizeSimultaneously(true)
82 | ```
83 |
84 | ## License
85 |
86 | `Sensitive` is available under the MIT license. See the [LICENSE](./LICENSE) file for more info.
87 |
--------------------------------------------------------------------------------
/Sensitive.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod spec lint Sensitive.podspec' to ensure this is a
3 | # valid spec and to remove all comments including this before submitting the spec.
4 | #
5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
7 | #
8 |
9 | Pod::Spec.new do |s|
10 |
11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
12 | #
13 | # These will help people to find your library, and whilst it
14 | # can feel like a chore to fill in it's definitely to your advantage. The
15 | # summary should be tweet-length, and the description more in depth.
16 | #
17 |
18 | s.name = "Sensitive"
19 | s.version = "7.0"
20 | s.summary = "Fresh look at work with gestures in Swift."
21 |
22 | # This description is used to generate tags and improve search results.
23 | # * Think: What does it do? Why did you write it? What is the focus?
24 | # * Try to keep it short, snappy and to the point.
25 | # * Write the description between the DESC delimiters below.
26 | # * Finally, don't worry about the indent, CocoaPods strips it!
27 | s.description = <<-DESC
28 | This library changes the way how you work with gestures in Swift.
29 | DESC
30 |
31 | s.homepage = "https://github.com/igormatyushkin014/Sensitive"
32 | s.screenshots = "https://github.com/igormatyushkin014/Sensitive/raw/master/Logo/logo-1024-300.png"
33 |
34 |
35 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
36 | #
37 | # Licensing your code is important. See http://choosealicense.com for more info.
38 | # CocoaPods will detect a license file if there is a named LICENSE*
39 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'.
40 | #
41 |
42 | #s.license = "MIT"
43 | s.license = { :type => "MIT", :file => "LICENSE" }
44 |
45 |
46 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
47 | #
48 | # Specify the authors of the library, with email addresses. Email addresses
49 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
50 | # accepts just a name if you'd rather not provide an email address.
51 | #
52 | # Specify a social_media_url where others can refer to, for example a twitter
53 | # profile URL.
54 | #
55 |
56 | s.author = { "Igor Matyushkin" => "igormatyushkin014@gmail.com" }
57 | # s.author = "Igor Matyushkin"
58 | # s.authors = { "Igor Matyushkin" => "igormatyushkin014@gmail.com" }
59 | # s.social_media_url = ""
60 |
61 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
62 | #
63 | # If this Pod runs only on iOS or OS X, then specify the platform and
64 | # the deployment target. You can optionally include the target after the platform.
65 | #
66 |
67 | # s.platform = :ios
68 | s.platform = :ios, "8.0"
69 |
70 | # When using multiple platforms
71 | # s.ios.deployment_target = "5.0"
72 | # s.osx.deployment_target = "10.7"
73 | # s.watchos.deployment_target = "2.0"
74 | # s.tvos.deployment_target = "9.0"
75 |
76 |
77 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
78 | #
79 | # Specify the location from where the source should be retrieved.
80 | # Supports git, hg, bzr, svn and HTTP.
81 | #
82 |
83 | s.source = { :git => "https://github.com/igormatyushkin014/Sensitive.git", :tag => s.version }
84 |
85 |
86 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
87 | #
88 | # CocoaPods is smart about how it includes source code. For source files
89 | # giving a folder will include any swift, h, m, mm, c & cpp files.
90 | # For header files it will include any header in the folder.
91 | # Not including the public_header_files will make all headers public.
92 | #
93 |
94 | s.source_files = "Source", "Source/**/*"
95 | #s.exclude_files = "Classes/Exclude"
96 |
97 | # s.public_header_files = "Classes/**/*.h"
98 |
99 | s.swift_version = "4.0"
100 |
101 |
102 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
103 | #
104 | # A list of resources included with the Pod. These are copied into the
105 | # target bundle with a build phase script. Anything else will be cleaned.
106 | # You can preserve files from being cleaned, please don't preserve
107 | # non-essential files like tests, examples and documentation.
108 | #
109 |
110 | # s.resource = "icon.png"
111 | # s.resources = "Resources/*.png"
112 |
113 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave"
114 |
115 |
116 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
117 | #
118 | # Link your library with frameworks, or libraries. Libraries do not include
119 | # the lib prefix of their name.
120 | #
121 |
122 | # s.framework = "SomeFramework"
123 | # s.frameworks = "SomeFramework", "AnotherFramework"
124 |
125 | # s.library = "iconv"
126 | # s.libraries = "iconv", "xml2"
127 |
128 |
129 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
130 | #
131 | # If your library depends on compiler flags you can set them in the xcconfig hash
132 | # where they will only apply to your library. If you depend on other Podspecs
133 | # you can include multiple dependencies to ensure it works.
134 |
135 | # s.requires_arc = true
136 |
137 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
138 | # s.dependency "JSONKit", "~> 1.4"
139 |
140 | end
141 |
--------------------------------------------------------------------------------
/Sensitive/Sensitive.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Sensitive/Sensitive.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Sensitive/Sensitive/Sensitive.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 691E99C320914B130051B750 /* Sensitive.h in Headers */ = {isa = PBXBuildFile; fileRef = 691E99C120914B130051B750 /* Sensitive.h */; settings = {ATTRIBUTES = (Public, ); }; };
11 | 691E99F320914B200051B750 /* GestureRecognizerHandlers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 691E99E420914B200051B750 /* GestureRecognizerHandlers.swift */; };
12 | 696117C820E7787200074C8C /* LongPressGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696117BB20E7787200074C8C /* LongPressGestureRecognizer.swift */; };
13 | 696117C920E7787200074C8C /* PanGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696117BD20E7787200074C8C /* PanGestureRecognizer.swift */; };
14 | 696117CA20E7787200074C8C /* PinchGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696117BF20E7787200074C8C /* PinchGestureRecognizer.swift */; };
15 | 696117CB20E7787200074C8C /* RotationGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696117C120E7787200074C8C /* RotationGestureRecognizer.swift */; };
16 | 696117CC20E7787200074C8C /* ScreenEdgePanGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696117C320E7787200074C8C /* ScreenEdgePanGestureRecognizer.swift */; };
17 | 696117CD20E7787200074C8C /* SwipeGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696117C520E7787200074C8C /* SwipeGestureRecognizer.swift */; };
18 | 696117CE20E7787200074C8C /* TapGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696117C720E7787200074C8C /* TapGestureRecognizer.swift */; };
19 | 696117D620E78ECE00074C8C /* Gesture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696117D520E78ECE00074C8C /* Gesture.swift */; };
20 | 696117DB20E7CBE000074C8C /* GestureRetainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696117DA20E7CBE000074C8C /* GestureRetainer.swift */; };
21 | 696117DD20E7DECF00074C8C /* UIViewExtensionGestures.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696117DC20E7DECF00074C8C /* UIViewExtensionGestures.swift */; };
22 | /* End PBXBuildFile section */
23 |
24 | /* Begin PBXFileReference section */
25 | 691E99BE20914B130051B750 /* Sensitive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Sensitive.framework; sourceTree = BUILT_PRODUCTS_DIR; };
26 | 691E99C120914B130051B750 /* Sensitive.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Sensitive.h; sourceTree = ""; };
27 | 691E99C220914B130051B750 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
28 | 691E99E420914B200051B750 /* GestureRecognizerHandlers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GestureRecognizerHandlers.swift; sourceTree = ""; };
29 | 696117BB20E7787200074C8C /* LongPressGestureRecognizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LongPressGestureRecognizer.swift; sourceTree = ""; };
30 | 696117BD20E7787200074C8C /* PanGestureRecognizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PanGestureRecognizer.swift; sourceTree = ""; };
31 | 696117BF20E7787200074C8C /* PinchGestureRecognizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PinchGestureRecognizer.swift; sourceTree = ""; };
32 | 696117C120E7787200074C8C /* RotationGestureRecognizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RotationGestureRecognizer.swift; sourceTree = ""; };
33 | 696117C320E7787200074C8C /* ScreenEdgePanGestureRecognizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScreenEdgePanGestureRecognizer.swift; sourceTree = ""; };
34 | 696117C520E7787200074C8C /* SwipeGestureRecognizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwipeGestureRecognizer.swift; sourceTree = ""; };
35 | 696117C720E7787200074C8C /* TapGestureRecognizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TapGestureRecognizer.swift; sourceTree = ""; };
36 | 696117D520E78ECE00074C8C /* Gesture.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Gesture.swift; sourceTree = ""; };
37 | 696117DA20E7CBE000074C8C /* GestureRetainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GestureRetainer.swift; sourceTree = ""; };
38 | 696117DC20E7DECF00074C8C /* UIViewExtensionGestures.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewExtensionGestures.swift; sourceTree = ""; };
39 | /* End PBXFileReference section */
40 |
41 | /* Begin PBXFrameworksBuildPhase section */
42 | 691E99BA20914B130051B750 /* Frameworks */ = {
43 | isa = PBXFrameworksBuildPhase;
44 | buildActionMask = 2147483647;
45 | files = (
46 | );
47 | runOnlyForDeploymentPostprocessing = 0;
48 | };
49 | /* End PBXFrameworksBuildPhase section */
50 |
51 | /* Begin PBXGroup section */
52 | 691E99B420914B130051B750 = {
53 | isa = PBXGroup;
54 | children = (
55 | 691E99C020914B130051B750 /* Sensitive */,
56 | 691E99BF20914B130051B750 /* Products */,
57 | );
58 | sourceTree = "";
59 | };
60 | 691E99BF20914B130051B750 /* Products */ = {
61 | isa = PBXGroup;
62 | children = (
63 | 691E99BE20914B130051B750 /* Sensitive.framework */,
64 | );
65 | name = Products;
66 | sourceTree = "";
67 | };
68 | 691E99C020914B130051B750 /* Sensitive */ = {
69 | isa = PBXGroup;
70 | children = (
71 | 691E99C920914B200051B750 /* Source */,
72 | 691E99C120914B130051B750 /* Sensitive.h */,
73 | 691E99C220914B130051B750 /* Info.plist */,
74 | );
75 | path = Sensitive;
76 | sourceTree = "";
77 | };
78 | 691E99C920914B200051B750 /* Source */ = {
79 | isa = PBXGroup;
80 | children = (
81 | 691E99E320914B200051B750 /* Types */,
82 | 691E99CA20914B200051B750 /* Classes */,
83 | 691E99DA20914B200051B750 /* Extensions */,
84 | );
85 | name = Source;
86 | path = ../../../Source;
87 | sourceTree = "";
88 | };
89 | 691E99CA20914B200051B750 /* Classes */ = {
90 | isa = PBXGroup;
91 | children = (
92 | 696117D420E78ECE00074C8C /* Gesture */,
93 | 696117B920E7787200074C8C /* Recognizers */,
94 | );
95 | path = Classes;
96 | sourceTree = "";
97 | };
98 | 691E99DA20914B200051B750 /* Extensions */ = {
99 | isa = PBXGroup;
100 | children = (
101 | 691E99DB20914B200051B750 /* View */,
102 | );
103 | path = Extensions;
104 | sourceTree = "";
105 | };
106 | 691E99DB20914B200051B750 /* View */ = {
107 | isa = PBXGroup;
108 | children = (
109 | 696117DC20E7DECF00074C8C /* UIViewExtensionGestures.swift */,
110 | );
111 | path = View;
112 | sourceTree = "";
113 | };
114 | 691E99E320914B200051B750 /* Types */ = {
115 | isa = PBXGroup;
116 | children = (
117 | 691E99E420914B200051B750 /* GestureRecognizerHandlers.swift */,
118 | );
119 | path = Types;
120 | sourceTree = "";
121 | };
122 | 696117B920E7787200074C8C /* Recognizers */ = {
123 | isa = PBXGroup;
124 | children = (
125 | 696117C620E7787200074C8C /* Tap */,
126 | 696117BA20E7787200074C8C /* LongPress */,
127 | 696117BC20E7787200074C8C /* Pan */,
128 | 696117BE20E7787200074C8C /* Pinch */,
129 | 696117C020E7787200074C8C /* Rotation */,
130 | 696117C420E7787200074C8C /* Swipe */,
131 | 696117C220E7787200074C8C /* ScreenEdgePan */,
132 | );
133 | path = Recognizers;
134 | sourceTree = "";
135 | };
136 | 696117BA20E7787200074C8C /* LongPress */ = {
137 | isa = PBXGroup;
138 | children = (
139 | 696117BB20E7787200074C8C /* LongPressGestureRecognizer.swift */,
140 | );
141 | path = LongPress;
142 | sourceTree = "";
143 | };
144 | 696117BC20E7787200074C8C /* Pan */ = {
145 | isa = PBXGroup;
146 | children = (
147 | 696117BD20E7787200074C8C /* PanGestureRecognizer.swift */,
148 | );
149 | path = Pan;
150 | sourceTree = "";
151 | };
152 | 696117BE20E7787200074C8C /* Pinch */ = {
153 | isa = PBXGroup;
154 | children = (
155 | 696117BF20E7787200074C8C /* PinchGestureRecognizer.swift */,
156 | );
157 | path = Pinch;
158 | sourceTree = "";
159 | };
160 | 696117C020E7787200074C8C /* Rotation */ = {
161 | isa = PBXGroup;
162 | children = (
163 | 696117C120E7787200074C8C /* RotationGestureRecognizer.swift */,
164 | );
165 | path = Rotation;
166 | sourceTree = "";
167 | };
168 | 696117C220E7787200074C8C /* ScreenEdgePan */ = {
169 | isa = PBXGroup;
170 | children = (
171 | 696117C320E7787200074C8C /* ScreenEdgePanGestureRecognizer.swift */,
172 | );
173 | path = ScreenEdgePan;
174 | sourceTree = "";
175 | };
176 | 696117C420E7787200074C8C /* Swipe */ = {
177 | isa = PBXGroup;
178 | children = (
179 | 696117C520E7787200074C8C /* SwipeGestureRecognizer.swift */,
180 | );
181 | path = Swipe;
182 | sourceTree = "";
183 | };
184 | 696117C620E7787200074C8C /* Tap */ = {
185 | isa = PBXGroup;
186 | children = (
187 | 696117C720E7787200074C8C /* TapGestureRecognizer.swift */,
188 | );
189 | path = Tap;
190 | sourceTree = "";
191 | };
192 | 696117D420E78ECE00074C8C /* Gesture */ = {
193 | isa = PBXGroup;
194 | children = (
195 | 696117D520E78ECE00074C8C /* Gesture.swift */,
196 | 696117DA20E7CBE000074C8C /* GestureRetainer.swift */,
197 | );
198 | path = Gesture;
199 | sourceTree = "";
200 | };
201 | /* End PBXGroup section */
202 |
203 | /* Begin PBXHeadersBuildPhase section */
204 | 691E99BB20914B130051B750 /* Headers */ = {
205 | isa = PBXHeadersBuildPhase;
206 | buildActionMask = 2147483647;
207 | files = (
208 | 691E99C320914B130051B750 /* Sensitive.h in Headers */,
209 | );
210 | runOnlyForDeploymentPostprocessing = 0;
211 | };
212 | /* End PBXHeadersBuildPhase section */
213 |
214 | /* Begin PBXNativeTarget section */
215 | 691E99BD20914B130051B750 /* Sensitive */ = {
216 | isa = PBXNativeTarget;
217 | buildConfigurationList = 691E99C620914B130051B750 /* Build configuration list for PBXNativeTarget "Sensitive" */;
218 | buildPhases = (
219 | 691E99B920914B130051B750 /* Sources */,
220 | 691E99BA20914B130051B750 /* Frameworks */,
221 | 691E99BB20914B130051B750 /* Headers */,
222 | 691E99BC20914B130051B750 /* Resources */,
223 | );
224 | buildRules = (
225 | );
226 | dependencies = (
227 | );
228 | name = Sensitive;
229 | productName = Sensitive;
230 | productReference = 691E99BE20914B130051B750 /* Sensitive.framework */;
231 | productType = "com.apple.product-type.framework";
232 | };
233 | /* End PBXNativeTarget section */
234 |
235 | /* Begin PBXProject section */
236 | 691E99B520914B130051B750 /* Project object */ = {
237 | isa = PBXProject;
238 | attributes = {
239 | LastUpgradeCheck = 0930;
240 | ORGANIZATIONNAME = "Igor Matyushkin";
241 | TargetAttributes = {
242 | 691E99BD20914B130051B750 = {
243 | CreatedOnToolsVersion = 9.3;
244 | };
245 | };
246 | };
247 | buildConfigurationList = 691E99B820914B130051B750 /* Build configuration list for PBXProject "Sensitive" */;
248 | compatibilityVersion = "Xcode 9.3";
249 | developmentRegion = en;
250 | hasScannedForEncodings = 0;
251 | knownRegions = (
252 | en,
253 | );
254 | mainGroup = 691E99B420914B130051B750;
255 | productRefGroup = 691E99BF20914B130051B750 /* Products */;
256 | projectDirPath = "";
257 | projectRoot = "";
258 | targets = (
259 | 691E99BD20914B130051B750 /* Sensitive */,
260 | );
261 | };
262 | /* End PBXProject section */
263 |
264 | /* Begin PBXResourcesBuildPhase section */
265 | 691E99BC20914B130051B750 /* Resources */ = {
266 | isa = PBXResourcesBuildPhase;
267 | buildActionMask = 2147483647;
268 | files = (
269 | );
270 | runOnlyForDeploymentPostprocessing = 0;
271 | };
272 | /* End PBXResourcesBuildPhase section */
273 |
274 | /* Begin PBXSourcesBuildPhase section */
275 | 691E99B920914B130051B750 /* Sources */ = {
276 | isa = PBXSourcesBuildPhase;
277 | buildActionMask = 2147483647;
278 | files = (
279 | 696117CB20E7787200074C8C /* RotationGestureRecognizer.swift in Sources */,
280 | 696117CE20E7787200074C8C /* TapGestureRecognizer.swift in Sources */,
281 | 696117D620E78ECE00074C8C /* Gesture.swift in Sources */,
282 | 691E99F320914B200051B750 /* GestureRecognizerHandlers.swift in Sources */,
283 | 696117DB20E7CBE000074C8C /* GestureRetainer.swift in Sources */,
284 | 696117CA20E7787200074C8C /* PinchGestureRecognizer.swift in Sources */,
285 | 696117C820E7787200074C8C /* LongPressGestureRecognizer.swift in Sources */,
286 | 696117CC20E7787200074C8C /* ScreenEdgePanGestureRecognizer.swift in Sources */,
287 | 696117DD20E7DECF00074C8C /* UIViewExtensionGestures.swift in Sources */,
288 | 696117CD20E7787200074C8C /* SwipeGestureRecognizer.swift in Sources */,
289 | 696117C920E7787200074C8C /* PanGestureRecognizer.swift in Sources */,
290 | );
291 | runOnlyForDeploymentPostprocessing = 0;
292 | };
293 | /* End PBXSourcesBuildPhase section */
294 |
295 | /* Begin XCBuildConfiguration section */
296 | 691E99C420914B130051B750 /* Debug */ = {
297 | isa = XCBuildConfiguration;
298 | buildSettings = {
299 | ALWAYS_SEARCH_USER_PATHS = NO;
300 | CLANG_ANALYZER_NONNULL = YES;
301 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
302 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
303 | CLANG_CXX_LIBRARY = "libc++";
304 | CLANG_ENABLE_MODULES = YES;
305 | CLANG_ENABLE_OBJC_ARC = YES;
306 | CLANG_ENABLE_OBJC_WEAK = YES;
307 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
308 | CLANG_WARN_BOOL_CONVERSION = YES;
309 | CLANG_WARN_COMMA = YES;
310 | CLANG_WARN_CONSTANT_CONVERSION = YES;
311 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
312 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
313 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
314 | CLANG_WARN_EMPTY_BODY = YES;
315 | CLANG_WARN_ENUM_CONVERSION = YES;
316 | CLANG_WARN_INFINITE_RECURSION = YES;
317 | CLANG_WARN_INT_CONVERSION = YES;
318 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
319 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
320 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
321 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
322 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
323 | CLANG_WARN_STRICT_PROTOTYPES = YES;
324 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
325 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
326 | CLANG_WARN_UNREACHABLE_CODE = YES;
327 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
328 | CODE_SIGN_IDENTITY = "iPhone Developer";
329 | COPY_PHASE_STRIP = NO;
330 | CURRENT_PROJECT_VERSION = 1;
331 | DEBUG_INFORMATION_FORMAT = dwarf;
332 | ENABLE_STRICT_OBJC_MSGSEND = YES;
333 | ENABLE_TESTABILITY = YES;
334 | GCC_C_LANGUAGE_STANDARD = gnu11;
335 | GCC_DYNAMIC_NO_PIC = NO;
336 | GCC_NO_COMMON_BLOCKS = YES;
337 | GCC_OPTIMIZATION_LEVEL = 0;
338 | GCC_PREPROCESSOR_DEFINITIONS = (
339 | "DEBUG=1",
340 | "$(inherited)",
341 | );
342 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
343 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
344 | GCC_WARN_UNDECLARED_SELECTOR = YES;
345 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
346 | GCC_WARN_UNUSED_FUNCTION = YES;
347 | GCC_WARN_UNUSED_VARIABLE = YES;
348 | IPHONEOS_DEPLOYMENT_TARGET = 11.3;
349 | MTL_ENABLE_DEBUG_INFO = YES;
350 | ONLY_ACTIVE_ARCH = YES;
351 | SDKROOT = iphoneos;
352 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
353 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
354 | VERSIONING_SYSTEM = "apple-generic";
355 | VERSION_INFO_PREFIX = "";
356 | };
357 | name = Debug;
358 | };
359 | 691E99C520914B130051B750 /* Release */ = {
360 | isa = XCBuildConfiguration;
361 | buildSettings = {
362 | ALWAYS_SEARCH_USER_PATHS = NO;
363 | CLANG_ANALYZER_NONNULL = YES;
364 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
365 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
366 | CLANG_CXX_LIBRARY = "libc++";
367 | CLANG_ENABLE_MODULES = YES;
368 | CLANG_ENABLE_OBJC_ARC = YES;
369 | CLANG_ENABLE_OBJC_WEAK = YES;
370 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
371 | CLANG_WARN_BOOL_CONVERSION = YES;
372 | CLANG_WARN_COMMA = YES;
373 | CLANG_WARN_CONSTANT_CONVERSION = YES;
374 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
375 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
376 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
377 | CLANG_WARN_EMPTY_BODY = YES;
378 | CLANG_WARN_ENUM_CONVERSION = YES;
379 | CLANG_WARN_INFINITE_RECURSION = YES;
380 | CLANG_WARN_INT_CONVERSION = YES;
381 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
382 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
383 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
384 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
385 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
386 | CLANG_WARN_STRICT_PROTOTYPES = YES;
387 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
388 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
389 | CLANG_WARN_UNREACHABLE_CODE = YES;
390 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
391 | CODE_SIGN_IDENTITY = "iPhone Developer";
392 | COPY_PHASE_STRIP = NO;
393 | CURRENT_PROJECT_VERSION = 1;
394 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
395 | ENABLE_NS_ASSERTIONS = NO;
396 | ENABLE_STRICT_OBJC_MSGSEND = YES;
397 | GCC_C_LANGUAGE_STANDARD = gnu11;
398 | GCC_NO_COMMON_BLOCKS = YES;
399 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
400 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
401 | GCC_WARN_UNDECLARED_SELECTOR = YES;
402 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
403 | GCC_WARN_UNUSED_FUNCTION = YES;
404 | GCC_WARN_UNUSED_VARIABLE = YES;
405 | IPHONEOS_DEPLOYMENT_TARGET = 11.3;
406 | MTL_ENABLE_DEBUG_INFO = NO;
407 | SDKROOT = iphoneos;
408 | SWIFT_COMPILATION_MODE = wholemodule;
409 | SWIFT_OPTIMIZATION_LEVEL = "-O";
410 | VALIDATE_PRODUCT = YES;
411 | VERSIONING_SYSTEM = "apple-generic";
412 | VERSION_INFO_PREFIX = "";
413 | };
414 | name = Release;
415 | };
416 | 691E99C720914B130051B750 /* Debug */ = {
417 | isa = XCBuildConfiguration;
418 | buildSettings = {
419 | CODE_SIGN_IDENTITY = "";
420 | CODE_SIGN_STYLE = Automatic;
421 | DEFINES_MODULE = YES;
422 | DYLIB_COMPATIBILITY_VERSION = 1;
423 | DYLIB_CURRENT_VERSION = 1;
424 | DYLIB_INSTALL_NAME_BASE = "@rpath";
425 | INFOPLIST_FILE = Sensitive/Info.plist;
426 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
427 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
428 | LD_RUNPATH_SEARCH_PATHS = (
429 | "$(inherited)",
430 | "@executable_path/Frameworks",
431 | "@loader_path/Frameworks",
432 | );
433 | PRODUCT_BUNDLE_IDENTIFIER = com.visuality.Sensitive;
434 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
435 | SKIP_INSTALL = YES;
436 | SWIFT_VERSION = 4.0;
437 | TARGETED_DEVICE_FAMILY = "1,2";
438 | };
439 | name = Debug;
440 | };
441 | 691E99C820914B130051B750 /* Release */ = {
442 | isa = XCBuildConfiguration;
443 | buildSettings = {
444 | CODE_SIGN_IDENTITY = "";
445 | CODE_SIGN_STYLE = Automatic;
446 | DEFINES_MODULE = YES;
447 | DYLIB_COMPATIBILITY_VERSION = 1;
448 | DYLIB_CURRENT_VERSION = 1;
449 | DYLIB_INSTALL_NAME_BASE = "@rpath";
450 | INFOPLIST_FILE = Sensitive/Info.plist;
451 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
452 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
453 | LD_RUNPATH_SEARCH_PATHS = (
454 | "$(inherited)",
455 | "@executable_path/Frameworks",
456 | "@loader_path/Frameworks",
457 | );
458 | PRODUCT_BUNDLE_IDENTIFIER = com.visuality.Sensitive;
459 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
460 | SKIP_INSTALL = YES;
461 | SWIFT_VERSION = 4.0;
462 | TARGETED_DEVICE_FAMILY = "1,2";
463 | };
464 | name = Release;
465 | };
466 | /* End XCBuildConfiguration section */
467 |
468 | /* Begin XCConfigurationList section */
469 | 691E99B820914B130051B750 /* Build configuration list for PBXProject "Sensitive" */ = {
470 | isa = XCConfigurationList;
471 | buildConfigurations = (
472 | 691E99C420914B130051B750 /* Debug */,
473 | 691E99C520914B130051B750 /* Release */,
474 | );
475 | defaultConfigurationIsVisible = 0;
476 | defaultConfigurationName = Release;
477 | };
478 | 691E99C620914B130051B750 /* Build configuration list for PBXNativeTarget "Sensitive" */ = {
479 | isa = XCConfigurationList;
480 | buildConfigurations = (
481 | 691E99C720914B130051B750 /* Debug */,
482 | 691E99C820914B130051B750 /* Release */,
483 | );
484 | defaultConfigurationIsVisible = 0;
485 | defaultConfigurationName = Release;
486 | };
487 | /* End XCConfigurationList section */
488 | };
489 | rootObject = 691E99B520914B130051B750 /* Project object */;
490 | }
491 |
--------------------------------------------------------------------------------
/Sensitive/Sensitive/Sensitive/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSPrincipalClass
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Sensitive/Sensitive/Sensitive/Sensitive.h:
--------------------------------------------------------------------------------
1 | //
2 | // Sensitive.h
3 | // Sensitive
4 | //
5 | // Created by Igor Matyushkin on 26.04.2018.
6 | // Copyright © 2018 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for Sensitive.
12 | FOUNDATION_EXPORT double SensitiveVersionNumber;
13 |
14 | //! Project version string for Sensitive.
15 | FOUNDATION_EXPORT const unsigned char SensitiveVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Sensitive/SensitiveDemo/SensitiveDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 691E999720914A070051B750 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 691E999620914A070051B750 /* AppDelegate.swift */; };
11 | 691E999E20914A090051B750 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 691E999D20914A090051B750 /* Assets.xcassets */; };
12 | 691E99A920914A280051B750 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 691E99A820914A280051B750 /* LaunchScreen.xib */; };
13 | 691E99B120914ADD0051B750 /* CircleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 691E99AC20914ADD0051B750 /* CircleView.swift */; };
14 | 691E99B220914ADD0051B750 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 691E99AF20914ADD0051B750 /* MainViewController.swift */; };
15 | 691E99B320914ADD0051B750 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 691E99B020914ADD0051B750 /* MainViewController.xib */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXCopyFilesBuildPhase section */
19 | 691E99F820914BA20051B750 /* Embed Frameworks */ = {
20 | isa = PBXCopyFilesBuildPhase;
21 | buildActionMask = 2147483647;
22 | dstPath = "";
23 | dstSubfolderSpec = 10;
24 | files = (
25 | );
26 | name = "Embed Frameworks";
27 | runOnlyForDeploymentPostprocessing = 0;
28 | };
29 | /* End PBXCopyFilesBuildPhase section */
30 |
31 | /* Begin PBXFileReference section */
32 | 691E999320914A070051B750 /* SensitiveDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SensitiveDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
33 | 691E999620914A070051B750 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
34 | 691E999D20914A090051B750 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
35 | 691E99A220914A090051B750 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
36 | 691E99A820914A280051B750 /* LaunchScreen.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = ""; };
37 | 691E99AC20914ADD0051B750 /* CircleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CircleView.swift; sourceTree = ""; };
38 | 691E99AF20914ADD0051B750 /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; };
39 | 691E99B020914ADD0051B750 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = ""; };
40 | 691E99F920914BA50051B750 /* Sensitive.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sensitive.framework; path = "../../../../../../../Library/Developer/Xcode/DerivedData/Sensitive-fugipombtowwdugjqunofbnbpilz/Build/Products/Debug-iphoneos/Sensitive.framework"; sourceTree = ""; };
41 | /* End PBXFileReference section */
42 |
43 | /* Begin PBXFrameworksBuildPhase section */
44 | 691E999020914A070051B750 /* Frameworks */ = {
45 | isa = PBXFrameworksBuildPhase;
46 | buildActionMask = 2147483647;
47 | files = (
48 | );
49 | runOnlyForDeploymentPostprocessing = 0;
50 | };
51 | /* End PBXFrameworksBuildPhase section */
52 |
53 | /* Begin PBXGroup section */
54 | 691E998A20914A070051B750 = {
55 | isa = PBXGroup;
56 | children = (
57 | 691E999520914A070051B750 /* SensitiveDemo */,
58 | 691E99F420914B8A0051B750 /* Framework */,
59 | 691E999420914A070051B750 /* Products */,
60 | );
61 | sourceTree = "";
62 | };
63 | 691E999420914A070051B750 /* Products */ = {
64 | isa = PBXGroup;
65 | children = (
66 | 691E999320914A070051B750 /* SensitiveDemo.app */,
67 | );
68 | name = Products;
69 | sourceTree = "";
70 | };
71 | 691E999520914A070051B750 /* SensitiveDemo */ = {
72 | isa = PBXGroup;
73 | children = (
74 | 691E99AD20914ADD0051B750 /* ViewControllers */,
75 | 691E99AA20914ADD0051B750 /* Views */,
76 | 691E999620914A070051B750 /* AppDelegate.swift */,
77 | 691E999D20914A090051B750 /* Assets.xcassets */,
78 | 691E99A820914A280051B750 /* LaunchScreen.xib */,
79 | 691E99A220914A090051B750 /* Info.plist */,
80 | );
81 | path = SensitiveDemo;
82 | sourceTree = "";
83 | };
84 | 691E99AA20914ADD0051B750 /* Views */ = {
85 | isa = PBXGroup;
86 | children = (
87 | 691E99AB20914ADD0051B750 /* Circle */,
88 | );
89 | path = Views;
90 | sourceTree = SOURCE_ROOT;
91 | };
92 | 691E99AB20914ADD0051B750 /* Circle */ = {
93 | isa = PBXGroup;
94 | children = (
95 | 691E99AC20914ADD0051B750 /* CircleView.swift */,
96 | );
97 | path = Circle;
98 | sourceTree = "";
99 | };
100 | 691E99AD20914ADD0051B750 /* ViewControllers */ = {
101 | isa = PBXGroup;
102 | children = (
103 | 691E99AE20914ADD0051B750 /* Main */,
104 | );
105 | path = ViewControllers;
106 | sourceTree = SOURCE_ROOT;
107 | };
108 | 691E99AE20914ADD0051B750 /* Main */ = {
109 | isa = PBXGroup;
110 | children = (
111 | 691E99AF20914ADD0051B750 /* MainViewController.swift */,
112 | 691E99B020914ADD0051B750 /* MainViewController.xib */,
113 | );
114 | path = Main;
115 | sourceTree = "";
116 | };
117 | 691E99F420914B8A0051B750 /* Framework */ = {
118 | isa = PBXGroup;
119 | children = (
120 | 691E99F920914BA50051B750 /* Sensitive.framework */,
121 | );
122 | path = Framework;
123 | sourceTree = "";
124 | };
125 | /* End PBXGroup section */
126 |
127 | /* Begin PBXNativeTarget section */
128 | 691E999220914A070051B750 /* SensitiveDemo */ = {
129 | isa = PBXNativeTarget;
130 | buildConfigurationList = 691E99A520914A090051B750 /* Build configuration list for PBXNativeTarget "SensitiveDemo" */;
131 | buildPhases = (
132 | 691E998F20914A070051B750 /* Sources */,
133 | 691E999020914A070051B750 /* Frameworks */,
134 | 691E999120914A070051B750 /* Resources */,
135 | 691E99F820914BA20051B750 /* Embed Frameworks */,
136 | );
137 | buildRules = (
138 | );
139 | dependencies = (
140 | );
141 | name = SensitiveDemo;
142 | productName = SensitiveDemo;
143 | productReference = 691E999320914A070051B750 /* SensitiveDemo.app */;
144 | productType = "com.apple.product-type.application";
145 | };
146 | /* End PBXNativeTarget section */
147 |
148 | /* Begin PBXProject section */
149 | 691E998B20914A070051B750 /* Project object */ = {
150 | isa = PBXProject;
151 | attributes = {
152 | LastSwiftUpdateCheck = 0930;
153 | LastUpgradeCheck = 0930;
154 | ORGANIZATIONNAME = "Igor Matyushkin";
155 | TargetAttributes = {
156 | 691E999220914A070051B750 = {
157 | CreatedOnToolsVersion = 9.3;
158 | };
159 | };
160 | };
161 | buildConfigurationList = 691E998E20914A070051B750 /* Build configuration list for PBXProject "SensitiveDemo" */;
162 | compatibilityVersion = "Xcode 9.3";
163 | developmentRegion = en;
164 | hasScannedForEncodings = 0;
165 | knownRegions = (
166 | en,
167 | Base,
168 | );
169 | mainGroup = 691E998A20914A070051B750;
170 | productRefGroup = 691E999420914A070051B750 /* Products */;
171 | projectDirPath = "";
172 | projectRoot = "";
173 | targets = (
174 | 691E999220914A070051B750 /* SensitiveDemo */,
175 | );
176 | };
177 | /* End PBXProject section */
178 |
179 | /* Begin PBXResourcesBuildPhase section */
180 | 691E999120914A070051B750 /* Resources */ = {
181 | isa = PBXResourcesBuildPhase;
182 | buildActionMask = 2147483647;
183 | files = (
184 | 691E99A920914A280051B750 /* LaunchScreen.xib in Resources */,
185 | 691E99B320914ADD0051B750 /* MainViewController.xib in Resources */,
186 | 691E999E20914A090051B750 /* Assets.xcassets in Resources */,
187 | );
188 | runOnlyForDeploymentPostprocessing = 0;
189 | };
190 | /* End PBXResourcesBuildPhase section */
191 |
192 | /* Begin PBXSourcesBuildPhase section */
193 | 691E998F20914A070051B750 /* Sources */ = {
194 | isa = PBXSourcesBuildPhase;
195 | buildActionMask = 2147483647;
196 | files = (
197 | 691E99B220914ADD0051B750 /* MainViewController.swift in Sources */,
198 | 691E99B120914ADD0051B750 /* CircleView.swift in Sources */,
199 | 691E999720914A070051B750 /* AppDelegate.swift in Sources */,
200 | );
201 | runOnlyForDeploymentPostprocessing = 0;
202 | };
203 | /* End PBXSourcesBuildPhase section */
204 |
205 | /* Begin XCBuildConfiguration section */
206 | 691E99A320914A090051B750 /* Debug */ = {
207 | isa = XCBuildConfiguration;
208 | buildSettings = {
209 | ALWAYS_SEARCH_USER_PATHS = NO;
210 | CLANG_ANALYZER_NONNULL = YES;
211 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
212 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
213 | CLANG_CXX_LIBRARY = "libc++";
214 | CLANG_ENABLE_MODULES = YES;
215 | CLANG_ENABLE_OBJC_ARC = YES;
216 | CLANG_ENABLE_OBJC_WEAK = YES;
217 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
218 | CLANG_WARN_BOOL_CONVERSION = YES;
219 | CLANG_WARN_COMMA = YES;
220 | CLANG_WARN_CONSTANT_CONVERSION = YES;
221 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
222 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
223 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
224 | CLANG_WARN_EMPTY_BODY = YES;
225 | CLANG_WARN_ENUM_CONVERSION = YES;
226 | CLANG_WARN_INFINITE_RECURSION = YES;
227 | CLANG_WARN_INT_CONVERSION = YES;
228 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
229 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
230 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
231 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
232 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
233 | CLANG_WARN_STRICT_PROTOTYPES = YES;
234 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
235 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
236 | CLANG_WARN_UNREACHABLE_CODE = YES;
237 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
238 | CODE_SIGN_IDENTITY = "iPhone Developer";
239 | COPY_PHASE_STRIP = NO;
240 | DEBUG_INFORMATION_FORMAT = dwarf;
241 | ENABLE_STRICT_OBJC_MSGSEND = YES;
242 | ENABLE_TESTABILITY = YES;
243 | GCC_C_LANGUAGE_STANDARD = gnu11;
244 | GCC_DYNAMIC_NO_PIC = NO;
245 | GCC_NO_COMMON_BLOCKS = YES;
246 | GCC_OPTIMIZATION_LEVEL = 0;
247 | GCC_PREPROCESSOR_DEFINITIONS = (
248 | "DEBUG=1",
249 | "$(inherited)",
250 | );
251 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
252 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
253 | GCC_WARN_UNDECLARED_SELECTOR = YES;
254 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
255 | GCC_WARN_UNUSED_FUNCTION = YES;
256 | GCC_WARN_UNUSED_VARIABLE = YES;
257 | IPHONEOS_DEPLOYMENT_TARGET = 11.3;
258 | MTL_ENABLE_DEBUG_INFO = YES;
259 | ONLY_ACTIVE_ARCH = YES;
260 | SDKROOT = iphoneos;
261 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
262 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
263 | };
264 | name = Debug;
265 | };
266 | 691E99A420914A090051B750 /* Release */ = {
267 | isa = XCBuildConfiguration;
268 | buildSettings = {
269 | ALWAYS_SEARCH_USER_PATHS = NO;
270 | CLANG_ANALYZER_NONNULL = YES;
271 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
272 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
273 | CLANG_CXX_LIBRARY = "libc++";
274 | CLANG_ENABLE_MODULES = YES;
275 | CLANG_ENABLE_OBJC_ARC = YES;
276 | CLANG_ENABLE_OBJC_WEAK = YES;
277 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
278 | CLANG_WARN_BOOL_CONVERSION = YES;
279 | CLANG_WARN_COMMA = YES;
280 | CLANG_WARN_CONSTANT_CONVERSION = YES;
281 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
282 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
283 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
284 | CLANG_WARN_EMPTY_BODY = YES;
285 | CLANG_WARN_ENUM_CONVERSION = YES;
286 | CLANG_WARN_INFINITE_RECURSION = YES;
287 | CLANG_WARN_INT_CONVERSION = YES;
288 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
289 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
290 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
291 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
292 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
293 | CLANG_WARN_STRICT_PROTOTYPES = YES;
294 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
295 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
296 | CLANG_WARN_UNREACHABLE_CODE = YES;
297 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
298 | CODE_SIGN_IDENTITY = "iPhone Developer";
299 | COPY_PHASE_STRIP = NO;
300 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
301 | ENABLE_NS_ASSERTIONS = NO;
302 | ENABLE_STRICT_OBJC_MSGSEND = YES;
303 | GCC_C_LANGUAGE_STANDARD = gnu11;
304 | GCC_NO_COMMON_BLOCKS = YES;
305 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
306 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
307 | GCC_WARN_UNDECLARED_SELECTOR = YES;
308 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
309 | GCC_WARN_UNUSED_FUNCTION = YES;
310 | GCC_WARN_UNUSED_VARIABLE = YES;
311 | IPHONEOS_DEPLOYMENT_TARGET = 11.3;
312 | MTL_ENABLE_DEBUG_INFO = NO;
313 | SDKROOT = iphoneos;
314 | SWIFT_COMPILATION_MODE = wholemodule;
315 | SWIFT_OPTIMIZATION_LEVEL = "-O";
316 | VALIDATE_PRODUCT = YES;
317 | };
318 | name = Release;
319 | };
320 | 691E99A620914A090051B750 /* Debug */ = {
321 | isa = XCBuildConfiguration;
322 | buildSettings = {
323 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
324 | CODE_SIGN_STYLE = Automatic;
325 | INFOPLIST_FILE = SensitiveDemo/Info.plist;
326 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
327 | LD_RUNPATH_SEARCH_PATHS = (
328 | "$(inherited)",
329 | "@executable_path/Frameworks",
330 | );
331 | PRODUCT_BUNDLE_IDENTIFIER = com.visuality.SensitiveDemo;
332 | PRODUCT_NAME = "$(TARGET_NAME)";
333 | SWIFT_VERSION = 4.0;
334 | TARGETED_DEVICE_FAMILY = "1,2";
335 | };
336 | name = Debug;
337 | };
338 | 691E99A720914A090051B750 /* Release */ = {
339 | isa = XCBuildConfiguration;
340 | buildSettings = {
341 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
342 | CODE_SIGN_STYLE = Automatic;
343 | INFOPLIST_FILE = SensitiveDemo/Info.plist;
344 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
345 | LD_RUNPATH_SEARCH_PATHS = (
346 | "$(inherited)",
347 | "@executable_path/Frameworks",
348 | );
349 | PRODUCT_BUNDLE_IDENTIFIER = com.visuality.SensitiveDemo;
350 | PRODUCT_NAME = "$(TARGET_NAME)";
351 | SWIFT_VERSION = 4.0;
352 | TARGETED_DEVICE_FAMILY = "1,2";
353 | };
354 | name = Release;
355 | };
356 | /* End XCBuildConfiguration section */
357 |
358 | /* Begin XCConfigurationList section */
359 | 691E998E20914A070051B750 /* Build configuration list for PBXProject "SensitiveDemo" */ = {
360 | isa = XCConfigurationList;
361 | buildConfigurations = (
362 | 691E99A320914A090051B750 /* Debug */,
363 | 691E99A420914A090051B750 /* Release */,
364 | );
365 | defaultConfigurationIsVisible = 0;
366 | defaultConfigurationName = Release;
367 | };
368 | 691E99A520914A090051B750 /* Build configuration list for PBXNativeTarget "SensitiveDemo" */ = {
369 | isa = XCConfigurationList;
370 | buildConfigurations = (
371 | 691E99A620914A090051B750 /* Debug */,
372 | 691E99A720914A090051B750 /* Release */,
373 | );
374 | defaultConfigurationIsVisible = 0;
375 | defaultConfigurationName = Release;
376 | };
377 | /* End XCConfigurationList section */
378 | };
379 | rootObject = 691E998B20914A070051B750 /* Project object */;
380 | }
381 |
--------------------------------------------------------------------------------
/Sensitive/SensitiveDemo/SensitiveDemo/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // SensitiveDemo
4 | //
5 | // Created by Igor Matyushkin on 26.04.2018.
6 | // Copyright © 2018 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | // MARK: Class variables & properties
15 |
16 | // MARK: Public class methods
17 |
18 | // MARK: Private class methods
19 |
20 | // MARK: Initializers
21 |
22 | // MARK: Deinitializer
23 |
24 | deinit {
25 | }
26 |
27 | // MARK: Object variables & properties
28 |
29 | var window: UIWindow?
30 |
31 | // MARK: Public object methods
32 |
33 | // MARK: Private object methods
34 |
35 | // MARK: Protocol implementation
36 |
37 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
38 | // Create window
39 |
40 | self.window = UIWindow(frame: UIScreen.main.bounds)
41 | window!.backgroundColor = .white
42 | window!.makeKeyAndVisible()
43 |
44 |
45 | // Switch to view controller
46 |
47 | let mainViewController = MainViewController(nibName: "MainViewController", bundle: nil)
48 |
49 | let navigationController = UINavigationController(rootViewController: mainViewController)
50 | navigationController.isNavigationBarHidden = true
51 |
52 | self.window!.rootViewController = navigationController
53 |
54 |
55 | // Return result
56 |
57 | return true
58 | }
59 |
60 | func applicationWillResignActive(_ application: UIApplication) {
61 | // 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.
62 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
63 | }
64 |
65 | func applicationDidEnterBackground(_ application: UIApplication) {
66 | // 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.
67 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
68 | }
69 |
70 | func applicationWillEnterForeground(_ application: UIApplication) {
71 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
72 | }
73 |
74 | func applicationDidBecomeActive(_ application: UIApplication) {
75 | // 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.
76 | }
77 |
78 | func applicationWillTerminate(_ application: UIApplication) {
79 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
80 | }
81 |
82 | }
83 |
84 |
--------------------------------------------------------------------------------
/Sensitive/SensitiveDemo/SensitiveDemo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/Sensitive/SensitiveDemo/SensitiveDemo/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Sensitive/SensitiveDemo/SensitiveDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIRequiredDeviceCapabilities
26 |
27 | armv7
28 |
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 |
33 | UISupportedInterfaceOrientations~ipad
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationPortraitUpsideDown
37 | UIInterfaceOrientationLandscapeLeft
38 | UIInterfaceOrientationLandscapeRight
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Sensitive/SensitiveDemo/SensitiveDemo/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Sensitive/SensitiveDemo/ViewControllers/Main/MainViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewController.swift
3 | // SensitiveDemo
4 | //
5 | // Created by Igor Matyushkin on 09.11.15.
6 | // Copyright © 2015 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import Sensitive
11 |
12 | class MainViewController: UIViewController {
13 |
14 | // MARK: Class variables & properties
15 |
16 | // MARK: Class methods
17 |
18 | // MARK: Initializers
19 |
20 | // MARK: Deinitializer
21 |
22 | deinit {
23 | }
24 |
25 | // MARK: Outlets
26 |
27 | @IBOutlet fileprivate weak var circleView: CircleView!
28 |
29 | // MARK: Variables & properties
30 |
31 | fileprivate let colors: [UIColor] = [
32 | .green,
33 | .yellow,
34 | .orange,
35 | .white
36 | ]
37 |
38 | fileprivate var indexOfCurrentColor: Int?
39 |
40 | // MARK: Public methods
41 |
42 | override func viewDidLoad() {
43 | super.viewDidLoad()
44 |
45 | // Initialize circle view
46 |
47 | self.circleView.onTap
48 | .handle { (tapGestureRecognizer) in
49 | if (self.indexOfCurrentColor == nil) || (self.indexOfCurrentColor! >= self.colors.count - 1) {
50 | self.indexOfCurrentColor = 0
51 | } else {
52 | self.indexOfCurrentColor = self.indexOfCurrentColor! + 1
53 | }
54 |
55 | let colorForCircleView = self.colors[self.indexOfCurrentColor!]
56 | self.circleView.backgroundColor = colorForCircleView
57 | }
58 | }
59 |
60 | override func didReceiveMemoryWarning() {
61 | super.didReceiveMemoryWarning()
62 | // Dispose of any resources that can be recreated.
63 | }
64 |
65 | override var prefersStatusBarHidden : Bool {
66 | return true
67 | }
68 |
69 | // MARK: Private methods
70 |
71 | // MARK: Actions
72 |
73 | // MARK: Protocol methods
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/Sensitive/SensitiveDemo/ViewControllers/Main/MainViewController.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/Sensitive/SensitiveDemo/Views/Circle/CircleView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CircleView.swift
3 | // SensitiveDemo
4 | //
5 | // Created by Igor Matyushkin on 04.01.16.
6 | // Copyright © 2016 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class CircleView: UIView {
12 |
13 | // MARK: Class variables & properties
14 |
15 |
16 | // MARK: Class methods
17 |
18 |
19 | // MARK: Initializers
20 |
21 | override init(frame: CGRect) {
22 | super.init(frame: frame)
23 | customInitialization()
24 | }
25 |
26 | required init?(coder aDecoder: NSCoder) {
27 | super.init(coder: aDecoder)
28 | customInitialization()
29 | }
30 |
31 |
32 | // MARK: Deinitializer
33 |
34 | deinit {
35 | }
36 |
37 |
38 | // MARK: Outlets
39 |
40 |
41 | // MARK: Variables & properties
42 |
43 | fileprivate var _instructionLabel: UILabel!
44 |
45 | var instructionLabel: UILabel {
46 | get {
47 | return _instructionLabel
48 | }
49 | }
50 |
51 |
52 | // MARK: Public methods
53 |
54 | override func layoutSubviews() {
55 | super.layoutSubviews()
56 |
57 |
58 | // Update view
59 |
60 | updateBounds()
61 |
62 |
63 | // Update instruction label
64 |
65 | instructionLabel.frame = bounds
66 | }
67 |
68 | func textForInstructionLabel() -> String {
69 | return "Tap this circle"
70 | }
71 |
72 | func attributesForInstructionLabelText() -> [NSAttributedStringKey : Any] {
73 | let paragraphStyle = NSMutableParagraphStyle()
74 | paragraphStyle.alignment = .center
75 |
76 | return [
77 | NSAttributedStringKey.font: UIFont.systemFont(ofSize: 15.0),
78 | NSAttributedStringKey.foregroundColor: UIColor.black,
79 | NSAttributedStringKey.kern: 0.5 as AnyObject,
80 | NSAttributedStringKey.paragraphStyle: paragraphStyle
81 | ]
82 | }
83 |
84 |
85 | // MARK: Private methods
86 |
87 | fileprivate func customInitialization() {
88 | // Initialize view
89 |
90 | backgroundColor = .white
91 | layer.masksToBounds = true
92 | updateBounds()
93 |
94 |
95 | // Initialize instruction label
96 |
97 | _instructionLabel = UILabel()
98 |
99 | let attributedTextForInstructionLabel = NSAttributedString(string: textForInstructionLabel(), attributes: attributesForInstructionLabelText())
100 | instructionLabel.attributedText = attributedTextForInstructionLabel
101 |
102 | instructionLabel.minimumScaleFactor = 0.5
103 |
104 | addSubview(instructionLabel)
105 | }
106 |
107 | fileprivate func updateBounds() {
108 | layer.borderColor = UIColor.black.cgColor
109 | layer.borderWidth = 1.0
110 | layer.cornerRadius = bounds.size.width / 2.0
111 | layer.masksToBounds = true
112 | }
113 |
114 |
115 | // MARK: Actions
116 |
117 |
118 | // MARK: Protocol methods
119 |
120 | }
121 |
--------------------------------------------------------------------------------
/Source/Classes/Gesture/Gesture.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Gesture.swift
3 | // Sensitive
4 | //
5 | // Created by Igor Matyushkin on 30.06.2018.
6 | // Copyright © 2018 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public final class Gesture: NSObject, UIGestureRecognizerDelegate {
12 |
13 | // MARK: Class variables & properties
14 |
15 | // MARK: Public class methods
16 |
17 | // MARK: Private class methods
18 |
19 | // MARK: Initializers
20 |
21 | public init(withRecognizerOfType recognizerType: Recognizer.Type) {
22 | super.init()
23 |
24 | self.recognizer = Recognizer(target: nil, action: nil)
25 | self.recognizer.addTarget(self, action: #selector(handleGesture))
26 | self.recognizer.delegate = self
27 |
28 | self.recognizer.addObserver(self, forKeyPath: "view", options: .new, context: nil)
29 |
30 | self.shouldRecognizeSimultaneouslyWithOtherGestures = false
31 | }
32 |
33 | // MARK: Deinitializer
34 |
35 | deinit {
36 | self.view = nil
37 | self.recognizer.removeObserver(self, forKeyPath: "view")
38 | self.recognizer = nil
39 | self.handler = nil
40 | self.shouldRecognizeSimultaneouslyWithOtherGestures = nil
41 | }
42 |
43 | // MARK: Object variables & properties
44 |
45 | fileprivate var view: UIView?
46 |
47 | fileprivate var recognizer: Recognizer!
48 |
49 | fileprivate var handler: Handler?
50 |
51 | fileprivate var shouldRecognizeSimultaneouslyWithOtherGestures: Bool!
52 |
53 | // MARK: Public object methods
54 |
55 | public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
56 | if let gestureRecognizer = object as? UIGestureRecognizer {
57 | if gestureRecognizer.view == nil {
58 | GestureRetainer.shared.free(self)
59 | }
60 | }
61 | }
62 |
63 | @discardableResult
64 | public func handle(with closure: @escaping Handler) -> Self {
65 | self.handler = closure
66 | return self
67 | }
68 |
69 | @discardableResult
70 | public func configure(with closure: Configurator) -> Self {
71 | closure(self.recognizer)
72 | return self
73 | }
74 |
75 | @discardableResult
76 | public func recognizeSimultaneously(_ simultaneous: Bool) -> Self {
77 | self.shouldRecognizeSimultaneouslyWithOtherGestures = simultaneous
78 | return self
79 | }
80 |
81 | @discardableResult
82 | public func remove() -> Self {
83 | if let currentView = self.view {
84 | self.remove(fromView: currentView)
85 | }
86 |
87 | return self
88 | }
89 |
90 | // MARK: Private object methods
91 |
92 | @objc
93 | internal func handleGesture() {
94 | self.handler?(self.recognizer)
95 | }
96 |
97 | @discardableResult
98 | internal func add(toView view: UIView) -> Self {
99 | view.addGestureRecognizer(self.recognizer)
100 | self.view = view
101 | GestureRetainer.shared.retain(self)
102 | return self
103 | }
104 |
105 | @discardableResult
106 | internal func remove(fromView view: UIView) -> Self {
107 | view.removeGestureRecognizer(self.recognizer)
108 | self.view = nil
109 | return self
110 | }
111 |
112 | // MARK: Protocol implementation
113 |
114 | public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
115 | return self.shouldRecognizeSimultaneouslyWithOtherGestures
116 | }
117 |
118 | }
119 |
120 | public extension Gesture {
121 |
122 | public typealias Handler = (_ recognizer: Recognizer) -> Void
123 |
124 | public typealias Configurator = (_ recognizer: Recognizer) -> Void
125 |
126 | }
127 |
--------------------------------------------------------------------------------
/Source/Classes/Gesture/GestureRetainer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GestureRetainer.swift
3 | // Sensitive
4 | //
5 | // Created by Igor Matyushkin on 30.06.2018.
6 | // Copyright © 2018 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | internal class GestureRetainer {
12 |
13 | // MARK: Class variables & properties
14 |
15 | public static var shared = {
16 | return GestureRetainer()
17 | }()
18 |
19 | // MARK: Public class methods
20 |
21 | // MARK: Private class methods
22 |
23 | // MARK: Initializers
24 |
25 | fileprivate init() {
26 | self.gestures = []
27 | }
28 |
29 | // MARK: Deinitializer
30 |
31 | deinit {
32 | }
33 |
34 | // MARK: Object variables & properties
35 |
36 | fileprivate var gestures: [NSObject]!
37 |
38 | // MARK: Public object methods
39 |
40 | public func retain(_ gesture: NSObject) {
41 | self.gestures.append(gesture)
42 | }
43 |
44 | public func free(_ gesture: NSObject) {
45 | guard let gestureIndex = self.gestures.index(of: gesture) else {
46 | return
47 | }
48 |
49 | self.gestures.remove(at: gestureIndex)
50 | }
51 |
52 | // MARK: Private object methods
53 |
54 | // MARK: Protocol implementation
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/Source/Classes/Recognizers/LongPress/LongPressGestureRecognizer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LongPressGestureRecognizer.swift
3 | // Sensitive
4 | //
5 | // Created by Igor Matyushkin on 17.12.15.
6 | // Copyright © 2015 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public class LongPressGestureRecognizer: UILongPressGestureRecognizer, UIGestureRecognizerDelegate {
12 |
13 | // MARK: Class variables & properties
14 |
15 | // MARK: Class methods
16 |
17 | // MARK: Initializers
18 |
19 | public init(handler: @escaping GestureRecognizerHandler) {
20 | super.init(target: nil, action: nil)
21 | self.handler = handler
22 | self.recognizeSimultaneouslyWithOtherGestures = true
23 | self.addTarget(self, action: #selector(runHandler))
24 | }
25 |
26 | // MARK: Deinitializer
27 |
28 | deinit {
29 | }
30 |
31 | // MARK: Variables & properties
32 |
33 | fileprivate var handler: GestureRecognizerHandler?
34 |
35 | public var recognizeSimultaneouslyWithOtherGestures: Bool {
36 | get {
37 | return self.delegate === self
38 | }
39 | set {
40 | self.delegate = self
41 | }
42 | }
43 |
44 | // MARK: Public methods
45 |
46 | // MARK: Private methods
47 |
48 | @objc
49 | internal func runHandler() {
50 | self.handler?(self)
51 | }
52 |
53 | // MARK: Protocol methods
54 |
55 | public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
56 | return true
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/Source/Classes/Recognizers/Pan/PanGestureRecognizer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PanGestureRecognizer.swift
3 | // Sensitive
4 | //
5 | // Created by Igor Matyushkin on 04.01.16.
6 | // Copyright © 2016 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public class PanGestureRecognizer: UIPanGestureRecognizer, UIGestureRecognizerDelegate {
12 |
13 | // MARK: Class variables & properties
14 |
15 | // MARK: Class methods
16 |
17 | // MARK: Initializers
18 |
19 | public init(handler: @escaping GestureRecognizerHandler) {
20 | super.init(target: nil, action: nil)
21 | self.handler = handler
22 | self.recognizeSimultaneouslyWithOtherGestures = true
23 | self.addTarget(self, action: #selector(runHandler))
24 | }
25 |
26 | // MARK: Deinitializer
27 |
28 | deinit {
29 | }
30 |
31 | // MARK: Variables & properties
32 |
33 | fileprivate var handler: GestureRecognizerHandler?
34 |
35 | public var recognizeSimultaneouslyWithOtherGestures: Bool {
36 | get {
37 | return self.delegate === self
38 | }
39 | set {
40 | self.delegate = self
41 | }
42 | }
43 |
44 | // MARK: Public methods
45 |
46 | // MARK: Private methods
47 |
48 | @objc
49 | internal func runHandler() {
50 | self.handler?(self)
51 | }
52 |
53 | // MARK: Protocol methods
54 |
55 | public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
56 | return true
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/Source/Classes/Recognizers/Pinch/PinchGestureRecognizer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PinchGestureRecognizer.swift
3 | // Sensitive
4 | //
5 | // Created by Igor Matyushkin on 04.01.16.
6 | // Copyright © 2016 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public class PinchGestureRecognizer: UIPinchGestureRecognizer, UIGestureRecognizerDelegate {
12 |
13 | // MARK: Class variables & properties
14 |
15 | // MARK: Class methods
16 |
17 | // MARK: Initializers
18 |
19 | public init(handler: @escaping GestureRecognizerHandler) {
20 | super.init(target: nil, action: nil)
21 | self.handler = handler
22 | self.recognizeSimultaneouslyWithOtherGestures = true
23 | self.addTarget(self, action: #selector(runHandler))
24 | }
25 |
26 | // MARK: Deinitializer
27 |
28 | deinit {
29 | }
30 |
31 | // MARK: Variables & properties
32 |
33 | fileprivate var handler: GestureRecognizerHandler?
34 |
35 | public var recognizeSimultaneouslyWithOtherGestures: Bool {
36 | get {
37 | return self.delegate === self
38 | }
39 | set {
40 | self.delegate = self
41 | }
42 | }
43 |
44 | // MARK: Public methods
45 |
46 | // MARK: Private methods
47 |
48 | @objc
49 | internal func runHandler() {
50 | self.handler?(self)
51 | }
52 |
53 | // MARK: Protocol methods
54 |
55 | public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
56 | return true
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/Source/Classes/Recognizers/Rotation/RotationGestureRecognizer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RotationGestureRecognizer.swift
3 | // Sensitive
4 | //
5 | // Created by Igor Matyushkin on 04.01.16.
6 | // Copyright © 2016 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public class RotationGestureRecognizer: UIRotationGestureRecognizer, UIGestureRecognizerDelegate {
12 |
13 | // MARK: Class variables & properties
14 |
15 | // MARK: Class methods
16 |
17 | // MARK: Initializers
18 |
19 | public init(handler: @escaping GestureRecognizerHandler) {
20 | super.init(target: nil, action: nil)
21 | self.handler = handler
22 | self.recognizeSimultaneouslyWithOtherGestures = true
23 | self.addTarget(self, action: #selector(runHandler))
24 | }
25 |
26 | // MARK: Deinitializer
27 |
28 | deinit {
29 | }
30 |
31 | // MARK: Variables & properties
32 |
33 | fileprivate var handler: GestureRecognizerHandler?
34 |
35 | public var recognizeSimultaneouslyWithOtherGestures: Bool {
36 | get {
37 | return self.delegate === self
38 | }
39 | set {
40 | self.delegate = self
41 | }
42 | }
43 |
44 | // MARK: Public methods
45 |
46 | // MARK: Private methods
47 |
48 | @objc
49 | internal func runHandler() {
50 | self.handler?(self)
51 | }
52 |
53 | // MARK: Protocol methods
54 |
55 | public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
56 | return true
57 | }
58 |
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/Source/Classes/Recognizers/ScreenEdgePan/ScreenEdgePanGestureRecognizer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ScreenEdgePanGestureRecognizer.swift
3 | // Sensitive
4 | //
5 | // Created by Igor Matyushkin on 04.01.16.
6 | // Copyright © 2016 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public class ScreenEdgePanGestureRecognizer: UIScreenEdgePanGestureRecognizer, UIGestureRecognizerDelegate {
12 |
13 | // MARK: Class variables & properties
14 |
15 | // MARK: Class methods
16 |
17 | // MARK: Initializers
18 |
19 | public init(handler: @escaping GestureRecognizerHandler) {
20 | super.init(target: nil, action: nil)
21 | self.handler = handler
22 | self.recognizeSimultaneouslyWithOtherGestures = true
23 | self.addTarget(self, action: #selector(runHandler))
24 | }
25 |
26 | // MARK: Deinitializer
27 |
28 | deinit {
29 | }
30 |
31 | // MARK: Variables & properties
32 |
33 | fileprivate var handler: GestureRecognizerHandler?
34 |
35 | public var recognizeSimultaneouslyWithOtherGestures: Bool {
36 | get {
37 | return self.delegate === self
38 | }
39 | set {
40 | self.delegate = self
41 | }
42 | }
43 |
44 | // MARK: Public methods
45 |
46 | // MARK: Private methods
47 |
48 | @objc
49 | internal func runHandler() {
50 | self.handler?(self)
51 | }
52 |
53 | // MARK: Protocol methods
54 |
55 | public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
56 | return true
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/Source/Classes/Recognizers/Swipe/SwipeGestureRecognizer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SwipeGestureRecognizer.swift
3 | // Sensitive
4 | //
5 | // Created by Igor Matyushkin on 04.01.16.
6 | // Copyright © 2016 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public class SwipeGestureRecognizer: UISwipeGestureRecognizer, UIGestureRecognizerDelegate {
12 |
13 | // MARK: Class variables & properties
14 |
15 | // MARK: Class methods
16 |
17 | // MARK: Initializers
18 |
19 | public init(handler: @escaping GestureRecognizerHandler) {
20 | super.init(target: nil, action: nil)
21 | self.handler = handler
22 | self.recognizeSimultaneouslyWithOtherGestures = true
23 | self.addTarget(self, action: #selector(runHandler))
24 | }
25 |
26 | // MARK: Deinitializer
27 |
28 | deinit {
29 | }
30 |
31 | // MARK: Variables & properties
32 |
33 | fileprivate var handler: GestureRecognizerHandler?
34 |
35 | public var recognizeSimultaneouslyWithOtherGestures: Bool {
36 | get {
37 | return self.delegate === self
38 | }
39 | set {
40 | self.delegate = newValue ? self : nil
41 | }
42 | }
43 |
44 | // MARK: Public methods
45 |
46 | // MARK: Private methods
47 |
48 | @objc
49 | internal func runHandler() {
50 | self.handler?(self)
51 | }
52 |
53 | // MARK: Protocol methods
54 |
55 | public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
56 | return true
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/Source/Classes/Recognizers/Tap/TapGestureRecognizer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // TapGestureRecognizer.swift
3 | // Sensitive
4 | //
5 | // Created by Igor Matyushkin on 17.12.15.
6 | // Copyright © 2015 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public final class TapGestureRecognizer: UITapGestureRecognizer, UIGestureRecognizerDelegate {
12 |
13 | // MARK: Class variables & properties
14 |
15 | // MARK: Class methods
16 |
17 | // MARK: Initializers
18 |
19 | public init(handler: @escaping GestureRecognizerHandler) {
20 | super.init(target: nil, action: nil)
21 | self.handler = handler
22 | self.recognizeSimultaneouslyWithOtherGestures = true
23 | self.addTarget(self, action: #selector(runHandler))
24 | }
25 |
26 | // MARK: Deinitializer
27 |
28 | deinit {
29 | }
30 |
31 | // MARK: Variables & properties
32 |
33 | fileprivate var handler: GestureRecognizerHandler?
34 |
35 | public var recognizeSimultaneouslyWithOtherGestures: Bool {
36 | get {
37 | return self.delegate === self
38 | }
39 | set {
40 | self.delegate = self
41 | }
42 | }
43 |
44 | // MARK: Public methods
45 |
46 | // MARK: Private methods
47 |
48 | @objc
49 | internal func runHandler() {
50 | self.handler?(self)
51 | }
52 |
53 | // MARK: Protocol methods
54 |
55 | public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
56 | return true
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/Source/Extensions/View/UIViewExtensionGestures.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewExtensionGestures.swift
3 | // Sensitive
4 | //
5 | // Created by Igor Matyushkin on 30.06.2018.
6 | // Copyright © 2018 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import UIKit
11 |
12 | public extension UIView {
13 |
14 | public var onTap: Gesture {
15 | get {
16 | return Gesture(withRecognizerOfType: UITapGestureRecognizer.self)
17 | .add(toView: self)
18 | }
19 | }
20 |
21 | public var onLongPress: Gesture {
22 | get {
23 | return Gesture(withRecognizerOfType: UILongPressGestureRecognizer.self)
24 | .add(toView: self)
25 | }
26 | }
27 |
28 | public var onPan: Gesture {
29 | get {
30 | return Gesture(withRecognizerOfType: UIPanGestureRecognizer.self)
31 | .add(toView: self)
32 | }
33 | }
34 |
35 | public var onPinch: Gesture {
36 | get {
37 | return Gesture(withRecognizerOfType: UIPinchGestureRecognizer.self)
38 | .add(toView: self)
39 | }
40 | }
41 |
42 | public var onRotation: Gesture {
43 | get {
44 | return Gesture(withRecognizerOfType: UIRotationGestureRecognizer.self)
45 | .add(toView: self)
46 | }
47 | }
48 |
49 | public var onSwipe: Gesture {
50 | get {
51 | return Gesture(withRecognizerOfType: UISwipeGestureRecognizer.self)
52 | .add(toView: self)
53 | }
54 | }
55 |
56 | public var onScreenEdgePan: Gesture {
57 | get {
58 | return Gesture(withRecognizerOfType: UIScreenEdgePanGestureRecognizer.self)
59 | .add(toView: self)
60 | }
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/Source/Types/GestureRecognizerHandlers.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GestureRecognizerHandlers.swift
3 | // Sensitive
4 | //
5 | // Created by Igor Matyushkin on 14.03.17.
6 | // Copyright © 2017 Igor Matyushkin. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import UIKit
11 |
12 | public typealias GestureRecognizerHandler = (_ gestureRecognizer: GestureRecognizer) -> Void
13 |
14 | public typealias GestureRecognizerSimplifiedHandler = () -> Void
15 |
--------------------------------------------------------------------------------