├── .github └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── JaneSliderControl.podspec ├── JaneSliderControl ├── .swiftlint.yml ├── JaneSliderControl.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── JaneSliderControl │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ └── chevron.imageset │ │ │ ├── Contents.json │ │ │ └── chevron-arrow-to-right-ios-7-interface-symbol-3.png │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── ExampleViewController.swift │ └── Info.plist ├── JaneSliderControlUITests │ ├── Info.plist │ └── JaneSliderControlUITests.swift ├── SliderControl │ ├── Info.plist │ ├── SliderControl.h │ └── SliderControl.swift └── SliderControlTests │ ├── Info.plist │ └── SliderControlTests.swift ├── LICENSE ├── README.md └── sliderGif.gif /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | _Enter the description of the issue you are fixing or the feature you are adding_ 2 | _Make sure to include any issue #s you have addressed_ 3 | 4 | ## Type of changes 5 | - [ ] Bug fix (non-breaking change) 6 | - [ ] New feature (non-breaking change) 7 | - [ ] Breaking change (fix or feature that would cause existing functionality to quit working) 8 | 9 | ## Checklist 10 | - [ ] My code did not add any warnings (and I have the latest swiftlint installed) 11 | - [ ] I followed the existing swift coding standards/practices 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | xcuserdata 3 | -------------------------------------------------------------------------------- /JaneSliderControl.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "JaneSliderControl" 3 | s.version = "2.1.3" 4 | s.summary = "The Jane Slider Control is a simple subclass of UIControl similar to slide to unlock" 5 | s.homepage = "https://github.com/jane/JaneSliderControl" 6 | s.license = 'MIT' 7 | s.author = { "Jane" => "ios@jane.com" } 8 | s.platform = :ios, "11.0" 9 | s.swift_version = "5.0" 10 | s.source = { :git => "https://github.com/jane/JaneSliderControl.git", :tag => "2.1.3" } 11 | s.source_files = "JaneSliderControl/SliderControl/*.swift" 12 | end 13 | -------------------------------------------------------------------------------- /JaneSliderControl/.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: 2 | - line_length 3 | - trailing_whitespace 4 | - force_cast 5 | - colon 6 | - variable_name 7 | - legacy_constructor 8 | - type_name 9 | - control_statement 10 | - force_try 11 | - function_parameter_count 12 | - valid_docs 13 | - void_return 14 | - fallthrough 15 | - empty_parentheses_with_trailing_closure 16 | - for_where 17 | - private_over_fileprivate 18 | - discarded_notification_center_observer 19 | - unused_closure_parameter 20 | - large_tuple 21 | - cyclomatic_complexity 22 | - redundant_string_enum_value 23 | excluded: # paths to ignore during linting. Takes precedence over `included`. 24 | - Carthage 25 | - Pods 26 | - JanePresentationUITests 27 | - fastlane 28 | type_body_length: 29 | warning: 600 30 | error: 1200 31 | function_body_length: 32 | warning: 80 33 | file_length: 34 | warning: 750 35 | error: 1200 36 | 37 | switch_case_alignment: 38 | indented_cases: true 39 | -------------------------------------------------------------------------------- /JaneSliderControl/JaneSliderControl.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B338E0B71CEB7F59002C1737 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B338E0B61CEB7F59002C1737 /* AppDelegate.swift */; }; 11 | B338E0BC1CEB7F59002C1737 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B338E0BA1CEB7F59002C1737 /* Main.storyboard */; }; 12 | B338E0BE1CEB7F59002C1737 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B338E0BD1CEB7F59002C1737 /* Assets.xcassets */; }; 13 | B338E0C11CEB7F59002C1737 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B338E0BF1CEB7F59002C1737 /* LaunchScreen.storyboard */; }; 14 | B338E0D71CEB7F59002C1737 /* JaneSliderControlUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B338E0D61CEB7F59002C1737 /* JaneSliderControlUITests.swift */; }; 15 | B338E0EC1CEB8012002C1737 /* SliderControl.h in Headers */ = {isa = PBXBuildFile; fileRef = B338E0EB1CEB8012002C1737 /* SliderControl.h */; settings = {ATTRIBUTES = (Public, ); }; }; 16 | B338E0F31CEB8012002C1737 /* SliderControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B338E0E91CEB8012002C1737 /* SliderControl.framework */; }; 17 | B338E0FA1CEB8012002C1737 /* SliderControlTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B338E0F91CEB8012002C1737 /* SliderControlTests.swift */; }; 18 | B338E0FE1CEB8012002C1737 /* SliderControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B338E0E91CEB8012002C1737 /* SliderControl.framework */; }; 19 | B338E0FF1CEB8012002C1737 /* SliderControl.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B338E0E91CEB8012002C1737 /* SliderControl.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 20 | B338E1081CEB8077002C1737 /* SliderControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = B338E1071CEB8077002C1737 /* SliderControl.swift */; }; 21 | B338E10E1CEB83C6002C1737 /* ExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B338E10D1CEB83C6002C1737 /* ExampleViewController.swift */; }; 22 | B338E10F1CEB83F7002C1737 /* SliderControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = B338E1071CEB8077002C1737 /* SliderControl.swift */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXContainerItemProxy section */ 26 | B338E0D31CEB7F59002C1737 /* PBXContainerItemProxy */ = { 27 | isa = PBXContainerItemProxy; 28 | containerPortal = B338E0AB1CEB7F59002C1737 /* Project object */; 29 | proxyType = 1; 30 | remoteGlobalIDString = B338E0B21CEB7F59002C1737; 31 | remoteInfo = JaneSliderControl; 32 | }; 33 | B338E0F41CEB8012002C1737 /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = B338E0AB1CEB7F59002C1737 /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = B338E0E81CEB8012002C1737; 38 | remoteInfo = SliderControl; 39 | }; 40 | B338E0F61CEB8012002C1737 /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = B338E0AB1CEB7F59002C1737 /* Project object */; 43 | proxyType = 1; 44 | remoteGlobalIDString = B338E0B21CEB7F59002C1737; 45 | remoteInfo = JaneSliderControl; 46 | }; 47 | B338E0FC1CEB8012002C1737 /* PBXContainerItemProxy */ = { 48 | isa = PBXContainerItemProxy; 49 | containerPortal = B338E0AB1CEB7F59002C1737 /* Project object */; 50 | proxyType = 1; 51 | remoteGlobalIDString = B338E0E81CEB8012002C1737; 52 | remoteInfo = SliderControl; 53 | }; 54 | /* End PBXContainerItemProxy section */ 55 | 56 | /* Begin PBXCopyFilesBuildPhase section */ 57 | B338E1031CEB8012002C1737 /* Embed Frameworks */ = { 58 | isa = PBXCopyFilesBuildPhase; 59 | buildActionMask = 2147483647; 60 | dstPath = ""; 61 | dstSubfolderSpec = 10; 62 | files = ( 63 | B338E0FF1CEB8012002C1737 /* SliderControl.framework in Embed Frameworks */, 64 | ); 65 | name = "Embed Frameworks"; 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXCopyFilesBuildPhase section */ 69 | 70 | /* Begin PBXFileReference section */ 71 | B338E0B31CEB7F59002C1737 /* JaneSliderControl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JaneSliderControl.app; sourceTree = BUILT_PRODUCTS_DIR; }; 72 | B338E0B61CEB7F59002C1737 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 73 | B338E0BB1CEB7F59002C1737 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 74 | B338E0BD1CEB7F59002C1737 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 75 | B338E0C01CEB7F59002C1737 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 76 | B338E0C21CEB7F59002C1737 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 77 | B338E0D21CEB7F59002C1737 /* JaneSliderControlUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JaneSliderControlUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 78 | B338E0D61CEB7F59002C1737 /* JaneSliderControlUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JaneSliderControlUITests.swift; sourceTree = ""; }; 79 | B338E0D81CEB7F59002C1737 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 80 | B338E0E91CEB8012002C1737 /* SliderControl.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SliderControl.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 81 | B338E0EB1CEB8012002C1737 /* SliderControl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SliderControl.h; sourceTree = ""; }; 82 | B338E0ED1CEB8012002C1737 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 83 | B338E0F21CEB8012002C1737 /* SliderControlTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SliderControlTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 84 | B338E0F91CEB8012002C1737 /* SliderControlTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SliderControlTests.swift; sourceTree = ""; }; 85 | B338E0FB1CEB8012002C1737 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 86 | B338E1071CEB8077002C1737 /* SliderControl.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderControl.swift; sourceTree = ""; }; 87 | B338E10D1CEB83C6002C1737 /* ExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExampleViewController.swift; sourceTree = ""; }; 88 | F8246D8A24EF3D3B00E84247 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 89 | F8A42B9F24DC99D0005DE55B /* JaneSliderControl.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; name = JaneSliderControl.podspec; path = ../JaneSliderControl.podspec; sourceTree = ""; }; 90 | /* End PBXFileReference section */ 91 | 92 | /* Begin PBXFrameworksBuildPhase section */ 93 | B338E0B01CEB7F59002C1737 /* Frameworks */ = { 94 | isa = PBXFrameworksBuildPhase; 95 | buildActionMask = 2147483647; 96 | files = ( 97 | B338E0FE1CEB8012002C1737 /* SliderControl.framework in Frameworks */, 98 | ); 99 | runOnlyForDeploymentPostprocessing = 0; 100 | }; 101 | B338E0CF1CEB7F59002C1737 /* Frameworks */ = { 102 | isa = PBXFrameworksBuildPhase; 103 | buildActionMask = 2147483647; 104 | files = ( 105 | ); 106 | runOnlyForDeploymentPostprocessing = 0; 107 | }; 108 | B338E0E51CEB8012002C1737 /* Frameworks */ = { 109 | isa = PBXFrameworksBuildPhase; 110 | buildActionMask = 2147483647; 111 | files = ( 112 | ); 113 | runOnlyForDeploymentPostprocessing = 0; 114 | }; 115 | B338E0EF1CEB8012002C1737 /* Frameworks */ = { 116 | isa = PBXFrameworksBuildPhase; 117 | buildActionMask = 2147483647; 118 | files = ( 119 | B338E0F31CEB8012002C1737 /* SliderControl.framework in Frameworks */, 120 | ); 121 | runOnlyForDeploymentPostprocessing = 0; 122 | }; 123 | /* End PBXFrameworksBuildPhase section */ 124 | 125 | /* Begin PBXGroup section */ 126 | B338E0AA1CEB7F59002C1737 = { 127 | isa = PBXGroup; 128 | children = ( 129 | F8246D8A24EF3D3B00E84247 /* README.md */, 130 | F8A42B9F24DC99D0005DE55B /* JaneSliderControl.podspec */, 131 | B338E0B51CEB7F59002C1737 /* JaneSliderControl */, 132 | B338E0D51CEB7F59002C1737 /* JaneSliderControlUITests */, 133 | B338E0EA1CEB8012002C1737 /* SliderControl */, 134 | B338E0F81CEB8012002C1737 /* SliderControlTests */, 135 | B338E0B41CEB7F59002C1737 /* Products */, 136 | ); 137 | sourceTree = ""; 138 | }; 139 | B338E0B41CEB7F59002C1737 /* Products */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | B338E0B31CEB7F59002C1737 /* JaneSliderControl.app */, 143 | B338E0D21CEB7F59002C1737 /* JaneSliderControlUITests.xctest */, 144 | B338E0E91CEB8012002C1737 /* SliderControl.framework */, 145 | B338E0F21CEB8012002C1737 /* SliderControlTests.xctest */, 146 | ); 147 | name = Products; 148 | sourceTree = ""; 149 | }; 150 | B338E0B51CEB7F59002C1737 /* JaneSliderControl */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | B338E10C1CEB8189002C1737 /* App */, 154 | B338E10B1CEB8181002C1737 /* Controllers */, 155 | B338E10A1CEB817A002C1737 /* Views */, 156 | B338E1091CEB816C002C1737 /* Models */, 157 | ); 158 | path = JaneSliderControl; 159 | sourceTree = ""; 160 | }; 161 | B338E0D51CEB7F59002C1737 /* JaneSliderControlUITests */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | B338E0D61CEB7F59002C1737 /* JaneSliderControlUITests.swift */, 165 | B338E0D81CEB7F59002C1737 /* Info.plist */, 166 | ); 167 | path = JaneSliderControlUITests; 168 | sourceTree = ""; 169 | }; 170 | B338E0EA1CEB8012002C1737 /* SliderControl */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | B338E0EB1CEB8012002C1737 /* SliderControl.h */, 174 | B338E0ED1CEB8012002C1737 /* Info.plist */, 175 | B338E1071CEB8077002C1737 /* SliderControl.swift */, 176 | ); 177 | path = SliderControl; 178 | sourceTree = ""; 179 | }; 180 | B338E0F81CEB8012002C1737 /* SliderControlTests */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | B338E0F91CEB8012002C1737 /* SliderControlTests.swift */, 184 | B338E0FB1CEB8012002C1737 /* Info.plist */, 185 | ); 186 | path = SliderControlTests; 187 | sourceTree = ""; 188 | }; 189 | B338E1091CEB816C002C1737 /* Models */ = { 190 | isa = PBXGroup; 191 | children = ( 192 | ); 193 | name = Models; 194 | sourceTree = ""; 195 | }; 196 | B338E10A1CEB817A002C1737 /* Views */ = { 197 | isa = PBXGroup; 198 | children = ( 199 | B338E0BF1CEB7F59002C1737 /* LaunchScreen.storyboard */, 200 | B338E0BA1CEB7F59002C1737 /* Main.storyboard */, 201 | ); 202 | name = Views; 203 | sourceTree = ""; 204 | }; 205 | B338E10B1CEB8181002C1737 /* Controllers */ = { 206 | isa = PBXGroup; 207 | children = ( 208 | B338E10D1CEB83C6002C1737 /* ExampleViewController.swift */, 209 | ); 210 | name = Controllers; 211 | sourceTree = ""; 212 | }; 213 | B338E10C1CEB8189002C1737 /* App */ = { 214 | isa = PBXGroup; 215 | children = ( 216 | B338E0BD1CEB7F59002C1737 /* Assets.xcassets */, 217 | B338E0B61CEB7F59002C1737 /* AppDelegate.swift */, 218 | B338E0C21CEB7F59002C1737 /* Info.plist */, 219 | ); 220 | name = App; 221 | sourceTree = ""; 222 | }; 223 | /* End PBXGroup section */ 224 | 225 | /* Begin PBXHeadersBuildPhase section */ 226 | B338E0E61CEB8012002C1737 /* Headers */ = { 227 | isa = PBXHeadersBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | B338E0EC1CEB8012002C1737 /* SliderControl.h in Headers */, 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | }; 234 | /* End PBXHeadersBuildPhase section */ 235 | 236 | /* Begin PBXNativeTarget section */ 237 | B338E0B21CEB7F59002C1737 /* JaneSliderControl */ = { 238 | isa = PBXNativeTarget; 239 | buildConfigurationList = B338E0DB1CEB7F59002C1737 /* Build configuration list for PBXNativeTarget "JaneSliderControl" */; 240 | buildPhases = ( 241 | F857D08B2204B1A5004C862F /* SwiftLint */, 242 | B338E0AF1CEB7F59002C1737 /* Sources */, 243 | B338E0B01CEB7F59002C1737 /* Frameworks */, 244 | B338E0B11CEB7F59002C1737 /* Resources */, 245 | B338E1031CEB8012002C1737 /* Embed Frameworks */, 246 | ); 247 | buildRules = ( 248 | ); 249 | dependencies = ( 250 | B338E0FD1CEB8012002C1737 /* PBXTargetDependency */, 251 | ); 252 | name = JaneSliderControl; 253 | productName = JaneSliderControl; 254 | productReference = B338E0B31CEB7F59002C1737 /* JaneSliderControl.app */; 255 | productType = "com.apple.product-type.application"; 256 | }; 257 | B338E0D11CEB7F59002C1737 /* JaneSliderControlUITests */ = { 258 | isa = PBXNativeTarget; 259 | buildConfigurationList = B338E0E11CEB7F59002C1737 /* Build configuration list for PBXNativeTarget "JaneSliderControlUITests" */; 260 | buildPhases = ( 261 | B338E0CE1CEB7F59002C1737 /* Sources */, 262 | B338E0CF1CEB7F59002C1737 /* Frameworks */, 263 | B338E0D01CEB7F59002C1737 /* Resources */, 264 | ); 265 | buildRules = ( 266 | ); 267 | dependencies = ( 268 | B338E0D41CEB7F59002C1737 /* PBXTargetDependency */, 269 | ); 270 | name = JaneSliderControlUITests; 271 | productName = JaneSliderControlUITests; 272 | productReference = B338E0D21CEB7F59002C1737 /* JaneSliderControlUITests.xctest */; 273 | productType = "com.apple.product-type.bundle.ui-testing"; 274 | }; 275 | B338E0E81CEB8012002C1737 /* SliderControl */ = { 276 | isa = PBXNativeTarget; 277 | buildConfigurationList = B338E1001CEB8012002C1737 /* Build configuration list for PBXNativeTarget "SliderControl" */; 278 | buildPhases = ( 279 | B338E0E41CEB8012002C1737 /* Sources */, 280 | B338E0E51CEB8012002C1737 /* Frameworks */, 281 | B338E0E61CEB8012002C1737 /* Headers */, 282 | B338E0E71CEB8012002C1737 /* Resources */, 283 | ); 284 | buildRules = ( 285 | ); 286 | dependencies = ( 287 | ); 288 | name = SliderControl; 289 | productName = SliderControl; 290 | productReference = B338E0E91CEB8012002C1737 /* SliderControl.framework */; 291 | productType = "com.apple.product-type.framework"; 292 | }; 293 | B338E0F11CEB8012002C1737 /* SliderControlTests */ = { 294 | isa = PBXNativeTarget; 295 | buildConfigurationList = B338E1041CEB8012002C1737 /* Build configuration list for PBXNativeTarget "SliderControlTests" */; 296 | buildPhases = ( 297 | B338E0EE1CEB8012002C1737 /* Sources */, 298 | B338E0EF1CEB8012002C1737 /* Frameworks */, 299 | B338E0F01CEB8012002C1737 /* Resources */, 300 | ); 301 | buildRules = ( 302 | ); 303 | dependencies = ( 304 | B338E0F51CEB8012002C1737 /* PBXTargetDependency */, 305 | B338E0F71CEB8012002C1737 /* PBXTargetDependency */, 306 | ); 307 | name = SliderControlTests; 308 | productName = SliderControlTests; 309 | productReference = B338E0F21CEB8012002C1737 /* SliderControlTests.xctest */; 310 | productType = "com.apple.product-type.bundle.unit-test"; 311 | }; 312 | /* End PBXNativeTarget section */ 313 | 314 | /* Begin PBXProject section */ 315 | B338E0AB1CEB7F59002C1737 /* Project object */ = { 316 | isa = PBXProject; 317 | attributes = { 318 | LastSwiftUpdateCheck = 0730; 319 | LastUpgradeCheck = 1160; 320 | ORGANIZATIONNAME = Jane; 321 | TargetAttributes = { 322 | B338E0B21CEB7F59002C1737 = { 323 | CreatedOnToolsVersion = 7.3.1; 324 | DevelopmentTeam = YU9U6J5U3K; 325 | LastSwiftMigration = 1000; 326 | }; 327 | B338E0D11CEB7F59002C1737 = { 328 | CreatedOnToolsVersion = 7.3.1; 329 | LastSwiftMigration = 1000; 330 | TestTargetID = B338E0B21CEB7F59002C1737; 331 | }; 332 | B338E0E81CEB8012002C1737 = { 333 | CreatedOnToolsVersion = 7.3.1; 334 | LastSwiftMigration = 1000; 335 | }; 336 | B338E0F11CEB8012002C1737 = { 337 | CreatedOnToolsVersion = 7.3.1; 338 | LastSwiftMigration = 1000; 339 | TestTargetID = B338E0B21CEB7F59002C1737; 340 | }; 341 | }; 342 | }; 343 | buildConfigurationList = B338E0AE1CEB7F59002C1737 /* Build configuration list for PBXProject "JaneSliderControl" */; 344 | compatibilityVersion = "Xcode 3.2"; 345 | developmentRegion = en; 346 | hasScannedForEncodings = 0; 347 | knownRegions = ( 348 | en, 349 | Base, 350 | ); 351 | mainGroup = B338E0AA1CEB7F59002C1737; 352 | productRefGroup = B338E0B41CEB7F59002C1737 /* Products */; 353 | projectDirPath = ""; 354 | projectRoot = ""; 355 | targets = ( 356 | B338E0B21CEB7F59002C1737 /* JaneSliderControl */, 357 | B338E0D11CEB7F59002C1737 /* JaneSliderControlUITests */, 358 | B338E0E81CEB8012002C1737 /* SliderControl */, 359 | B338E0F11CEB8012002C1737 /* SliderControlTests */, 360 | ); 361 | }; 362 | /* End PBXProject section */ 363 | 364 | /* Begin PBXResourcesBuildPhase section */ 365 | B338E0B11CEB7F59002C1737 /* Resources */ = { 366 | isa = PBXResourcesBuildPhase; 367 | buildActionMask = 2147483647; 368 | files = ( 369 | B338E0C11CEB7F59002C1737 /* LaunchScreen.storyboard in Resources */, 370 | B338E0BE1CEB7F59002C1737 /* Assets.xcassets in Resources */, 371 | B338E0BC1CEB7F59002C1737 /* Main.storyboard in Resources */, 372 | ); 373 | runOnlyForDeploymentPostprocessing = 0; 374 | }; 375 | B338E0D01CEB7F59002C1737 /* Resources */ = { 376 | isa = PBXResourcesBuildPhase; 377 | buildActionMask = 2147483647; 378 | files = ( 379 | ); 380 | runOnlyForDeploymentPostprocessing = 0; 381 | }; 382 | B338E0E71CEB8012002C1737 /* Resources */ = { 383 | isa = PBXResourcesBuildPhase; 384 | buildActionMask = 2147483647; 385 | files = ( 386 | ); 387 | runOnlyForDeploymentPostprocessing = 0; 388 | }; 389 | B338E0F01CEB8012002C1737 /* Resources */ = { 390 | isa = PBXResourcesBuildPhase; 391 | buildActionMask = 2147483647; 392 | files = ( 393 | ); 394 | runOnlyForDeploymentPostprocessing = 0; 395 | }; 396 | /* End PBXResourcesBuildPhase section */ 397 | 398 | /* Begin PBXShellScriptBuildPhase section */ 399 | F857D08B2204B1A5004C862F /* SwiftLint */ = { 400 | isa = PBXShellScriptBuildPhase; 401 | buildActionMask = 2147483647; 402 | files = ( 403 | ); 404 | inputFileListPaths = ( 405 | ); 406 | inputPaths = ( 407 | ); 408 | name = SwiftLint; 409 | outputFileListPaths = ( 410 | ); 411 | outputPaths = ( 412 | ); 413 | runOnlyForDeploymentPostprocessing = 0; 414 | shellPath = /bin/sh; 415 | shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; 416 | }; 417 | /* End PBXShellScriptBuildPhase section */ 418 | 419 | /* Begin PBXSourcesBuildPhase section */ 420 | B338E0AF1CEB7F59002C1737 /* Sources */ = { 421 | isa = PBXSourcesBuildPhase; 422 | buildActionMask = 2147483647; 423 | files = ( 424 | B338E0B71CEB7F59002C1737 /* AppDelegate.swift in Sources */, 425 | B338E10F1CEB83F7002C1737 /* SliderControl.swift in Sources */, 426 | B338E10E1CEB83C6002C1737 /* ExampleViewController.swift in Sources */, 427 | ); 428 | runOnlyForDeploymentPostprocessing = 0; 429 | }; 430 | B338E0CE1CEB7F59002C1737 /* Sources */ = { 431 | isa = PBXSourcesBuildPhase; 432 | buildActionMask = 2147483647; 433 | files = ( 434 | B338E0D71CEB7F59002C1737 /* JaneSliderControlUITests.swift in Sources */, 435 | ); 436 | runOnlyForDeploymentPostprocessing = 0; 437 | }; 438 | B338E0E41CEB8012002C1737 /* Sources */ = { 439 | isa = PBXSourcesBuildPhase; 440 | buildActionMask = 2147483647; 441 | files = ( 442 | B338E1081CEB8077002C1737 /* SliderControl.swift in Sources */, 443 | ); 444 | runOnlyForDeploymentPostprocessing = 0; 445 | }; 446 | B338E0EE1CEB8012002C1737 /* Sources */ = { 447 | isa = PBXSourcesBuildPhase; 448 | buildActionMask = 2147483647; 449 | files = ( 450 | B338E0FA1CEB8012002C1737 /* SliderControlTests.swift in Sources */, 451 | ); 452 | runOnlyForDeploymentPostprocessing = 0; 453 | }; 454 | /* End PBXSourcesBuildPhase section */ 455 | 456 | /* Begin PBXTargetDependency section */ 457 | B338E0D41CEB7F59002C1737 /* PBXTargetDependency */ = { 458 | isa = PBXTargetDependency; 459 | target = B338E0B21CEB7F59002C1737 /* JaneSliderControl */; 460 | targetProxy = B338E0D31CEB7F59002C1737 /* PBXContainerItemProxy */; 461 | }; 462 | B338E0F51CEB8012002C1737 /* PBXTargetDependency */ = { 463 | isa = PBXTargetDependency; 464 | target = B338E0E81CEB8012002C1737 /* SliderControl */; 465 | targetProxy = B338E0F41CEB8012002C1737 /* PBXContainerItemProxy */; 466 | }; 467 | B338E0F71CEB8012002C1737 /* PBXTargetDependency */ = { 468 | isa = PBXTargetDependency; 469 | target = B338E0B21CEB7F59002C1737 /* JaneSliderControl */; 470 | targetProxy = B338E0F61CEB8012002C1737 /* PBXContainerItemProxy */; 471 | }; 472 | B338E0FD1CEB8012002C1737 /* PBXTargetDependency */ = { 473 | isa = PBXTargetDependency; 474 | target = B338E0E81CEB8012002C1737 /* SliderControl */; 475 | targetProxy = B338E0FC1CEB8012002C1737 /* PBXContainerItemProxy */; 476 | }; 477 | /* End PBXTargetDependency section */ 478 | 479 | /* Begin PBXVariantGroup section */ 480 | B338E0BA1CEB7F59002C1737 /* Main.storyboard */ = { 481 | isa = PBXVariantGroup; 482 | children = ( 483 | B338E0BB1CEB7F59002C1737 /* Base */, 484 | ); 485 | name = Main.storyboard; 486 | sourceTree = ""; 487 | }; 488 | B338E0BF1CEB7F59002C1737 /* LaunchScreen.storyboard */ = { 489 | isa = PBXVariantGroup; 490 | children = ( 491 | B338E0C01CEB7F59002C1737 /* Base */, 492 | ); 493 | name = LaunchScreen.storyboard; 494 | sourceTree = ""; 495 | }; 496 | /* End PBXVariantGroup section */ 497 | 498 | /* Begin XCBuildConfiguration section */ 499 | B338E0D91CEB7F59002C1737 /* Debug */ = { 500 | isa = XCBuildConfiguration; 501 | buildSettings = { 502 | ALWAYS_SEARCH_USER_PATHS = NO; 503 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 504 | CLANG_ANALYZER_NONNULL = YES; 505 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 506 | CLANG_CXX_LIBRARY = "libc++"; 507 | CLANG_ENABLE_MODULES = YES; 508 | CLANG_ENABLE_OBJC_ARC = YES; 509 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 510 | CLANG_WARN_BOOL_CONVERSION = YES; 511 | CLANG_WARN_COMMA = YES; 512 | CLANG_WARN_CONSTANT_CONVERSION = YES; 513 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 514 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 515 | CLANG_WARN_EMPTY_BODY = YES; 516 | CLANG_WARN_ENUM_CONVERSION = YES; 517 | CLANG_WARN_INFINITE_RECURSION = YES; 518 | CLANG_WARN_INT_CONVERSION = YES; 519 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 520 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 521 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 522 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 523 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 524 | CLANG_WARN_STRICT_PROTOTYPES = YES; 525 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 526 | CLANG_WARN_UNREACHABLE_CODE = YES; 527 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 528 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 529 | COPY_PHASE_STRIP = NO; 530 | DEBUG_INFORMATION_FORMAT = dwarf; 531 | ENABLE_STRICT_OBJC_MSGSEND = YES; 532 | ENABLE_TESTABILITY = YES; 533 | GCC_C_LANGUAGE_STANDARD = gnu99; 534 | GCC_DYNAMIC_NO_PIC = NO; 535 | GCC_NO_COMMON_BLOCKS = YES; 536 | GCC_OPTIMIZATION_LEVEL = 0; 537 | GCC_PREPROCESSOR_DEFINITIONS = ( 538 | "DEBUG=1", 539 | "$(inherited)", 540 | ); 541 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 542 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 543 | GCC_WARN_UNDECLARED_SELECTOR = YES; 544 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 545 | GCC_WARN_UNUSED_FUNCTION = YES; 546 | GCC_WARN_UNUSED_VARIABLE = YES; 547 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 548 | MTL_ENABLE_DEBUG_INFO = YES; 549 | ONLY_ACTIVE_ARCH = YES; 550 | SDKROOT = iphoneos; 551 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 552 | TARGETED_DEVICE_FAMILY = "1,2"; 553 | }; 554 | name = Debug; 555 | }; 556 | B338E0DA1CEB7F59002C1737 /* Release */ = { 557 | isa = XCBuildConfiguration; 558 | buildSettings = { 559 | ALWAYS_SEARCH_USER_PATHS = NO; 560 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 561 | CLANG_ANALYZER_NONNULL = YES; 562 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 563 | CLANG_CXX_LIBRARY = "libc++"; 564 | CLANG_ENABLE_MODULES = YES; 565 | CLANG_ENABLE_OBJC_ARC = YES; 566 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 567 | CLANG_WARN_BOOL_CONVERSION = YES; 568 | CLANG_WARN_COMMA = YES; 569 | CLANG_WARN_CONSTANT_CONVERSION = YES; 570 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 571 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 572 | CLANG_WARN_EMPTY_BODY = YES; 573 | CLANG_WARN_ENUM_CONVERSION = YES; 574 | CLANG_WARN_INFINITE_RECURSION = YES; 575 | CLANG_WARN_INT_CONVERSION = YES; 576 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 577 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 578 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 579 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 580 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 581 | CLANG_WARN_STRICT_PROTOTYPES = YES; 582 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 583 | CLANG_WARN_UNREACHABLE_CODE = YES; 584 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 585 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 586 | COPY_PHASE_STRIP = NO; 587 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 588 | ENABLE_NS_ASSERTIONS = NO; 589 | ENABLE_STRICT_OBJC_MSGSEND = YES; 590 | GCC_C_LANGUAGE_STANDARD = gnu99; 591 | GCC_NO_COMMON_BLOCKS = YES; 592 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 593 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 594 | GCC_WARN_UNDECLARED_SELECTOR = YES; 595 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 596 | GCC_WARN_UNUSED_FUNCTION = YES; 597 | GCC_WARN_UNUSED_VARIABLE = YES; 598 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 599 | MTL_ENABLE_DEBUG_INFO = NO; 600 | SDKROOT = iphoneos; 601 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 602 | SWIFT_VERSION = 5.0; 603 | TARGETED_DEVICE_FAMILY = "1,2"; 604 | VALIDATE_PRODUCT = YES; 605 | }; 606 | name = Release; 607 | }; 608 | B338E0DC1CEB7F59002C1737 /* Debug */ = { 609 | isa = XCBuildConfiguration; 610 | buildSettings = { 611 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 612 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 613 | DEVELOPMENT_TEAM = YU9U6J5U3K; 614 | INFOPLIST_FILE = JaneSliderControl/Info.plist; 615 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 616 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 617 | PRODUCT_BUNDLE_IDENTIFIER = com.jane.JaneSliderControl; 618 | PRODUCT_NAME = "$(TARGET_NAME)"; 619 | SWIFT_VERSION = 5.0; 620 | }; 621 | name = Debug; 622 | }; 623 | B338E0DD1CEB7F59002C1737 /* Release */ = { 624 | isa = XCBuildConfiguration; 625 | buildSettings = { 626 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 627 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 628 | DEVELOPMENT_TEAM = YU9U6J5U3K; 629 | INFOPLIST_FILE = JaneSliderControl/Info.plist; 630 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 631 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 632 | PRODUCT_BUNDLE_IDENTIFIER = com.jane.JaneSliderControl; 633 | PRODUCT_NAME = "$(TARGET_NAME)"; 634 | SWIFT_VERSION = 5.0; 635 | }; 636 | name = Release; 637 | }; 638 | B338E0E21CEB7F59002C1737 /* Debug */ = { 639 | isa = XCBuildConfiguration; 640 | buildSettings = { 641 | DEVELOPMENT_TEAM = ""; 642 | INFOPLIST_FILE = JaneSliderControlUITests/Info.plist; 643 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 644 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 645 | PRODUCT_BUNDLE_IDENTIFIER = com.jane.JaneSliderControlUITests; 646 | PRODUCT_NAME = "$(TARGET_NAME)"; 647 | SWIFT_VERSION = 5.0; 648 | TEST_TARGET_NAME = JaneSliderControl; 649 | }; 650 | name = Debug; 651 | }; 652 | B338E0E31CEB7F59002C1737 /* Release */ = { 653 | isa = XCBuildConfiguration; 654 | buildSettings = { 655 | DEVELOPMENT_TEAM = ""; 656 | INFOPLIST_FILE = JaneSliderControlUITests/Info.plist; 657 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 658 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 659 | PRODUCT_BUNDLE_IDENTIFIER = com.jane.JaneSliderControlUITests; 660 | PRODUCT_NAME = "$(TARGET_NAME)"; 661 | SWIFT_VERSION = 5.0; 662 | TEST_TARGET_NAME = JaneSliderControl; 663 | }; 664 | name = Release; 665 | }; 666 | B338E1011CEB8012002C1737 /* Debug */ = { 667 | isa = XCBuildConfiguration; 668 | buildSettings = { 669 | CLANG_ENABLE_MODULES = YES; 670 | CODE_SIGN_IDENTITY = ""; 671 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 672 | CURRENT_PROJECT_VERSION = 1; 673 | DEFINES_MODULE = YES; 674 | DEVELOPMENT_TEAM = ""; 675 | DYLIB_COMPATIBILITY_VERSION = 1; 676 | DYLIB_CURRENT_VERSION = 1; 677 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 678 | INFOPLIST_FILE = SliderControl/Info.plist; 679 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 680 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 681 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 682 | PRODUCT_BUNDLE_IDENTIFIER = com.jane.SliderControl; 683 | PRODUCT_NAME = "$(TARGET_NAME)"; 684 | SKIP_INSTALL = YES; 685 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 686 | SWIFT_VERSION = 5.0; 687 | VERSIONING_SYSTEM = "apple-generic"; 688 | VERSION_INFO_PREFIX = ""; 689 | }; 690 | name = Debug; 691 | }; 692 | B338E1021CEB8012002C1737 /* Release */ = { 693 | isa = XCBuildConfiguration; 694 | buildSettings = { 695 | CLANG_ENABLE_MODULES = YES; 696 | CODE_SIGN_IDENTITY = ""; 697 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 698 | CURRENT_PROJECT_VERSION = 1; 699 | DEFINES_MODULE = YES; 700 | DEVELOPMENT_TEAM = ""; 701 | DYLIB_COMPATIBILITY_VERSION = 1; 702 | DYLIB_CURRENT_VERSION = 1; 703 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 704 | INFOPLIST_FILE = SliderControl/Info.plist; 705 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 706 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 707 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 708 | PRODUCT_BUNDLE_IDENTIFIER = com.jane.SliderControl; 709 | PRODUCT_NAME = "$(TARGET_NAME)"; 710 | SKIP_INSTALL = YES; 711 | SWIFT_VERSION = 5.0; 712 | VERSIONING_SYSTEM = "apple-generic"; 713 | VERSION_INFO_PREFIX = ""; 714 | }; 715 | name = Release; 716 | }; 717 | B338E1051CEB8012002C1737 /* Debug */ = { 718 | isa = XCBuildConfiguration; 719 | buildSettings = { 720 | DEVELOPMENT_TEAM = ""; 721 | INFOPLIST_FILE = SliderControlTests/Info.plist; 722 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 723 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 724 | PRODUCT_BUNDLE_IDENTIFIER = com.jane.SliderControlTests; 725 | PRODUCT_NAME = "$(TARGET_NAME)"; 726 | SWIFT_VERSION = 5.0; 727 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JaneSliderControl.app/JaneSliderControl"; 728 | }; 729 | name = Debug; 730 | }; 731 | B338E1061CEB8012002C1737 /* Release */ = { 732 | isa = XCBuildConfiguration; 733 | buildSettings = { 734 | DEVELOPMENT_TEAM = ""; 735 | INFOPLIST_FILE = SliderControlTests/Info.plist; 736 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 737 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 738 | PRODUCT_BUNDLE_IDENTIFIER = com.jane.SliderControlTests; 739 | PRODUCT_NAME = "$(TARGET_NAME)"; 740 | SWIFT_VERSION = 5.0; 741 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JaneSliderControl.app/JaneSliderControl"; 742 | }; 743 | name = Release; 744 | }; 745 | /* End XCBuildConfiguration section */ 746 | 747 | /* Begin XCConfigurationList section */ 748 | B338E0AE1CEB7F59002C1737 /* Build configuration list for PBXProject "JaneSliderControl" */ = { 749 | isa = XCConfigurationList; 750 | buildConfigurations = ( 751 | B338E0D91CEB7F59002C1737 /* Debug */, 752 | B338E0DA1CEB7F59002C1737 /* Release */, 753 | ); 754 | defaultConfigurationIsVisible = 0; 755 | defaultConfigurationName = Release; 756 | }; 757 | B338E0DB1CEB7F59002C1737 /* Build configuration list for PBXNativeTarget "JaneSliderControl" */ = { 758 | isa = XCConfigurationList; 759 | buildConfigurations = ( 760 | B338E0DC1CEB7F59002C1737 /* Debug */, 761 | B338E0DD1CEB7F59002C1737 /* Release */, 762 | ); 763 | defaultConfigurationIsVisible = 0; 764 | defaultConfigurationName = Release; 765 | }; 766 | B338E0E11CEB7F59002C1737 /* Build configuration list for PBXNativeTarget "JaneSliderControlUITests" */ = { 767 | isa = XCConfigurationList; 768 | buildConfigurations = ( 769 | B338E0E21CEB7F59002C1737 /* Debug */, 770 | B338E0E31CEB7F59002C1737 /* Release */, 771 | ); 772 | defaultConfigurationIsVisible = 0; 773 | defaultConfigurationName = Release; 774 | }; 775 | B338E1001CEB8012002C1737 /* Build configuration list for PBXNativeTarget "SliderControl" */ = { 776 | isa = XCConfigurationList; 777 | buildConfigurations = ( 778 | B338E1011CEB8012002C1737 /* Debug */, 779 | B338E1021CEB8012002C1737 /* Release */, 780 | ); 781 | defaultConfigurationIsVisible = 0; 782 | defaultConfigurationName = Release; 783 | }; 784 | B338E1041CEB8012002C1737 /* Build configuration list for PBXNativeTarget "SliderControlTests" */ = { 785 | isa = XCConfigurationList; 786 | buildConfigurations = ( 787 | B338E1051CEB8012002C1737 /* Debug */, 788 | B338E1061CEB8012002C1737 /* Release */, 789 | ); 790 | defaultConfigurationIsVisible = 0; 791 | defaultConfigurationName = Release; 792 | }; 793 | /* End XCConfigurationList section */ 794 | }; 795 | rootObject = B338E0AB1CEB7F59002C1737 /* Project object */; 796 | } 797 | -------------------------------------------------------------------------------- /JaneSliderControl/JaneSliderControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JaneSliderControl/JaneSliderControl.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /JaneSliderControl/JaneSliderControl/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // JaneSliderControl 4 | // 5 | // Created by Barlow Tucker on 5/17/16. 6 | // Copyright © 2016 Jane. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { 17 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | func applicationWillResignActive(_ application: UIApplication) { 22 | // 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. 23 | // 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. 24 | } 25 | 26 | func applicationDidEnterBackground(_ application: UIApplication) { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | func applicationWillEnterForeground(_ application: UIApplication) { 32 | // 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. 33 | } 34 | 35 | func applicationDidBecomeActive(_ application: UIApplication) { 36 | // 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. 37 | } 38 | 39 | func applicationWillTerminate(_ application: UIApplication) { 40 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /JaneSliderControl/JaneSliderControl/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /JaneSliderControl/JaneSliderControl/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /JaneSliderControl/JaneSliderControl/Assets.xcassets/chevron.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chevron-arrow-to-right-ios-7-interface-symbol-3.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JaneSliderControl/JaneSliderControl/Assets.xcassets/chevron.imageset/chevron-arrow-to-right-ios-7-interface-symbol-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jane/JaneSliderControl/369f093e2229a1b27f77390f8c78726c438f431c/JaneSliderControl/JaneSliderControl/Assets.xcassets/chevron.imageset/chevron-arrow-to-right-ios-7-interface-symbol-3.png -------------------------------------------------------------------------------- /JaneSliderControl/JaneSliderControl/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /JaneSliderControl/JaneSliderControl/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 120 | 126 | 132 | 138 | 145 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | -------------------------------------------------------------------------------- /JaneSliderControl/JaneSliderControl/ExampleViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleViewController.swift 3 | // JaneSliderControl 4 | // 5 | // Created by Barlow Tucker on 5/17/16. 6 | // Copyright © 2016 Jane. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ExampleViewController: UIViewController { 12 | 13 | @IBOutlet weak var topSlider: SliderControl! 14 | @IBOutlet weak var leftSlider: SliderControl! 15 | @IBOutlet weak var rightSlider: SliderControl! 16 | @IBOutlet weak var thinSlider: SliderControl! 17 | 18 | @IBOutlet weak var sliderLabel: UILabel! 19 | @IBOutlet weak var statusLabel: UILabel! 20 | 21 | fileprivate func sliderName(_ slider:SliderControl) -> String { 22 | switch (slider) { 23 | case self.topSlider: return "Top Slider" 24 | case self.leftSlider: return "Middle Left Slider" 25 | case self.rightSlider: return "Middle Right Slider" 26 | case self.thinSlider: return "Bottom Slider" 27 | default: return "Unknown Slider" 28 | } 29 | } 30 | 31 | @IBAction func resetTapped(_ sender: AnyObject) { 32 | self.topSlider.reset() 33 | self.leftSlider.reset() 34 | self.rightSlider.reset() 35 | self.thinSlider.reset() 36 | } 37 | @IBAction func toggleTapped(_ sender: Any) { 38 | self.topSlider.setProgress(self.topSlider.progress == 0 ? 1 : 0, animated: true) 39 | self.leftSlider.setProgress(self.leftSlider.progress == 0 ? 1 : 0, animated: true) 40 | self.rightSlider.setProgress(self.rightSlider.progress == 0 ? 1 : 0, animated: true) 41 | self.thinSlider.setProgress(self.thinSlider.progress == 0 ? 1 : 0, animated: true) 42 | } 43 | @IBAction func sliderChanged(_ sender: SliderControl) { 44 | self.sliderLabel.text = self.sliderName(sender) 45 | self.statusLabel.text = "Changing: Progress: \(sender.progress)" 46 | } 47 | @IBAction func sliderFinished(_ sender: SliderControl) { 48 | self.sliderLabel.text = self.sliderName(sender) 49 | self.statusLabel.text = "Finished" 50 | } 51 | @IBAction func slideCanceled(_ sender: SliderControl) { 52 | self.sliderLabel.text = self.sliderName(sender) 53 | self.statusLabel.text = "Canceled" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /JaneSliderControl/JaneSliderControl/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /JaneSliderControl/JaneSliderControlUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /JaneSliderControl/JaneSliderControlUITests/JaneSliderControlUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JaneSliderControlUITests.swift 3 | // JaneSliderControlUITests 4 | // 5 | // Created by Barlow Tucker on 5/17/16. 6 | // Copyright © 2016 Jane. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class JaneSliderControlUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /JaneSliderControl/SliderControl/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /JaneSliderControl/SliderControl/SliderControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // SliderControl.h 3 | // SliderControl 4 | // 5 | // Copyright © 2016 Jane. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for SliderControl. 11 | FOUNDATION_EXPORT double SliderControlVersionNumber; 12 | 13 | //! Project version string for SliderControl. 14 | FOUNDATION_EXPORT const unsigned char SliderControlVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | -------------------------------------------------------------------------------- /JaneSliderControl/SliderControl/SliderControl.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SliderControl.swift 3 | // JaneSliderControl 4 | // 5 | // Created by Barlow Tucker on 5/17/16. 6 | // Copyright © 2016 Jane. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @IBDesignable open class SliderControl: UIControl { 12 | 13 | private enum HapticFeedbackIndicator { 14 | case success, cancel, none 15 | } 16 | 17 | // MARK: - Private Variables 18 | private var shouldSlide: Bool = false 19 | private var sliderXOffset: CGFloat = 0 20 | private var sliderWidthConstraint:NSLayoutConstraint! 21 | private var sliderImageWidthConstraint:NSLayoutConstraint! 22 | private var hapticFeedbackIndicator: HapticFeedbackIndicator = .none 23 | private let successThreshold: Float = 0.65 24 | 25 | // MARK: - Public Variables 26 | public let slider:UIView = UIView() 27 | public let sliderLabel:UILabel = UILabel() 28 | public let imageView:UIImageView = UIImageView() 29 | 30 | public fileprivate(set) var progress:Float = 0.0 31 | 32 | // MARK: - IBInspectable Variables 33 | @IBInspectable open var sliderColor:UIColor = UIColor.lightGray { 34 | didSet { 35 | self.slider.backgroundColor = self.sliderColor 36 | self.setNeedsLayout() 37 | } 38 | } 39 | @IBInspectable open var textColor:UIColor = UIColor.black { 40 | didSet { 41 | self.sliderLabel.textColor = self.textColor 42 | self.setNeedsLayout() 43 | } 44 | } 45 | @IBInspectable open var cornerRadius:Float = 0 { 46 | didSet { 47 | self.layer.cornerRadius = CGFloat(self.cornerRadius) 48 | self.slider.layer.cornerRadius = CGFloat(self.cornerRadius) 49 | self.setNeedsLayout() 50 | } 51 | } 52 | @IBInspectable open var sliderText:String = "" { 53 | didSet { 54 | self.sliderLabel.text = sliderText 55 | self.setNeedsLayout() 56 | } 57 | } 58 | @IBInspectable open var sliderWidth:Float = 50.0 { 59 | didSet { 60 | self.sliderWidthConstraint.constant = CGFloat(self.sliderWidth) 61 | self.sliderImageWidthConstraint.constant = CGFloat(self.sliderWidth) 62 | self.setNeedsLayout() 63 | } 64 | } 65 | @IBInspectable open var sliderImage:UIImage? = nil { 66 | didSet { 67 | self.imageView.image = self.sliderImage 68 | self.setNeedsLayout() 69 | } 70 | } 71 | open var sliderImageContentMode:UIView.ContentMode = .scaleAspectFit { 72 | didSet { 73 | self.imageView.contentMode = self.sliderImageContentMode 74 | self.setNeedsLayout() 75 | } 76 | } 77 | open var sliderFont:UIFont = UIFont.systemFont(ofSize: 14) { 78 | didSet { 79 | self.sliderLabel.font = self.sliderFont 80 | self.setNeedsLayout() 81 | } 82 | } 83 | 84 | // MARK: - UIControl 85 | public override init(frame: CGRect) { 86 | super.init(frame: frame) 87 | self.setupSlider() 88 | } 89 | 90 | public required init?(coder aDecoder: NSCoder) { 91 | super.init(coder: aDecoder) 92 | self.setupSlider() 93 | } 94 | 95 | // MARK: - Private Methods 96 | fileprivate func addVisualConstraints(_ vertical:String, horizontal:String, view:UIView, toView:UIView) { 97 | let veritcalConstraints = NSLayoutConstraint.constraints(withVisualFormat: vertical, options: [], metrics: nil, views: ["view":view]) 98 | let horizontalConstraints = NSLayoutConstraint.constraints(withVisualFormat: horizontal, options: [], metrics: nil, views: ["view":view]) 99 | self.addConstraints(veritcalConstraints) 100 | self.addConstraints(horizontalConstraints) 101 | } 102 | 103 | fileprivate func setupSlider() { 104 | //Apply the custom slider styling 105 | self.layer.cornerRadius = CGFloat(self.cornerRadius) 106 | self.layer.masksToBounds = true 107 | 108 | //Add the slider label and set the constraints that will keep it centered 109 | self.sliderLabel.translatesAutoresizingMaskIntoConstraints = false 110 | self.sliderLabel.textAlignment = .center 111 | self.sliderLabel.textColor = self.textColor 112 | self.sliderLabel.font = self.sliderFont 113 | self.addSubview(self.sliderLabel) 114 | self.addVisualConstraints("V:|[view]|", horizontal: "H:|[view]|", view: self.sliderLabel, toView: self) 115 | 116 | //Create Slider 117 | self.slider.translatesAutoresizingMaskIntoConstraints = false 118 | self.slider.backgroundColor = self.sliderColor 119 | self.slider.layer.cornerRadius = CGFloat(self.cornerRadius) 120 | self.slider.layer.masksToBounds = true 121 | self.addSubview(self.slider) 122 | self.addVisualConstraints("V:|[view]|", horizontal: "H:|[view]", view: self.slider, toView: self) 123 | self.sliderWidthConstraint = NSLayoutConstraint(item: self.slider, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: CGFloat(self.sliderWidth)) 124 | self.slider.addConstraint(self.sliderWidthConstraint) 125 | 126 | //ImageView for optional slider image 127 | self.imageView.translatesAutoresizingMaskIntoConstraints = false 128 | self.slider.addSubview(self.imageView) 129 | self.imageView.contentMode = self.sliderImageContentMode 130 | self.imageView.image = self.sliderImage 131 | self.addVisualConstraints("V:|[view]|", horizontal: "H:[view]|", view:self.imageView, toView: self.slider) 132 | self.sliderImageWidthConstraint = NSLayoutConstraint(item: self.imageView, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: CGFloat(self.sliderWidth)) 133 | self.imageView.addConstraint(self.sliderImageWidthConstraint) 134 | 135 | //Add pan gesture to slide the slider view 136 | let pan = UIPanGestureRecognizer(target: self, action: #selector(self.panGesture(_:))) 137 | self.addGestureRecognizer(pan) 138 | } 139 | 140 | // MARK: - Public Methods 141 | open func reset() { 142 | self.progress = 0.0 143 | self.sliderWidthConstraint.constant = CGFloat(self.sliderWidth) 144 | self.setNeedsUpdateConstraints() 145 | self.layoutIfNeeded() 146 | } 147 | 148 | open func setProgress(_ progress: Float, animated: Bool) { 149 | self.progress = progress 150 | 151 | let minWidth = CGFloat(self.sliderWidth) 152 | let maxWidth = self.bounds.width 153 | let newX = min(maxWidth, minWidth + (CGFloat(progress) * (maxWidth - minWidth))) 154 | 155 | self.sliderWidthConstraint.constant = newX 156 | self.setNeedsUpdateConstraints() 157 | 158 | if animated { 159 | UIView.animate(withDuration: 0.25, animations: { 160 | self.layoutIfNeeded() 161 | }, completion: nil) 162 | } 163 | } 164 | 165 | @objc func panGesture(_ recognizer:UIPanGestureRecognizer) { 166 | let initialX = recognizer.location(in: self).x 167 | let padding: CGFloat = 20.0 168 | 169 | let x = initialX + self.sliderXOffset 170 | 171 | switch (recognizer.state) { 172 | case .began: 173 | //Only slide if the gestures starts within the slide frame 174 | let sliderX = recognizer.location(in: self.slider).x 175 | self.shouldSlide = sliderX > 0 && sliderX < self.slider.bounds.width + 30 176 | if self.progress == 0 { 177 | self.sliderXOffset = 0 178 | } else { 179 | self.sliderXOffset = self.bounds.width - initialX 180 | } 181 | self.sendActions(for: .editingDidBegin) 182 | case .changed: 183 | guard self.shouldSlide && x > 0 && x <= self.bounds.width + padding else { return } 184 | self.sliderWidthConstraint.constant = x 185 | let progress = Float(min(x/self.bounds.size.width, 1)) 186 | if #available(iOS 10.0, *) { 187 | if progress > self.successThreshold, progress > self.progress, self.hapticFeedbackIndicator != .success { 188 | self.hapticFeedbackIndicator = .success 189 | UIImpactFeedbackGenerator(style: .medium).impactOccurred() 190 | } else if progress <= self.successThreshold, progress < self.progress, self.hapticFeedbackIndicator != .cancel { 191 | self.hapticFeedbackIndicator = .cancel 192 | if #available(iOS 13.0, *) { 193 | UIImpactFeedbackGenerator(style: .rigid).impactOccurred() 194 | } else { 195 | UIImpactFeedbackGenerator(style: .heavy).impactOccurred() 196 | } 197 | } 198 | } 199 | self.progress = progress 200 | self.sendActions(for: .valueChanged) 201 | case .ended, .cancelled: 202 | self.hapticFeedbackIndicator = .none 203 | guard self.shouldSlide else { return } 204 | self.shouldSlide = false 205 | 206 | self.progress = Float(x/self.bounds.size.width) 207 | let success: Bool 208 | let finalX: CGFloat 209 | 210 | //If we are more than 65% through the swipe and moving the the right direction 211 | if self.progress > self.successThreshold && recognizer.velocity(in: self).x > -1.0 { 212 | success = true 213 | finalX = self.bounds.size.width 214 | } else { 215 | success = false 216 | finalX = CGFloat(self.sliderWidth) 217 | self.progress = 0.0 218 | } 219 | 220 | self.sliderWidthConstraint.constant = finalX 221 | self.setNeedsUpdateConstraints() 222 | 223 | UIView.animate(withDuration: 0.25, animations: { 224 | self.layoutIfNeeded() 225 | }, completion: { (finished) in 226 | if success { 227 | if #available(iOS 9.0, *) { 228 | self.sendActions(for: .primaryActionTriggered) 229 | } 230 | 231 | self.sendActions(for: .editingDidEnd) 232 | } else { 233 | self.sendActions(for: .touchCancel) 234 | } 235 | }) 236 | default: break 237 | } 238 | } 239 | } 240 | -------------------------------------------------------------------------------- /JaneSliderControl/SliderControlTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /JaneSliderControl/SliderControlTests/SliderControlTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SliderControlTests.swift 3 | // SliderControlTests 4 | // 5 | // Created by Barlow Tucker on 5/17/16. 6 | // Copyright © 2016 Jane. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import SliderControl 11 | 12 | class SliderControlTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Jane 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JaneSliderControl 2 | ## Overview 3 | The JaneSliderControl is a UIControl subclass that can be customized to fit the style of your app. It provides feedback for starting the slide, progress while sliding, canceling the slide and finishing the slide. 4 | 5 | ![Example Gif](sliderGif.gif) 6 | 7 | ## Swift Version 8 | For using swift version `3.0`, tags `0.2.*` 9 | For using swift version `2.3`, tags `0.1.*` 10 | 11 | ## Setup 12 | ### Install using Cocoapods (recommended) 13 | 1. Add `JaneSliderControl` to your podfile and run `pod install` 14 | 2. Add a JaneSliderControl to your `UIViewController` either programmatically or using storyboards. 15 | 3. Add one or more of the `IBActions` listed in the Features section below 16 | 17 | > To install without Cocoapods, add the `SliderControl.swift` file found in `JaneSliderControl/SliderControl/` then follow steps 2 and 3. 18 | 19 | ## Features 20 | ### IBActions 21 | You can use the following IBActions with the JaneSliderControl: 22 | 23 | |IBAction|Description| 24 | |---|---| 25 | |`.EditingDidBegin`|User has started sliding| 26 | |`.ValueChanged`|User is sliding the control| 27 | |`.PrimaryActionTriggered`|User finished sliding the control.
(Note: this only works on iOS 9 and above)| 28 | |`.EditingDidEnd`|User finished sliding the control.
(Note: use in place of `.PrimaryActionTriggered` if you target a version of iOS below 9.0)| 29 | |`.TouchCancel`|User did not finish sliding the control| 30 | 31 | ### Customize 32 | The control has the following properties to customize the look of the slider control. They all have the IBInspectable tag, though IB does not currently support all the types used, so some items will have to be set programmatically. 33 | 34 | > Note: in the descriptions below, we are calling the part of the slider control that slides over top the background "slider", the part that the slider slide over the "background", and the complete control is just called the "control" 35 | 36 | |Variable|Can Set in IB|Description| 37 | |---|:---:|---| 38 | |sliderColor|**Yes**|The color of the slider| 39 | |textColor|**Yes**|The color of the background text| 40 | |cornerRadius|**Yes**|The corner radius for both the control and the slider| 41 | |sliderText|**Yes**|The text that goes over the background| 42 | |sliderWidth|**Yes**|The width of the slider (not the control)| 43 | |sliderImage|**Yes**|An optional image to go on the slider. The image will stick to the in of the slider as it slides| 44 | |sliderImageContentMode|No|ContentMode for the sliderImage| 45 | |sliderFont|No|The font for the sliderText| 46 | 47 | ### Other Properties 48 | The slider also has a read only property called `progress` that tells you the progress of the slider as it slides. The values range from 0 to 1. 49 | 50 | You can manually set the progress using `.setProgress(1, animated: true)`. This works to toggle the slider on/off with values 1 and 0. 51 | 52 | ## License 53 | This project is made available with the MIT License. 54 | 55 | ## Feedback 56 | If you have any issues or feature request for this project, please create an issue and/or send us a pull request. 57 | 58 | We hope you enjoy the JaneSliderControl! 59 | -------------------------------------------------------------------------------- /sliderGif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jane/JaneSliderControl/369f093e2229a1b27f77390f8c78726c438f431c/sliderGif.gif --------------------------------------------------------------------------------