diff --git a/.swift-version b/.swift-version deleted file mode 100644 index 9f55b2c..0000000 --- a/.swift-version +++ /dev/null @@ -1 +0,0 @@ -3.0 diff --git a/Example/Podfile b/Example/Podfile index 3bab2a4..13e8828 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -1,10 +1,11 @@ -platform :ios, '9.0' +platform :ios, '10.0' source 'https://github.com/CocoaPods/Specs.git' use_frameworks! def shared_pods pod 'DynamicColor', '~> 3.1' + pod 'StyledLabel', '~> 2.0' end target 'SnappingStepper' do diff --git a/Example/SnappingStepper/Info.plist b/Example/SnappingStepper/Info.plist index a5d169c..21baa19 100644 --- a/Example/SnappingStepper/Info.plist +++ b/Example/SnappingStepper/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.3.1 + 3.0 CFBundleSignature ???? CFBundleVersion diff --git a/Example/SnappingStepperExample.xcodeproj/project.pbxproj b/Example/SnappingStepperExample.xcodeproj/project.pbxproj index a39a410..0529505 100644 --- a/Example/SnappingStepperExample.xcodeproj/project.pbxproj +++ b/Example/SnappingStepperExample.xcodeproj/project.pbxproj @@ -7,12 +7,12 @@ objects = { /* Begin PBXBuildFile section */ - 01AA9210AD07C825DAE1F607 /* Pods_SnappingStepperExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 449D06ECFFEC0DD8C4DA6EF2 /* Pods_SnappingStepperExample.framework */; }; - 0D1DA54DFA51DA8D2A48E14A /* Pods_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09E3430E9EA28A5D0C4ED262 /* Pods_Tests.framework */; }; + 46B052E24C9D91F8A2B8BE11 /* Pods_SnappingStepperExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05B7A561BE896062CC5956B6 /* Pods_SnappingStepperExample.framework */; }; 5B1EFC7E1D71932E0040AD50 /* StyledControlDirection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B1EFC7D1D71932E0040AD50 /* StyledControlDirection.swift */; }; 5B1EFC7F1D71932E0040AD50 /* StyledControlDirection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B1EFC7D1D71932E0040AD50 /* StyledControlDirection.swift */; }; 5B1EFC801D71932E0040AD50 /* StyledControlDirection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B1EFC7D1D71932E0040AD50 /* StyledControlDirection.swift */; }; - 5E1F7E9CB92461FE26B43DF2 /* Pods_SnappingStepper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 921B58F6F24292F873D6FE4A /* Pods_SnappingStepper.framework */; }; + 6721FC108605E3281738E988 /* Pods_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBDBE85B9CA336124560E44E /* Pods_Tests.framework */; }; + 95EDD1B65E463FAC0841CE03 /* Pods_SnappingStepper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 668E61D7AF9643FCB59F5765 /* Pods_SnappingStepper.framework */; }; CE132D681D0880EB00CA6DB5 /* UIBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE132D671D0880EB00CA6DB5 /* UIBuilder.swift */; }; CE132D691D0880EB00CA6DB5 /* UIBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE132D671D0880EB00CA6DB5 /* UIBuilder.swift */; }; CE132D6A1D08810C00CA6DB5 /* UIBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE132D671D0880EB00CA6DB5 /* UIBuilder.swift */; }; @@ -24,26 +24,17 @@ CE8FFEB21BAB22C100D43F38 /* SnappingStepper.h in Headers */ = {isa = PBXBuildFile; fileRef = CE8FFEB11BAB22C100D43F38 /* SnappingStepper.h */; settings = {ATTRIBUTES = (Public, ); }; }; CE8FFEC41BAB22C100D43F38 /* SnappingStepper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE8FFEAF1BAB22C100D43F38 /* SnappingStepper.framework */; }; CE8FFEC51BAB22C100D43F38 /* SnappingStepper.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CE8FFEAF1BAB22C100D43F38 /* SnappingStepper.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - CE972EEE1D044B7E00EDE4A7 /* CustomShapeLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EE71D044B7E00EDE4A7 /* CustomShapeLayer.swift */; }; - CE972EEF1D044B7E00EDE4A7 /* CustomShapeLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EE71D044B7E00EDE4A7 /* CustomShapeLayer.swift */; }; - CE972EF01D044B7E00EDE4A7 /* ShapeStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EE81D044B7E00EDE4A7 /* ShapeStyle.swift */; }; - CE972EF11D044B7E00EDE4A7 /* ShapeStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EE81D044B7E00EDE4A7 /* ShapeStyle.swift */; }; CE972EF21D044B7E00EDE4A7 /* SnappingStepper+Internal.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EE91D044B7E00EDE4A7 /* SnappingStepper+Internal.swift */; }; CE972EF31D044B7E00EDE4A7 /* SnappingStepper+Internal.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EE91D044B7E00EDE4A7 /* SnappingStepper+Internal.swift */; }; CE972EF41D044B7E00EDE4A7 /* SnappingStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EEA1D044B7E00EDE4A7 /* SnappingStepper.swift */; }; CE972EF51D044B7E00EDE4A7 /* SnappingStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EEA1D044B7E00EDE4A7 /* SnappingStepper.swift */; }; CE972EF61D044B7E00EDE4A7 /* SnappingStepperBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EEB1D044B7E00EDE4A7 /* SnappingStepperBehavior.swift */; }; CE972EF71D044B7E00EDE4A7 /* SnappingStepperBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EEB1D044B7E00EDE4A7 /* SnappingStepperBehavior.swift */; }; - CE972EF81D044B7E00EDE4A7 /* StyledLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EEC1D044B7E00EDE4A7 /* StyledLabel.swift */; }; - CE972EF91D044B7E00EDE4A7 /* StyledLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EEC1D044B7E00EDE4A7 /* StyledLabel.swift */; }; CE972EFA1D044B7E00EDE4A7 /* UITouchGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EED1D044B7E00EDE4A7 /* UITouchGestureRecognizer.swift */; }; CE972EFB1D044B7E00EDE4A7 /* UITouchGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EED1D044B7E00EDE4A7 /* UITouchGestureRecognizer.swift */; }; - CE972EFC1D044B8200EDE4A7 /* CustomShapeLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EE71D044B7E00EDE4A7 /* CustomShapeLayer.swift */; }; - CE972EFD1D044B8200EDE4A7 /* ShapeStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EE81D044B7E00EDE4A7 /* ShapeStyle.swift */; }; CE972EFE1D044B8200EDE4A7 /* SnappingStepper+Internal.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EE91D044B7E00EDE4A7 /* SnappingStepper+Internal.swift */; }; CE972EFF1D044B8200EDE4A7 /* SnappingStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EEA1D044B7E00EDE4A7 /* SnappingStepper.swift */; }; CE972F001D044B8200EDE4A7 /* SnappingStepperBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EEB1D044B7E00EDE4A7 /* SnappingStepperBehavior.swift */; }; - CE972F011D044B8200EDE4A7 /* StyledLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EEC1D044B7E00EDE4A7 /* StyledLabel.swift */; }; CE972F021D044B8200EDE4A7 /* UITouchGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972EED1D044B7E00EDE4A7 /* UITouchGestureRecognizer.swift */; }; CE972F041D0453D800EDE4A7 /* AutoRepeatHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972F031D0453D800EDE4A7 /* AutoRepeatHelper.swift */; }; CE972F051D0453D800EDE4A7 /* AutoRepeatHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE972F031D0453D800EDE4A7 /* AutoRepeatHelper.swift */; }; @@ -83,16 +74,16 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 09E3430E9EA28A5D0C4ED262 /* Pods_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B63928ED40BD6C1AAE23668 /* Pods_UITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_UITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 449D06ECFFEC0DD8C4DA6EF2 /* Pods_SnappingStepperExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SnappingStepperExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 05B7A561BE896062CC5956B6 /* Pods_SnappingStepperExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SnappingStepperExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 13E6DF95652423DD357AA988 /* Pods-SnappingStepper.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SnappingStepper.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SnappingStepper/Pods-SnappingStepper.debug.xcconfig"; sourceTree = ""; }; + 51DCBE86E00B6EF820E53729 /* Pods-SnappingStepper.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SnappingStepper.release.xcconfig"; path = "Pods/Target Support Files/Pods-SnappingStepper/Pods-SnappingStepper.release.xcconfig"; sourceTree = ""; }; 5B1EFC7D1D71932E0040AD50 /* StyledControlDirection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StyledControlDirection.swift; sourceTree = ""; }; - 7C4C30B228B621354D490313 /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig"; sourceTree = ""; }; - 8B6D05BEEE35E75A880B7639 /* Pods-SnappingStepperExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SnappingStepperExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-SnappingStepperExample/Pods-SnappingStepperExample.release.xcconfig"; sourceTree = ""; }; - 921B58F6F24292F873D6FE4A /* Pods_SnappingStepper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SnappingStepper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AA5888D5090F31444D20DBDA /* Pods-SnappingStepper.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SnappingStepper.release.xcconfig"; path = "Pods/Target Support Files/Pods-SnappingStepper/Pods-SnappingStepper.release.xcconfig"; sourceTree = ""; }; - B096075174A29C2DEC848639 /* Pods-SnappingStepper.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SnappingStepper.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SnappingStepper/Pods-SnappingStepper.debug.xcconfig"; sourceTree = ""; }; - B2E3DBDEDC6BE1779FC7B5FA /* Pods-SnappingStepperExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SnappingStepperExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SnappingStepperExample/Pods-SnappingStepperExample.debug.xcconfig"; sourceTree = ""; }; + 668E61D7AF9643FCB59F5765 /* Pods_SnappingStepper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SnappingStepper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 868177DA2076D8F57EB0E466 /* Pods-SnappingStepperExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SnappingStepperExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SnappingStepperExample/Pods-SnappingStepperExample.debug.xcconfig"; sourceTree = ""; }; + 8B55B0CBB70127933B002EB7 /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig"; sourceTree = ""; }; + 9AD84A9BB402D61DE2A9E571 /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = ""; }; + CA82E9BD45BCBEB65C0EA52F /* Pods-SnappingStepperExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SnappingStepperExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-SnappingStepperExample/Pods-SnappingStepperExample.release.xcconfig"; sourceTree = ""; }; + CBDBE85B9CA336124560E44E /* Pods_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CE132D671D0880EB00CA6DB5 /* UIBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIBuilder.swift; sourceTree = ""; }; CE6F72381AF513810019CB55 /* SnappingStepperExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SnappingStepperExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; CE6F723C1AF513810019CB55 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -104,18 +95,14 @@ CE8FFEAF1BAB22C100D43F38 /* SnappingStepper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SnappingStepper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CE8FFEB11BAB22C100D43F38 /* SnappingStepper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SnappingStepper.h; sourceTree = ""; }; CE8FFEB31BAB22C100D43F38 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - CE972EE71D044B7E00EDE4A7 /* CustomShapeLayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomShapeLayer.swift; sourceTree = ""; }; - CE972EE81D044B7E00EDE4A7 /* ShapeStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShapeStyle.swift; sourceTree = ""; }; CE972EE91D044B7E00EDE4A7 /* SnappingStepper+Internal.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SnappingStepper+Internal.swift"; sourceTree = ""; }; CE972EEA1D044B7E00EDE4A7 /* SnappingStepper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SnappingStepper.swift; sourceTree = ""; }; CE972EEB1D044B7E00EDE4A7 /* SnappingStepperBehavior.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SnappingStepperBehavior.swift; sourceTree = ""; }; - CE972EEC1D044B7E00EDE4A7 /* StyledLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StyledLabel.swift; sourceTree = ""; }; CE972EED1D044B7E00EDE4A7 /* UITouchGestureRecognizer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UITouchGestureRecognizer.swift; sourceTree = ""; }; CE972F031D0453D800EDE4A7 /* AutoRepeatHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutoRepeatHelper.swift; sourceTree = ""; }; CEB21D5F1B18C169003E9EEC /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; CEB21D621B18C169003E9EEC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; CEB21D681B18C18A003E9EEC /* SnappingStepperTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SnappingStepperTests.swift; path = ../../Tests/SnappingStepperTests.swift; sourceTree = ""; }; - FA07CA8AF812FD143261A66A /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -124,7 +111,7 @@ buildActionMask = 2147483647; files = ( CE8FFEC41BAB22C100D43F38 /* SnappingStepper.framework in Frameworks */, - 01AA9210AD07C825DAE1F607 /* Pods_SnappingStepperExample.framework in Frameworks */, + 46B052E24C9D91F8A2B8BE11 /* Pods_SnappingStepperExample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -132,7 +119,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 5E1F7E9CB92461FE26B43DF2 /* Pods_SnappingStepper.framework in Frameworks */, + 95EDD1B65E463FAC0841CE03 /* Pods_SnappingStepper.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -140,13 +127,26 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 0D1DA54DFA51DA8D2A48E14A /* Pods_Tests.framework in Frameworks */, + 6721FC108605E3281738E988 /* Pods_Tests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 286017B0DD7716003BCBA5CA /* Pods */ = { + isa = PBXGroup; + children = ( + 13E6DF95652423DD357AA988 /* Pods-SnappingStepper.debug.xcconfig */, + 51DCBE86E00B6EF820E53729 /* Pods-SnappingStepper.release.xcconfig */, + 868177DA2076D8F57EB0E466 /* Pods-SnappingStepperExample.debug.xcconfig */, + CA82E9BD45BCBEB65C0EA52F /* Pods-SnappingStepperExample.release.xcconfig */, + 9AD84A9BB402D61DE2A9E571 /* Pods-Tests.debug.xcconfig */, + 8B55B0CBB70127933B002EB7 /* Pods-Tests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; 5B1EFC7C1D7192FE0040AD50 /* ThirdParty */ = { isa = PBXGroup; children = ( @@ -155,17 +155,14 @@ name = ThirdParty; sourceTree = ""; }; - B7F47D86834F3F549B39F8F8 /* Pods */ = { + 8791960324A5B6C3B35B0BDF /* Frameworks */ = { isa = PBXGroup; children = ( - B2E3DBDEDC6BE1779FC7B5FA /* Pods-SnappingStepperExample.debug.xcconfig */, - 8B6D05BEEE35E75A880B7639 /* Pods-SnappingStepperExample.release.xcconfig */, - FA07CA8AF812FD143261A66A /* Pods-Tests.debug.xcconfig */, - 7C4C30B228B621354D490313 /* Pods-Tests.release.xcconfig */, - B096075174A29C2DEC848639 /* Pods-SnappingStepper.debug.xcconfig */, - AA5888D5090F31444D20DBDA /* Pods-SnappingStepper.release.xcconfig */, + 668E61D7AF9643FCB59F5765 /* Pods_SnappingStepper.framework */, + 05B7A561BE896062CC5956B6 /* Pods_SnappingStepperExample.framework */, + CBDBE85B9CA336124560E44E /* Pods_Tests.framework */, ); - name = Pods; + name = Frameworks; sourceTree = ""; }; CE6F722F1AF513810019CB55 = { @@ -176,8 +173,8 @@ CEB21D601B18C169003E9EEC /* Tests */, CE8FFEB01BAB22C100D43F38 /* SnappingStepper */, CE6F72391AF513810019CB55 /* Products */, - B7F47D86834F3F549B39F8F8 /* Pods */, - FE410316A4FAC960A0982048 /* Frameworks */, + 286017B0DD7716003BCBA5CA /* Pods */, + 8791960324A5B6C3B35B0BDF /* Frameworks */, ); sourceTree = ""; }; @@ -226,12 +223,9 @@ children = ( 5B1EFC7C1D7192FE0040AD50 /* ThirdParty */, CE972F031D0453D800EDE4A7 /* AutoRepeatHelper.swift */, - CE972EE71D044B7E00EDE4A7 /* CustomShapeLayer.swift */, - CE972EE81D044B7E00EDE4A7 /* ShapeStyle.swift */, CE972EE91D044B7E00EDE4A7 /* SnappingStepper+Internal.swift */, CE972EEA1D044B7E00EDE4A7 /* SnappingStepper.swift */, CE972EEB1D044B7E00EDE4A7 /* SnappingStepperBehavior.swift */, - CE972EEC1D044B7E00EDE4A7 /* StyledLabel.swift */, CE132D671D0880EB00CA6DB5 /* UIBuilder.swift */, CE972EED1D044B7E00EDE4A7 /* UITouchGestureRecognizer.swift */, ); @@ -256,17 +250,6 @@ name = "Supporting Files"; sourceTree = ""; }; - FE410316A4FAC960A0982048 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 449D06ECFFEC0DD8C4DA6EF2 /* Pods_SnappingStepperExample.framework */, - 09E3430E9EA28A5D0C4ED262 /* Pods_Tests.framework */, - 3B63928ED40BD6C1AAE23668 /* Pods_UITests.framework */, - 921B58F6F24292F873D6FE4A /* Pods_SnappingStepper.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -285,13 +268,13 @@ isa = PBXNativeTarget; buildConfigurationList = CE6F72571AF513810019CB55 /* Build configuration list for PBXNativeTarget "SnappingStepperExample" */; buildPhases = ( - 7CA4F1F5B55B4EA73B14C706 /* [CP] Check Pods Manifest.lock */, + 83DF65354ADA725A37ACEA32 /* [CP] Check Pods Manifest.lock */, CE6F72341AF513810019CB55 /* Sources */, CE6F72351AF513810019CB55 /* Frameworks */, CE6F72361AF513810019CB55 /* Resources */, CE8FFEC91BAB22C100D43F38 /* Embed Frameworks */, - 100D5242A835D0DF21B997AB /* [CP] Embed Pods Frameworks */, - 30734BDB24EB5F1386758B14 /* [CP] Copy Pods Resources */, + 618CAC72574D7AB58CC70BB9 /* [CP] Embed Pods Frameworks */, + 45D0F13DC8AF52A335D33C84 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -307,12 +290,12 @@ isa = PBXNativeTarget; buildConfigurationList = CE8FFEC61BAB22C100D43F38 /* Build configuration list for PBXNativeTarget "SnappingStepper" */; buildPhases = ( - 5A8FDD7C7C23F1CB73E73FAD /* [CP] Check Pods Manifest.lock */, + 13E12CFA9F5C1D7A77E60FC1 /* [CP] Check Pods Manifest.lock */, CE8FFEAA1BAB22C100D43F38 /* Sources */, CE8FFEAB1BAB22C100D43F38 /* Frameworks */, CE8FFEAC1BAB22C100D43F38 /* Headers */, CE8FFEAD1BAB22C100D43F38 /* Resources */, - 666D2E74D033AC04D04D82D1 /* [CP] Copy Pods Resources */, + DC50DCD207D41328C4FF4F7B /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -327,12 +310,12 @@ isa = PBXNativeTarget; buildConfigurationList = CEB21D651B18C169003E9EEC /* Build configuration list for PBXNativeTarget "Tests" */; buildPhases = ( - AEABFEC876ECB92809E6C351 /* [CP] Check Pods Manifest.lock */, + B1706224A87ECFF0A5240364 /* [CP] Check Pods Manifest.lock */, CEB21D5B1B18C169003E9EEC /* Sources */, CEB21D5C1B18C169003E9EEC /* Frameworks */, CEB21D5D1B18C169003E9EEC /* Resources */, - 57B8D188DD6B7CA8FF787373 /* [CP] Embed Pods Frameworks */, - E7EF272C918D680CE186A483 /* [CP] Copy Pods Resources */, + DF48E044E260EE8696393D73 /* [CP] Embed Pods Frameworks */, + 452658B586BF0C2C3012485E /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -417,22 +400,22 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 100D5242A835D0DF21B997AB /* [CP] Embed Pods Frameworks */ = { + 13E12CFA9F5C1D7A77E60FC1 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "[CP] Embed Pods Frameworks"; + name = "[CP] Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SnappingStepperExample/Pods-SnappingStepperExample-frameworks.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; - 30734BDB24EB5F1386758B14 /* [CP] Copy Pods Resources */ = { + 452658B586BF0C2C3012485E /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -444,55 +427,55 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SnappingStepperExample/Pods-SnappingStepperExample-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 57B8D188DD6B7CA8FF787373 /* [CP] Embed Pods Frameworks */ = { + 45D0F13DC8AF52A335D33C84 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "[CP] Embed Pods Frameworks"; + name = "[CP] Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SnappingStepperExample/Pods-SnappingStepperExample-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 5A8FDD7C7C23F1CB73E73FAD /* [CP] Check Pods Manifest.lock */ = { + 618CAC72574D7AB58CC70BB9 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SnappingStepperExample/Pods-SnappingStepperExample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 666D2E74D033AC04D04D82D1 /* [CP] Copy Pods Resources */ = { + 83DF65354ADA725A37ACEA32 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "[CP] Copy Pods Resources"; + name = "[CP] Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SnappingStepper/Pods-SnappingStepper-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; - 7CA4F1F5B55B4EA73B14C706 /* [CP] Check Pods Manifest.lock */ = { + B1706224A87ECFF0A5240364 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -504,37 +487,37 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; - AEABFEC876ECB92809E6C351 /* [CP] Check Pods Manifest.lock */ = { + DC50DCD207D41328C4FF4F7B /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SnappingStepper/Pods-SnappingStepper-resources.sh\"\n"; showEnvVarsInLog = 0; }; - E7EF272C918D680CE186A483 /* [CP] Copy Pods Resources */ = { + DF48E044E260EE8696393D73 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "[CP] Copy Pods Resources"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -545,11 +528,8 @@ buildActionMask = 2147483647; files = ( CE6F72401AF513810019CB55 /* ViewController.swift in Sources */, - CE972EF81D044B7E00EDE4A7 /* StyledLabel.swift in Sources */, 5B1EFC7E1D71932E0040AD50 /* StyledControlDirection.swift in Sources */, CE972EF41D044B7E00EDE4A7 /* SnappingStepper.swift in Sources */, - CE972EF01D044B7E00EDE4A7 /* ShapeStyle.swift in Sources */, - CE972EEE1D044B7E00EDE4A7 /* CustomShapeLayer.swift in Sources */, CE132D681D0880EB00CA6DB5 /* UIBuilder.swift in Sources */, CE6F723E1AF513810019CB55 /* AppDelegate.swift in Sources */, CE972EFA1D044B7E00EDE4A7 /* UITouchGestureRecognizer.swift in Sources */, @@ -564,10 +544,7 @@ buildActionMask = 2147483647; files = ( 5B1EFC7F1D71932E0040AD50 /* StyledControlDirection.swift in Sources */, - CE972EEF1D044B7E00EDE4A7 /* CustomShapeLayer.swift in Sources */, - CE972EF91D044B7E00EDE4A7 /* StyledLabel.swift in Sources */, CE972EF31D044B7E00EDE4A7 /* SnappingStepper+Internal.swift in Sources */, - CE972EF11D044B7E00EDE4A7 /* ShapeStyle.swift in Sources */, CE972EFB1D044B7E00EDE4A7 /* UITouchGestureRecognizer.swift in Sources */, CE132D691D0880EB00CA6DB5 /* UIBuilder.swift in Sources */, CE972F051D0453D800EDE4A7 /* AutoRepeatHelper.swift in Sources */, @@ -580,10 +557,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - CE972F011D044B8200EDE4A7 /* StyledLabel.swift in Sources */, CE972EFF1D044B8200EDE4A7 /* SnappingStepper.swift in Sources */, - CE972EFD1D044B8200EDE4A7 /* ShapeStyle.swift in Sources */, - CE972EFC1D044B8200EDE4A7 /* CustomShapeLayer.swift in Sources */, 5B1EFC801D71932E0040AD50 /* StyledControlDirection.swift in Sources */, CEB21D691B18C18A003E9EEC /* SnappingStepperTests.swift in Sources */, CE132D6A1D08810C00CA6DB5 /* UIBuilder.swift in Sources */, @@ -668,7 +642,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -710,7 +684,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -722,7 +696,7 @@ }; CE6F72581AF513810019CB55 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B2E3DBDEDC6BE1779FC7B5FA /* Pods-SnappingStepperExample.debug.xcconfig */; + baseConfigurationReference = 868177DA2076D8F57EB0E466 /* Pods-SnappingStepperExample.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -736,7 +710,7 @@ }; CE6F72591AF513810019CB55 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8B6D05BEEE35E75A880B7639 /* Pods-SnappingStepperExample.release.xcconfig */; + baseConfigurationReference = CA82E9BD45BCBEB65C0EA52F /* Pods-SnappingStepperExample.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -750,7 +724,7 @@ }; CE8FFEC71BAB22C100D43F38 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B096075174A29C2DEC848639 /* Pods-SnappingStepper.debug.xcconfig */; + baseConfigurationReference = 13E6DF95652423DD357AA988 /* Pods-SnappingStepper.debug.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; CURRENT_PROJECT_VERSION = 1; @@ -761,7 +735,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = SnappingStepper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.yannickloriot.SnappingStepper; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -774,7 +748,7 @@ }; CE8FFEC81BAB22C100D43F38 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AA5888D5090F31444D20DBDA /* Pods-SnappingStepper.release.xcconfig */; + baseConfigurationReference = 51DCBE86E00B6EF820E53729 /* Pods-SnappingStepper.release.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; CURRENT_PROJECT_VERSION = 1; @@ -784,7 +758,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = SnappingStepper/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.yannickloriot.SnappingStepper; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -797,7 +771,7 @@ }; CEB21D661B18C169003E9EEC /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = FA07CA8AF812FD143261A66A /* Pods-Tests.debug.xcconfig */; + baseConfigurationReference = 9AD84A9BB402D61DE2A9E571 /* Pods-Tests.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -811,7 +785,7 @@ "$(inherited)", ); INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.yannickloriot.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -821,7 +795,7 @@ }; CEB21D671B18C169003E9EEC /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7C4C30B228B621354D490313 /* Pods-Tests.release.xcconfig */; + baseConfigurationReference = 8B55B0CBB70127933B002EB7 /* Pods-Tests.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -831,7 +805,7 @@ GCC_GENERATE_TEST_COVERAGE_FILES = YES; GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.yannickloriot.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Example/SnappingStepperExample/Base.lproj/Main.storyboard b/Example/SnappingStepperExample/Base.lproj/Main.storyboard index 5b3c0cb..b9bcbee 100644 --- a/Example/SnappingStepperExample/Base.lproj/Main.storyboard +++ b/Example/SnappingStepperExample/Base.lproj/Main.storyboard @@ -1,7 +1,11 @@ - - + + + + + - + + @@ -18,6 +22,7 @@ + @@ -26,8 +31,10 @@ + + @@ -51,9 +59,10 @@ + - + @@ -67,7 +76,7 @@ - + @@ -81,7 +90,7 @@ - + @@ -95,7 +104,7 @@ - + @@ -109,7 +118,7 @@ - + diff --git a/Example/SnappingStepperExample/Info.plist b/Example/SnappingStepperExample/Info.plist index a391e86..36b8a53 100644 --- a/Example/SnappingStepperExample/Info.plist +++ b/Example/SnappingStepperExample/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.3.1 + 3.0 CFBundleSignature ???? CFBundleVersion diff --git a/Example/SnappingStepperExample/ViewController.swift b/Example/SnappingStepperExample/ViewController.swift index 9f6f2b4..6abc80f 100644 --- a/Example/SnappingStepperExample/ViewController.swift +++ b/Example/SnappingStepperExample/ViewController.swift @@ -26,23 +26,27 @@ class ViewController: UIViewController { assignStepperDefaultSettings(tubeStepper) tubeStepper.style = .tube tubeStepper.thumbStyle = .tube - tubeStepper.backgroundColor = UIColor(hex: 0xB2DFDB) + tubeStepper.styleColor = UIColor(hex: 0xB2DFDB) tubeStepper.thumbBackgroundColor = UIColor(hex: 0x009688) tubeStepper.hintStyle = .box assignStepperDefaultSettings(roundedStepper) roundedStepper.style = .rounded roundedStepper.thumbStyle = .rounded - roundedStepper.backgroundColor = .clear + roundedStepper.styleColor = .clear roundedStepper.thumbBackgroundColor = UIColor(hex: 0xFFC107) roundedStepper.borderColor = UIColor(hex: 0xFFC107) roundedStepper.borderWidth = 0.5 - roundedStepper.hintStyle = .thumb + roundedStepper.hintStyle = .rounded + roundedStepper.thumbTextFormatString = "%0.2f" + roundedStepper.maximumValue = 1 + roundedStepper.stepValue = 0.1 + roundedStepper.stepFactor = 25 assignStepperDefaultSettings(customStepper) customStepper.style = .custom(path: customDoubleArrowPath()) customStepper.thumbStyle = .thumb - customStepper.backgroundColor = .clear + customStepper.styleColor = .clear customStepper.borderColor = UIColor(hex: 0x607D8B) customStepper.thumbBackgroundColor = UIColor(hex: 0x607D8B) customStepper.borderWidth = 0.5 @@ -51,18 +55,18 @@ class ViewController: UIViewController { assignStepperDefaultSettings(verticalRoundedStepper) verticalRoundedStepper.style = .rounded verticalRoundedStepper.thumbStyle = .rounded - verticalRoundedStepper.backgroundColor = .clear + verticalRoundedStepper.styleColor = UIColor(hex: 0xFFC107).lighter().lighter() verticalRoundedStepper.thumbBackgroundColor = UIColor(hex: 0xFFC107) verticalRoundedStepper.borderColor = UIColor(hex: 0xFFC107) verticalRoundedStepper.borderWidth = 0.5 - verticalRoundedStepper.hintStyle = .thumb + verticalRoundedStepper.hintStyle = .rounded verticalRoundedStepper.direction = .vertical } func assignStepperDefaultSettings(_ snappingStepper: SnappingStepper) { snappingStepper.symbolFont = UIFont(name: "TrebuchetMS-Bold", size: 20) snappingStepper.symbolFontColor = .black - snappingStepper.backgroundColor = UIColor(hex: 0xc0392b) + snappingStepper.styleColor = UIColor(hex: 0xc0392b) snappingStepper.thumbWidthRatio = 0.4 snappingStepper.thumbText = nil snappingStepper.thumbFont = UIFont(name: "TrebuchetMS-Bold", size: 18) @@ -75,6 +79,7 @@ class ViewController: UIViewController { snappingStepper.minimumValue = 0 snappingStepper.maximumValue = 1000 snappingStepper.stepValue = 1 + snappingStepper.thumbTextFormatString = "%0.f" } func customDoubleArrowPath() -> UIBezierPath { diff --git a/SnappingStepper.podspec b/SnappingStepper.podspec index 7b77e3a..503aada 100644 --- a/SnappingStepper.podspec +++ b/SnappingStepper.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'SnappingStepper' - s.version = '2.4.0' + s.version = '3.0' s.license = 'MIT' s.summary = 'An elegant alternative to the UIStepper written in Swift' s.homepage = 'https://github.com/yannickl/SnappingStepper.git' @@ -9,9 +9,10 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/yannickl/SnappingStepper.git', :tag => s.version } s.screenshot = 'http://yannickloriot.com/resources/snappingstepper-screenshot.png' - s.ios.deployment_target = '8.0' + s.ios.deployment_target = '10.0' s.dependency 'DynamicColor', '~> 3.1' + s.dependency 'StyledLabel', '~> 2.0' s.framework = 'UIKit' s.source_files = 'Sources/*.swift' diff --git a/Sources/CustomShapeLayer.swift b/Sources/CustomShapeLayer.swift deleted file mode 100644 index 7914db4..0000000 --- a/Sources/CustomShapeLayer.swift +++ /dev/null @@ -1,117 +0,0 @@ -/* - * CustomShapeLayer - * Created by Martin Rehder. - * - * SnappingStepper - * - * Copyright 2015-present Yannick Loriot. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -import UIKit - -final class CustomShapeLayer { - static func createShape(_ style: ShapeStyle, bounds: CGRect, color: UIColor) -> CAShapeLayer { - let shape = CAShapeLayer() - - let path = CustomShapeLayer.shapePathForStyle(style, bounds: bounds) - shape.path = path.cgPath - shape.fillColor = color.cgColor - - return shape - } - - static func createShape(_ style: ShapeStyle, bounds: CGRect, color: UIColor, borderColor: UIColor, borderWidth: CGFloat) -> CAShapeLayer { - let shape = CAShapeLayer() - - let path = CustomShapeLayer.shapePathForStyle(style, bounds: bounds) - shape.path = path.cgPath - shape.fillColor = color.cgColor - shape.strokeColor = borderColor.cgColor - shape.lineWidth = borderWidth - - return shape - } - - static func shapePathForStyle(_ style: ShapeStyle, bounds: CGRect) -> UIBezierPath { - var path = UIBezierPath() - - switch style { - case .box, .none: - path = UIBezierPath(rect: bounds) - case .rounded: - path = UIBezierPath(roundedRect: bounds, cornerRadius: max(1.0, min(bounds.size.width, bounds.size.height) * 0.2)) - case .roundedFixed(let cornerRadius): - path = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius) - case .thumb: - let s = min(bounds.size.width, bounds.size.height) - let xOff = (bounds.size.width - s) * 0.5 - path = UIBezierPath(ovalIn: CGRect(x: bounds.origin.x + xOff, y: bounds.origin.y, width: s, height: s)) - case .tube: - path = UIBezierPath(roundedRect: bounds, cornerRadius: max(1.0, min(bounds.size.width, bounds.size.height) * 0.5)) - case .custom(let cpath): - path = CustomShapeLayer.getScaledPath(cpath.cgPath, size: bounds.size) - } - - return path - } - - static func getScaledPath(_ path: CGPath, size: CGSize) -> UIBezierPath { - let rect = CGRect(origin:CGPoint(x:0, y:0), size:CGSize(width: size.width, height: size.height)) - let boundingBox = path.boundingBox - - let scaleFactorX = rect.width / boundingBox.width - let scaleFactorY = rect.height / boundingBox.height - - var scaleTransform = CGAffineTransform.identity - scaleTransform = scaleTransform.scaledBy(x: scaleFactorX, y: scaleFactorY) - scaleTransform = scaleTransform.translatedBy(x: -boundingBox.minX, y: -boundingBox.minY) - - let scaledSize = boundingBox.size.applying(CGAffineTransform(scaleX: scaleFactorX, y: scaleFactorY)) - let centerOffset = CGSize(width: (rect.width - scaledSize.width) / (scaleFactorX * 2.0), height:(rect.height - scaledSize.height) / (scaleFactorY * 2.0)) - scaleTransform = scaleTransform.translatedBy(x: centerOffset.width, y: centerOffset.height) - - let scaledPath = path.copy(using: &scaleTransform)! - - return UIBezierPath(cgPath: scaledPath) - } - - static func createHintShapeLayer(_ label: StyledLabel, fillColor: CGColor?) { - let shape = CAShapeLayer() - let cp1 = CGPoint(x: label.bounds.width * 0.35, y: label.bounds.height) - let cp2 = CGPoint(x: label.bounds.width * 0.65, y: label.bounds.height) - let cpc = CGPoint(x: label.bounds.width / 2.0, y: label.bounds.height * 1.25) - let sp = CGPoint(x: label.bounds.width / 2.0, y: label.bounds.height * 1.5) - - let myBezier = UIBezierPath() - myBezier.move(to: sp) - myBezier.addCurve(to: CGPoint(x: label.bounds.width * 0.2, y: label.bounds.height), controlPoint1: cpc, controlPoint2: cp1) - myBezier.addLine(to: CGPoint(x: label.bounds.width * 0.8, y: label.bounds.height)) - myBezier.addCurve(to: sp, controlPoint1: cp2, controlPoint2: cpc) - myBezier.close() - - shape.path = myBezier.cgPath - shape.fillColor = fillColor - - label.layer.addSublayer(shape) - } -} diff --git a/Sources/ShapeStyle.swift b/Sources/ShapeStyle.swift deleted file mode 100644 index fc12ace..0000000 --- a/Sources/ShapeStyle.swift +++ /dev/null @@ -1,48 +0,0 @@ -/* - * ShapeStyle - * Created by Martin Rehder. - * - * SnappingStepper - * - * Copyright 2015-present Yannick Loriot. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -import UIKit - -/// Specifies the shape style of the snapping stepper. -public enum ShapeStyle { - /// No shape - case none - /// A box shape. - case box - /// A round shape. - case rounded - /// A round shape with given corner radius. - case roundedFixed(cornerRadius: CGFloat) - /// A thumb shape. - case thumb - /// A tube shape. - case tube - /// A custom shape. - case custom(path: UIBezierPath) -} diff --git a/Sources/SnappingStepper+Internal.swift b/Sources/SnappingStepper+Internal.swift index 125ee05..ccd527c 100644 --- a/Sources/SnappingStepper+Internal.swift +++ b/Sources/SnappingStepper+Internal.swift @@ -25,6 +25,7 @@ */ import UIKit +import StyledLabel extension SnappingStepper { // MARK: - Managing the Components @@ -92,7 +93,8 @@ extension SnappingStepper { snappingBehavior = SnappingStepperBehavior(item: thumbLabel, snapToPoint: CGPoint(x: bounds.size.width * 0.5, y: bounds.size.height * 0.5)) - CustomShapeLayer.createHintShapeLayer(hintLabel, fillColor: thumbBackgroundColor?.lighter().cgColor) + let hsl = StyledShapeLayer.createHintShapeLayer(hintLabel, fillColor: thumbBackgroundColor?.lighter().cgColor) + hintLabel.layer.addSublayer(hsl) applyThumbStyle(thumbStyle) applyStyle(style) @@ -110,21 +112,32 @@ extension SnappingStepper { } func applyStyle(_ style: ShapeStyle) { - let bgColor: UIColor = .clear - let sLayer: CAShapeLayer - - if let borderColor = borderColor { - sLayer = CustomShapeLayer.createShape(style, bounds: bounds, color: bgColor, borderColor: borderColor, borderWidth: borderWidth) + if self.styleLayer.superlayer == nil { + self.layer.addSublayer(styleLayer) } - else { - sLayer = CustomShapeLayer.createShape(style, bounds: bounds, color: bgColor) + + let bgColor: UIColor = self.styleColor ?? .clear + let bgsLayer = StyledShapeLayer.createShape(style, bounds: bounds, color: bgColor) + + // Add layer with border, if required + if let bLayer = self.createBorderLayer(style, layerRect: bounds) { + bgsLayer.addSublayer(bLayer) } - + if styleLayer.superlayer != nil { - layer.replaceSublayer(styleLayer, with: sLayer) + layer.replaceSublayer(styleLayer, with: bgsLayer) } - - styleLayer = sLayer + styleLayer = bgsLayer + styleLayer.frame = bounds + } + + func createBorderLayer(_ style: ShapeStyle, layerRect: CGRect) -> CALayer? { + let borderWidth = self.borderWidth + if borderWidth > 0 && borderColor != nil { + let bLayer = StyledShapeLayer.createShape(style, bounds: layerRect, color: .clear, borderColor: borderColor ?? .clear, borderWidth: borderWidth) + return bLayer + } + return nil } // MARK: - Responding to Gesture Events @@ -146,24 +159,24 @@ extension SnappingStepper { updateValue(value, finished: true) } - v.backgroundColor = backgroundColor?.darkened() + v.backgroundColor = styleColor?.darkened() case (.changed, .some(let v)): if v == minusSymbolLabel || v == plusSymbolLabel { - v.backgroundColor = backgroundColor?.darkened() + v.backgroundColor = styleColor?.darkened() if autorepeat { startAutorepeat() } } else { - minusSymbolLabel.backgroundColor = backgroundColor - plusSymbolLabel.backgroundColor = backgroundColor + minusSymbolLabel.backgroundColor = styleColor + plusSymbolLabel.backgroundColor = styleColor autorepeatHelper.stop() } default: - minusSymbolLabel.backgroundColor = backgroundColor - plusSymbolLabel.backgroundColor = backgroundColor + minusSymbolLabel.backgroundColor = .clear + plusSymbolLabel.backgroundColor = .clear if autorepeat { autorepeatHelper.stop() @@ -222,7 +235,7 @@ extension SnappingStepper { } let ratio = Double(Int(locationRatio * 10)) / 10 - let factorValue = ((maximumValue - minimumValue) / 100) * ratio + let factorValue = ((maximumValue - minimumValue) / 100) * ratio * stepFactor if autorepeat { self.factorValue = factorValue @@ -243,7 +256,7 @@ extension SnappingStepper { dynamicButtonAnimator.addBehavior(snappingBehavior) - thumbLabel.backgroundColor = thumbBackgroundColor ?? backgroundColor?.lighter() + thumbLabel.backgroundColor = thumbBackgroundColor ?? styleColor?.lighter() if autorepeat { autorepeatHelper.stop() @@ -292,6 +305,11 @@ extension SnappingStepper { } func valueAsText() -> String { - return value.truncatingRemainder(dividingBy: 1) == 0 ? "\(Int(value))" : "\(value)" + if let formatting = self.thumbTextFormatString { + return String.init(format: formatting, value) + } + else { + return value.truncatingRemainder(dividingBy: 1) == 0 ? "\(Int(value))" : "\(value)" + } } } diff --git a/Sources/SnappingStepper.swift b/Sources/SnappingStepper.swift index 8cc1de2..64d8845 100644 --- a/Sources/SnappingStepper.swift +++ b/Sources/SnappingStepper.swift @@ -26,6 +26,7 @@ import DynamicColor import UIKit +import StyledLabel /** A stepper control provides a user interface for incrementing or decrementing a value. @@ -125,6 +126,15 @@ import UIKit */ @IBInspectable public var stepValue: Double = 1 + /** + The step increase/decrease factor applied when sliding the stepper. + + Must be numerically greater than 0. If you attempt to set this property’s value to 0 or to a negative number, the system raises an NSInvalidArgumentException exception. + + The default value for this property is 1. + */ + @IBInspectable public var stepFactor: Double = 1 + // MARK: - Accessing the Stepper’s Value /** @@ -249,19 +259,25 @@ import UIKit } /// The view’s background color. - override public var backgroundColor: UIColor? { + @IBInspectable public var styleColor: UIColor? { didSet { - self.styleColor = backgroundColor self.applyStyle(self.style) if thumbBackgroundColor == nil { - thumbLabel.backgroundColor = backgroundColor?.lighter() + thumbLabel.backgroundColor = styleColor?.lighter() } } } // MARK: - Displaying Thumb Text + /// The thumb text format. If the format string is nil it will display the current value unformatted. Defaults with empty string. + public var thumbTextFormatString: String? { + didSet { + self.applyThumbStyle(thumbStyle) + } + } + /// The thumb text to display. If the text is nil it will display the current value of the stepper. Defaults with empty string. @IBInspectable public var thumbText: String? = "" { didSet { @@ -328,7 +344,6 @@ import UIKit var snappingBehavior = SnappingStepperBehavior(item: nil, snapToPoint: CGPoint.zero) var styleLayer = CAShapeLayer() - var styleColor: UIColor? = .clear var touchesBeganPoint = CGPoint.zero var initialValue: Double = -1 diff --git a/Sources/StyledLabel.swift b/Sources/StyledLabel.swift deleted file mode 100644 index 44635d0..0000000 --- a/Sources/StyledLabel.swift +++ /dev/null @@ -1,136 +0,0 @@ -/* - * StyledLabel - * Created by Martin Rehder. - * - * SnappingStepper - * - * Copyright 2015-present Yannick Loriot. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -import UIKit - -/// The `StyledLabel` object is an `UILabel` with a custom shape. -class StyledLabel: UIView { - var label = UILabel() - var shapeLayer = CAShapeLayer() - var styleColor: UIColor? = .clear - - var style: ShapeStyle = .box { - didSet { - applyStyle() - } - } - - var text: String? { - didSet { - label.text = text - } - } - - var textColor: UIColor = .black { - didSet { - label.textColor = textColor - } - } - - override var backgroundColor: UIColor? { - get { - return .clear - } - set { - styleColor = newValue - - applyStyle() - } - } - - var borderColor: UIColor? { - didSet { - applyStyle() - } - } - - var borderWidth: CGFloat = 1.0 { - didSet { - applyStyle() - } - } - - var font: UIFont? { - didSet { - label.font = font - } - } - - var textAlignment: NSTextAlignment = .center { - didSet { - label.textAlignment = textAlignment - } - } - - var rotationInRadians: CGFloat = 0 { - didSet { - self.setNeedsLayout() - } - } - - init() { - super.init(frame: CGRect.zero) - - self.layer.addSublayer(self.shapeLayer) - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override func layoutSubviews() { - super.layoutSubviews() - - self.applyStyle() - label.removeFromSuperview() - - self.label.frame = bounds - self.label.transform = CGAffineTransform(rotationAngle: self.rotationInRadians) - self.label.frame = bounds - self.addSubview(label) - } - - func applyStyle() { - let bgColor = styleColor ?? .clear - let sLayer: CAShapeLayer - - if let borderColor = borderColor { - sLayer = CustomShapeLayer.createShape(style, bounds: bounds, color: bgColor, borderColor: borderColor, borderWidth: borderWidth) - } - else { - sLayer = CustomShapeLayer.createShape(style, bounds: bounds, color: bgColor) - } - - if self.shapeLayer.superlayer != nil { - self.layer.replaceSublayer(shapeLayer, with: sLayer) - } - - self.shapeLayer = sLayer - } -} diff --git a/Sources/UIBuilder.swift b/Sources/UIBuilder.swift index eacac74..3d6d92d 100644 --- a/Sources/UIBuilder.swift +++ b/Sources/UIBuilder.swift @@ -25,6 +25,7 @@ */ import UIKit +import StyledLabel final class UIBuilder { static func defaultLabel() -> UILabel {