├── .codebeatsettings ├── .gitignore ├── .jazzy_cmd.yaml ├── .swift-version ├── .travis.yml ├── CHANGELOG.md ├── Example ├── JOCircularSlider.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── JOCircularSlider-Example.xcscheme ├── JOCircularSlider.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── JOCircularSlider │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ └── thumb.imageset │ │ │ ├── Contents.json │ │ │ └── thumb.pdf │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── GradientView.swift │ ├── Info.plist │ ├── Utils.swift │ └── ViewController.swift ├── Podfile ├── Podfile.lock ├── Pods │ ├── Local Podspecs │ │ └── JOCircularSlider.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── JOCircularSlider.xcscheme │ └── Target Support Files │ │ ├── JOCircularSlider │ │ ├── Info.plist │ │ ├── JOCircularSlider-dummy.m │ │ ├── JOCircularSlider-prefix.pch │ │ ├── JOCircularSlider-umbrella.h │ │ ├── JOCircularSlider.modulemap │ │ └── JOCircularSlider.xcconfig │ │ ├── Pods-JOCircularSlider_Example │ │ ├── Info.plist │ │ ├── Pods-JOCircularSlider_Example-acknowledgements.markdown │ │ ├── Pods-JOCircularSlider_Example-acknowledgements.plist │ │ ├── Pods-JOCircularSlider_Example-dummy.m │ │ ├── Pods-JOCircularSlider_Example-frameworks.sh │ │ ├── Pods-JOCircularSlider_Example-resources.sh │ │ ├── Pods-JOCircularSlider_Example-umbrella.h │ │ ├── Pods-JOCircularSlider_Example.debug.xcconfig │ │ ├── Pods-JOCircularSlider_Example.modulemap │ │ └── Pods-JOCircularSlider_Example.release.xcconfig │ │ └── Pods-JOCircularSlider_Tests │ │ ├── Info.plist │ │ ├── Pods-JOCircularSlider_Tests-acknowledgements.markdown │ │ ├── Pods-JOCircularSlider_Tests-acknowledgements.plist │ │ ├── Pods-JOCircularSlider_Tests-dummy.m │ │ ├── Pods-JOCircularSlider_Tests-frameworks.sh │ │ ├── Pods-JOCircularSlider_Tests-resources.sh │ │ ├── Pods-JOCircularSlider_Tests-umbrella.h │ │ ├── Pods-JOCircularSlider_Tests.debug.xcconfig │ │ ├── Pods-JOCircularSlider_Tests.modulemap │ │ └── Pods-JOCircularSlider_Tests.release.xcconfig └── Tests │ ├── Info.plist │ └── Tests.swift ├── JOCircularSlider.podspec ├── JOCircularSlider ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── CircularLayer.swift │ ├── CircularSlider.swift │ ├── DotLayer.swift │ ├── DotView.swift │ ├── Extensions.swift │ ├── KnobView.swift │ └── PointerView.swift ├── LICENSE ├── README.md ├── Screenshots ├── banner.gif ├── shot1.gif ├── shot2.gif ├── shot3.gif └── shot4.gif └── _Pods.xcodeproj /.codebeatsettings: -------------------------------------------------------------------------------- 1 | { 2 | "SWIFT": { 3 | "TOO_MANY_IVARS": [8, 12, 16, 20], 4 | "TOO_MANY_FUNCTIONS": [46, 55, 65, 85], 5 | "ARITY" : [5, 6, 7, 8], 6 | "ABC": [15, 25, 50, 70], 7 | "TOTAL_COMPLEXITY": [100, 180, 280, 400], 8 | "TOTAL_LOC": [200, 250, 320, 450] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 26 | # Carthage/Checkouts 27 | 28 | Carthage/Build 29 | 30 | # We recommend against adding the Pods directory to your .gitignore. However 31 | # you should judge for yourself, the pros and cons are mentioned at: 32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 33 | # 34 | # Note: if you ignore the Pods directory, make sure to uncomment 35 | # `pod install` in .travis.yml 36 | # 37 | # Pods/ 38 | -------------------------------------------------------------------------------- /.jazzy_cmd.yaml: -------------------------------------------------------------------------------- 1 | jazzy --podspec JOCircularSlider.podspec 2 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 4.2 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/ 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/JOCircularSlider.xcworkspace -scheme JOCircularSlider-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | 4 | ## [1.0.3](https://github.com/ouraigua/JOCircularSlider/releases/tag/1.0.3) 5 | 6 | * Add example 7 | 8 | 9 | ## [1.0.0](https://github.com/ouraigua/JOCircularSlider/releases/tag/1.0.0) 10 | 11 | * Initial release. 12 | -------------------------------------------------------------------------------- /Example/JOCircularSlider.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 17C382591B47967C59509AD9 /* Pods_JOCircularSlider_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F52466A1B3C5C5DC1D491FD /* Pods_JOCircularSlider_Tests.framework */; }; 11 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 12 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; 13 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 14 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; 15 | 9A9536F8A95805979063DD22 /* Pods_JOCircularSlider_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CC0EF1308BF44BE0466D9BF /* Pods_JOCircularSlider_Example.framework */; }; 16 | AF4F276921BB942500D39C60 /* .jazzy_cmd.yaml in Resources */ = {isa = PBXBuildFile; fileRef = AF4F276821BB942500D39C60 /* .jazzy_cmd.yaml */; }; 17 | AF737E2421B89B2B00BFBE5E /* GradientView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF737E2321B89B2B00BFBE5E /* GradientView.swift */; }; 18 | AF737E2621B89F8000BFBE5E /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF737E2521B89F8000BFBE5E /* Utils.swift */; }; 19 | AF737E2921B8D60400BFBE5E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AF737E2721B8D60400BFBE5E /* LaunchScreen.storyboard */; }; 20 | AF737E2B21B8D71900BFBE5E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AF737E2A21B8D71900BFBE5E /* Assets.xcassets */; }; 21 | AFB6605421BB1F2000E22629 /* .codebeatsettings in Resources */ = {isa = PBXBuildFile; fileRef = AFB6605321BB1F2000E22629 /* .codebeatsettings */; }; 22 | AFB6605821BB1F3300E22629 /* .swift-version in Resources */ = {isa = PBXBuildFile; fileRef = AFB6605521BB1F3300E22629 /* .swift-version */; }; 23 | AFB6605921BB1F3300E22629 /* .travis.yml in Resources */ = {isa = PBXBuildFile; fileRef = AFB6605621BB1F3300E22629 /* .travis.yml */; }; 24 | AFB6605A21BB1F3300E22629 /* .gitignore in Resources */ = {isa = PBXBuildFile; fileRef = AFB6605721BB1F3300E22629 /* .gitignore */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 607FACCF1AFB9204008FA782; 33 | remoteInfo = JOCircularSlider; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 3CC0EF1308BF44BE0466D9BF /* Pods_JOCircularSlider_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_JOCircularSlider_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 607FACD01AFB9204008FA782 /* JOCircularSlider_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JOCircularSlider_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 41 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 42 | 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 43 | 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 44 | 607FACE51AFB9204008FA782 /* JOCircularSlider_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JOCircularSlider_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; 47 | 7B49D36A49F9D30C4E298C6D /* JOCircularSlider.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = JOCircularSlider.podspec; path = ../JOCircularSlider.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 48 | 7F52466A1B3C5C5DC1D491FD /* Pods_JOCircularSlider_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_JOCircularSlider_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 857FCA310632359F6C66CC65 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 50 | 9ED6373888E3CDF94E3F8213 /* Pods-JOCircularSlider_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JOCircularSlider_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-JOCircularSlider_Tests/Pods-JOCircularSlider_Tests.debug.xcconfig"; sourceTree = ""; }; 51 | A310FF740AC505A50DEF761C /* Pods-JOCircularSlider_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JOCircularSlider_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-JOCircularSlider_Tests/Pods-JOCircularSlider_Tests.release.xcconfig"; sourceTree = ""; }; 52 | AF4F276821BB942500D39C60 /* .jazzy_cmd.yaml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = .jazzy_cmd.yaml; path = ../.jazzy_cmd.yaml; sourceTree = ""; }; 53 | AF737E2321B89B2B00BFBE5E /* GradientView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GradientView.swift; sourceTree = ""; }; 54 | AF737E2521B89F8000BFBE5E /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; 55 | AF737E2821B8D60400BFBE5E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 56 | AF737E2A21B8D71900BFBE5E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 57 | AFB6605321BB1F2000E22629 /* .codebeatsettings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = .codebeatsettings; path = ../.codebeatsettings; sourceTree = ""; }; 58 | AFB6605521BB1F3300E22629 /* .swift-version */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = ".swift-version"; path = "../.swift-version"; sourceTree = ""; }; 59 | AFB6605621BB1F3300E22629 /* .travis.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = .travis.yml; path = ../.travis.yml; sourceTree = ""; }; 60 | AFB6605721BB1F3300E22629 /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = .gitignore; path = ../.gitignore; sourceTree = ""; }; 61 | B53C2541DC14B9F694325C57 /* Pods-JOCircularSlider_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JOCircularSlider_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-JOCircularSlider_Example/Pods-JOCircularSlider_Example.debug.xcconfig"; sourceTree = ""; }; 62 | D0CC336CBAD390916FD5F8FE /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 63 | D1B349DAD0AE068D7095DAFC /* Pods-JOCircularSlider_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JOCircularSlider_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-JOCircularSlider_Example/Pods-JOCircularSlider_Example.release.xcconfig"; sourceTree = ""; }; 64 | /* End PBXFileReference section */ 65 | 66 | /* Begin PBXFrameworksBuildPhase section */ 67 | 607FACCD1AFB9204008FA782 /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | 9A9536F8A95805979063DD22 /* Pods_JOCircularSlider_Example.framework in Frameworks */, 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | 607FACE21AFB9204008FA782 /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | 17C382591B47967C59509AD9 /* Pods_JOCircularSlider_Tests.framework in Frameworks */, 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | /* End PBXFrameworksBuildPhase section */ 84 | 85 | /* Begin PBXGroup section */ 86 | 1A954A0BD054FB494CFC4610 /* Pods */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | B53C2541DC14B9F694325C57 /* Pods-JOCircularSlider_Example.debug.xcconfig */, 90 | D1B349DAD0AE068D7095DAFC /* Pods-JOCircularSlider_Example.release.xcconfig */, 91 | 9ED6373888E3CDF94E3F8213 /* Pods-JOCircularSlider_Tests.debug.xcconfig */, 92 | A310FF740AC505A50DEF761C /* Pods-JOCircularSlider_Tests.release.xcconfig */, 93 | ); 94 | name = Pods; 95 | sourceTree = ""; 96 | }; 97 | 1CA3AAEC0ADB94CA0FDE2184 /* Frameworks */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 3CC0EF1308BF44BE0466D9BF /* Pods_JOCircularSlider_Example.framework */, 101 | 7F52466A1B3C5C5DC1D491FD /* Pods_JOCircularSlider_Tests.framework */, 102 | ); 103 | name = Frameworks; 104 | sourceTree = ""; 105 | }; 106 | 607FACC71AFB9204008FA782 = { 107 | isa = PBXGroup; 108 | children = ( 109 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 110 | 607FACD21AFB9204008FA782 /* Example for JOCircularSlider */, 111 | 607FACE81AFB9204008FA782 /* Tests */, 112 | 607FACD11AFB9204008FA782 /* Products */, 113 | 1A954A0BD054FB494CFC4610 /* Pods */, 114 | 1CA3AAEC0ADB94CA0FDE2184 /* Frameworks */, 115 | ); 116 | sourceTree = ""; 117 | }; 118 | 607FACD11AFB9204008FA782 /* Products */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 607FACD01AFB9204008FA782 /* JOCircularSlider_Example.app */, 122 | 607FACE51AFB9204008FA782 /* JOCircularSlider_Tests.xctest */, 123 | ); 124 | name = Products; 125 | sourceTree = ""; 126 | }; 127 | 607FACD21AFB9204008FA782 /* Example for JOCircularSlider */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 131 | 607FACD71AFB9204008FA782 /* ViewController.swift */, 132 | AF737E2321B89B2B00BFBE5E /* GradientView.swift */, 133 | AF737E2521B89F8000BFBE5E /* Utils.swift */, 134 | AF737E2A21B8D71900BFBE5E /* Assets.xcassets */, 135 | 607FACD91AFB9204008FA782 /* Main.storyboard */, 136 | AF737E2721B8D60400BFBE5E /* LaunchScreen.storyboard */, 137 | 607FACD31AFB9204008FA782 /* Supporting Files */, 138 | ); 139 | name = "Example for JOCircularSlider"; 140 | path = JOCircularSlider; 141 | sourceTree = ""; 142 | }; 143 | 607FACD31AFB9204008FA782 /* Supporting Files */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 607FACD41AFB9204008FA782 /* Info.plist */, 147 | ); 148 | name = "Supporting Files"; 149 | sourceTree = ""; 150 | }; 151 | 607FACE81AFB9204008FA782 /* Tests */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | 607FACEB1AFB9204008FA782 /* Tests.swift */, 155 | 607FACE91AFB9204008FA782 /* Supporting Files */, 156 | ); 157 | path = Tests; 158 | sourceTree = ""; 159 | }; 160 | 607FACE91AFB9204008FA782 /* Supporting Files */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | 607FACEA1AFB9204008FA782 /* Info.plist */, 164 | ); 165 | name = "Supporting Files"; 166 | sourceTree = ""; 167 | }; 168 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 169 | isa = PBXGroup; 170 | children = ( 171 | 7B49D36A49F9D30C4E298C6D /* JOCircularSlider.podspec */, 172 | 857FCA310632359F6C66CC65 /* README.md */, 173 | D0CC336CBAD390916FD5F8FE /* LICENSE */, 174 | AFB6605321BB1F2000E22629 /* .codebeatsettings */, 175 | AFB6605721BB1F3300E22629 /* .gitignore */, 176 | AFB6605521BB1F3300E22629 /* .swift-version */, 177 | AFB6605621BB1F3300E22629 /* .travis.yml */, 178 | AF4F276821BB942500D39C60 /* .jazzy_cmd.yaml */, 179 | ); 180 | name = "Podspec Metadata"; 181 | sourceTree = ""; 182 | }; 183 | /* End PBXGroup section */ 184 | 185 | /* Begin PBXNativeTarget section */ 186 | 607FACCF1AFB9204008FA782 /* JOCircularSlider_Example */ = { 187 | isa = PBXNativeTarget; 188 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "JOCircularSlider_Example" */; 189 | buildPhases = ( 190 | 976ADAA40D81B4468508F351 /* [CP] Check Pods Manifest.lock */, 191 | 607FACCC1AFB9204008FA782 /* Sources */, 192 | 607FACCD1AFB9204008FA782 /* Frameworks */, 193 | 607FACCE1AFB9204008FA782 /* Resources */, 194 | B78D5F1F9DF5DF76B5C5B133 /* [CP] Embed Pods Frameworks */, 195 | ); 196 | buildRules = ( 197 | ); 198 | dependencies = ( 199 | ); 200 | name = JOCircularSlider_Example; 201 | productName = JOCircularSlider; 202 | productReference = 607FACD01AFB9204008FA782 /* JOCircularSlider_Example.app */; 203 | productType = "com.apple.product-type.application"; 204 | }; 205 | 607FACE41AFB9204008FA782 /* JOCircularSlider_Tests */ = { 206 | isa = PBXNativeTarget; 207 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "JOCircularSlider_Tests" */; 208 | buildPhases = ( 209 | FA1C097A5F70A5BB3E1747B8 /* [CP] Check Pods Manifest.lock */, 210 | 607FACE11AFB9204008FA782 /* Sources */, 211 | 607FACE21AFB9204008FA782 /* Frameworks */, 212 | 607FACE31AFB9204008FA782 /* Resources */, 213 | ); 214 | buildRules = ( 215 | ); 216 | dependencies = ( 217 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */, 218 | ); 219 | name = JOCircularSlider_Tests; 220 | productName = Tests; 221 | productReference = 607FACE51AFB9204008FA782 /* JOCircularSlider_Tests.xctest */; 222 | productType = "com.apple.product-type.bundle.unit-test"; 223 | }; 224 | /* End PBXNativeTarget section */ 225 | 226 | /* Begin PBXProject section */ 227 | 607FACC81AFB9204008FA782 /* Project object */ = { 228 | isa = PBXProject; 229 | attributes = { 230 | LastSwiftUpdateCheck = 0830; 231 | LastUpgradeCheck = 1000; 232 | ORGANIZATIONNAME = CocoaPods; 233 | TargetAttributes = { 234 | 607FACCF1AFB9204008FA782 = { 235 | CreatedOnToolsVersion = 6.3.1; 236 | DevelopmentTeam = 28UW7GL832; 237 | LastSwiftMigration = 1000; 238 | }; 239 | 607FACE41AFB9204008FA782 = { 240 | CreatedOnToolsVersion = 6.3.1; 241 | DevelopmentTeam = 28UW7GL832; 242 | LastSwiftMigration = 1000; 243 | TestTargetID = 607FACCF1AFB9204008FA782; 244 | }; 245 | }; 246 | }; 247 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "JOCircularSlider" */; 248 | compatibilityVersion = "Xcode 3.2"; 249 | developmentRegion = English; 250 | hasScannedForEncodings = 0; 251 | knownRegions = ( 252 | en, 253 | Base, 254 | ); 255 | mainGroup = 607FACC71AFB9204008FA782; 256 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 257 | projectDirPath = ""; 258 | projectRoot = ""; 259 | targets = ( 260 | 607FACCF1AFB9204008FA782 /* JOCircularSlider_Example */, 261 | 607FACE41AFB9204008FA782 /* JOCircularSlider_Tests */, 262 | ); 263 | }; 264 | /* End PBXProject section */ 265 | 266 | /* Begin PBXResourcesBuildPhase section */ 267 | 607FACCE1AFB9204008FA782 /* Resources */ = { 268 | isa = PBXResourcesBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | AFB6605921BB1F3300E22629 /* .travis.yml in Resources */, 272 | AFB6605A21BB1F3300E22629 /* .gitignore in Resources */, 273 | AF737E2921B8D60400BFBE5E /* LaunchScreen.storyboard in Resources */, 274 | AF737E2B21B8D71900BFBE5E /* Assets.xcassets in Resources */, 275 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 276 | AF4F276921BB942500D39C60 /* .jazzy_cmd.yaml in Resources */, 277 | AFB6605421BB1F2000E22629 /* .codebeatsettings in Resources */, 278 | AFB6605821BB1F3300E22629 /* .swift-version in Resources */, 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | 607FACE31AFB9204008FA782 /* Resources */ = { 283 | isa = PBXResourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | ); 287 | runOnlyForDeploymentPostprocessing = 0; 288 | }; 289 | /* End PBXResourcesBuildPhase section */ 290 | 291 | /* Begin PBXShellScriptBuildPhase section */ 292 | 976ADAA40D81B4468508F351 /* [CP] Check Pods Manifest.lock */ = { 293 | isa = PBXShellScriptBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | ); 297 | inputPaths = ( 298 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 299 | "${PODS_ROOT}/Manifest.lock", 300 | ); 301 | name = "[CP] Check Pods Manifest.lock"; 302 | outputPaths = ( 303 | "$(DERIVED_FILE_DIR)/Pods-JOCircularSlider_Example-checkManifestLockResult.txt", 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | shellPath = /bin/sh; 307 | 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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 308 | showEnvVarsInLog = 0; 309 | }; 310 | B78D5F1F9DF5DF76B5C5B133 /* [CP] Embed Pods Frameworks */ = { 311 | isa = PBXShellScriptBuildPhase; 312 | buildActionMask = 2147483647; 313 | files = ( 314 | ); 315 | inputPaths = ( 316 | "${SRCROOT}/Pods/Target Support Files/Pods-JOCircularSlider_Example/Pods-JOCircularSlider_Example-frameworks.sh", 317 | "${BUILT_PRODUCTS_DIR}/JOCircularSlider/JOCircularSlider.framework", 318 | ); 319 | name = "[CP] Embed Pods Frameworks"; 320 | outputPaths = ( 321 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JOCircularSlider.framework", 322 | ); 323 | runOnlyForDeploymentPostprocessing = 0; 324 | shellPath = /bin/sh; 325 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-JOCircularSlider_Example/Pods-JOCircularSlider_Example-frameworks.sh\"\n"; 326 | showEnvVarsInLog = 0; 327 | }; 328 | FA1C097A5F70A5BB3E1747B8 /* [CP] Check Pods Manifest.lock */ = { 329 | isa = PBXShellScriptBuildPhase; 330 | buildActionMask = 2147483647; 331 | files = ( 332 | ); 333 | inputPaths = ( 334 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 335 | "${PODS_ROOT}/Manifest.lock", 336 | ); 337 | name = "[CP] Check Pods Manifest.lock"; 338 | outputPaths = ( 339 | "$(DERIVED_FILE_DIR)/Pods-JOCircularSlider_Tests-checkManifestLockResult.txt", 340 | ); 341 | runOnlyForDeploymentPostprocessing = 0; 342 | shellPath = /bin/sh; 343 | 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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 344 | showEnvVarsInLog = 0; 345 | }; 346 | /* End PBXShellScriptBuildPhase section */ 347 | 348 | /* Begin PBXSourcesBuildPhase section */ 349 | 607FACCC1AFB9204008FA782 /* Sources */ = { 350 | isa = PBXSourcesBuildPhase; 351 | buildActionMask = 2147483647; 352 | files = ( 353 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 354 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 355 | AF737E2421B89B2B00BFBE5E /* GradientView.swift in Sources */, 356 | AF737E2621B89F8000BFBE5E /* Utils.swift in Sources */, 357 | ); 358 | runOnlyForDeploymentPostprocessing = 0; 359 | }; 360 | 607FACE11AFB9204008FA782 /* Sources */ = { 361 | isa = PBXSourcesBuildPhase; 362 | buildActionMask = 2147483647; 363 | files = ( 364 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */, 365 | ); 366 | runOnlyForDeploymentPostprocessing = 0; 367 | }; 368 | /* End PBXSourcesBuildPhase section */ 369 | 370 | /* Begin PBXTargetDependency section */ 371 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { 372 | isa = PBXTargetDependency; 373 | target = 607FACCF1AFB9204008FA782 /* JOCircularSlider_Example */; 374 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; 375 | }; 376 | /* End PBXTargetDependency section */ 377 | 378 | /* Begin PBXVariantGroup section */ 379 | 607FACD91AFB9204008FA782 /* Main.storyboard */ = { 380 | isa = PBXVariantGroup; 381 | children = ( 382 | 607FACDA1AFB9204008FA782 /* Base */, 383 | ); 384 | name = Main.storyboard; 385 | sourceTree = ""; 386 | }; 387 | AF737E2721B8D60400BFBE5E /* LaunchScreen.storyboard */ = { 388 | isa = PBXVariantGroup; 389 | children = ( 390 | AF737E2821B8D60400BFBE5E /* Base */, 391 | ); 392 | name = LaunchScreen.storyboard; 393 | sourceTree = ""; 394 | }; 395 | /* End PBXVariantGroup section */ 396 | 397 | /* Begin XCBuildConfiguration section */ 398 | 607FACED1AFB9204008FA782 /* Debug */ = { 399 | isa = XCBuildConfiguration; 400 | buildSettings = { 401 | ALWAYS_SEARCH_USER_PATHS = NO; 402 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 403 | CLANG_CXX_LIBRARY = "libc++"; 404 | CLANG_ENABLE_MODULES = YES; 405 | CLANG_ENABLE_OBJC_ARC = YES; 406 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 407 | CLANG_WARN_BOOL_CONVERSION = YES; 408 | CLANG_WARN_COMMA = YES; 409 | CLANG_WARN_CONSTANT_CONVERSION = YES; 410 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 411 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 412 | CLANG_WARN_EMPTY_BODY = YES; 413 | CLANG_WARN_ENUM_CONVERSION = YES; 414 | CLANG_WARN_INFINITE_RECURSION = YES; 415 | CLANG_WARN_INT_CONVERSION = YES; 416 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 417 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 418 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 419 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 420 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 421 | CLANG_WARN_STRICT_PROTOTYPES = YES; 422 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 423 | CLANG_WARN_UNREACHABLE_CODE = YES; 424 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 425 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 426 | COPY_PHASE_STRIP = NO; 427 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 428 | ENABLE_STRICT_OBJC_MSGSEND = YES; 429 | ENABLE_TESTABILITY = YES; 430 | GCC_C_LANGUAGE_STANDARD = gnu99; 431 | GCC_DYNAMIC_NO_PIC = NO; 432 | GCC_NO_COMMON_BLOCKS = YES; 433 | GCC_OPTIMIZATION_LEVEL = 0; 434 | GCC_PREPROCESSOR_DEFINITIONS = ( 435 | "DEBUG=1", 436 | "$(inherited)", 437 | ); 438 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 439 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 440 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 441 | GCC_WARN_UNDECLARED_SELECTOR = YES; 442 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 443 | GCC_WARN_UNUSED_FUNCTION = YES; 444 | GCC_WARN_UNUSED_VARIABLE = YES; 445 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 446 | MTL_ENABLE_DEBUG_INFO = YES; 447 | ONLY_ACTIVE_ARCH = YES; 448 | SDKROOT = iphoneos; 449 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 450 | }; 451 | name = Debug; 452 | }; 453 | 607FACEE1AFB9204008FA782 /* Release */ = { 454 | isa = XCBuildConfiguration; 455 | buildSettings = { 456 | ALWAYS_SEARCH_USER_PATHS = NO; 457 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 458 | CLANG_CXX_LIBRARY = "libc++"; 459 | CLANG_ENABLE_MODULES = YES; 460 | CLANG_ENABLE_OBJC_ARC = YES; 461 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 462 | CLANG_WARN_BOOL_CONVERSION = YES; 463 | CLANG_WARN_COMMA = YES; 464 | CLANG_WARN_CONSTANT_CONVERSION = YES; 465 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 466 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 467 | CLANG_WARN_EMPTY_BODY = YES; 468 | CLANG_WARN_ENUM_CONVERSION = YES; 469 | CLANG_WARN_INFINITE_RECURSION = YES; 470 | CLANG_WARN_INT_CONVERSION = YES; 471 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 472 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 473 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 474 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 475 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 476 | CLANG_WARN_STRICT_PROTOTYPES = YES; 477 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 478 | CLANG_WARN_UNREACHABLE_CODE = YES; 479 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 480 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 481 | COPY_PHASE_STRIP = NO; 482 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 483 | ENABLE_NS_ASSERTIONS = NO; 484 | ENABLE_STRICT_OBJC_MSGSEND = YES; 485 | GCC_C_LANGUAGE_STANDARD = gnu99; 486 | GCC_NO_COMMON_BLOCKS = YES; 487 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 488 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 489 | GCC_WARN_UNDECLARED_SELECTOR = YES; 490 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 491 | GCC_WARN_UNUSED_FUNCTION = YES; 492 | GCC_WARN_UNUSED_VARIABLE = YES; 493 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 494 | MTL_ENABLE_DEBUG_INFO = NO; 495 | SDKROOT = iphoneos; 496 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 497 | VALIDATE_PRODUCT = YES; 498 | }; 499 | name = Release; 500 | }; 501 | 607FACF01AFB9204008FA782 /* Debug */ = { 502 | isa = XCBuildConfiguration; 503 | baseConfigurationReference = B53C2541DC14B9F694325C57 /* Pods-JOCircularSlider_Example.debug.xcconfig */; 504 | buildSettings = { 505 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 506 | DEVELOPMENT_TEAM = 28UW7GL832; 507 | INFOPLIST_FILE = JOCircularSlider/Info.plist; 508 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 509 | MODULE_NAME = ExampleApp; 510 | PRODUCT_BUNDLE_IDENTIFIER = "com.ouraigua.JOCircularSlider-Example"; 511 | PRODUCT_NAME = "$(TARGET_NAME)"; 512 | SWIFT_VERSION = 4.2; 513 | TARGETED_DEVICE_FAMILY = "1,2"; 514 | }; 515 | name = Debug; 516 | }; 517 | 607FACF11AFB9204008FA782 /* Release */ = { 518 | isa = XCBuildConfiguration; 519 | baseConfigurationReference = D1B349DAD0AE068D7095DAFC /* Pods-JOCircularSlider_Example.release.xcconfig */; 520 | buildSettings = { 521 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 522 | DEVELOPMENT_TEAM = 28UW7GL832; 523 | INFOPLIST_FILE = JOCircularSlider/Info.plist; 524 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 525 | MODULE_NAME = ExampleApp; 526 | PRODUCT_BUNDLE_IDENTIFIER = "com.ouraigua.JOCircularSlider-Example"; 527 | PRODUCT_NAME = "$(TARGET_NAME)"; 528 | SWIFT_VERSION = 4.2; 529 | TARGETED_DEVICE_FAMILY = "1,2"; 530 | }; 531 | name = Release; 532 | }; 533 | 607FACF31AFB9204008FA782 /* Debug */ = { 534 | isa = XCBuildConfiguration; 535 | baseConfigurationReference = 9ED6373888E3CDF94E3F8213 /* Pods-JOCircularSlider_Tests.debug.xcconfig */; 536 | buildSettings = { 537 | DEVELOPMENT_TEAM = 28UW7GL832; 538 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 539 | GCC_PREPROCESSOR_DEFINITIONS = ( 540 | "DEBUG=1", 541 | "$(inherited)", 542 | ); 543 | INFOPLIST_FILE = Tests/Info.plist; 544 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/Frameworks @executable_path/Frameworks"; 545 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 546 | PRODUCT_NAME = "$(TARGET_NAME)"; 547 | SWIFT_VERSION = 4.2; 548 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JOCircularSlider_Example.app/JOCircularSlider_Example"; 549 | }; 550 | name = Debug; 551 | }; 552 | 607FACF41AFB9204008FA782 /* Release */ = { 553 | isa = XCBuildConfiguration; 554 | baseConfigurationReference = A310FF740AC505A50DEF761C /* Pods-JOCircularSlider_Tests.release.xcconfig */; 555 | buildSettings = { 556 | DEVELOPMENT_TEAM = 28UW7GL832; 557 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 558 | INFOPLIST_FILE = Tests/Info.plist; 559 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/Frameworks @executable_path/Frameworks"; 560 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 561 | PRODUCT_NAME = "$(TARGET_NAME)"; 562 | SWIFT_VERSION = 4.2; 563 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JOCircularSlider_Example.app/JOCircularSlider_Example"; 564 | }; 565 | name = Release; 566 | }; 567 | /* End XCBuildConfiguration section */ 568 | 569 | /* Begin XCConfigurationList section */ 570 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "JOCircularSlider" */ = { 571 | isa = XCConfigurationList; 572 | buildConfigurations = ( 573 | 607FACED1AFB9204008FA782 /* Debug */, 574 | 607FACEE1AFB9204008FA782 /* Release */, 575 | ); 576 | defaultConfigurationIsVisible = 0; 577 | defaultConfigurationName = Release; 578 | }; 579 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "JOCircularSlider_Example" */ = { 580 | isa = XCConfigurationList; 581 | buildConfigurations = ( 582 | 607FACF01AFB9204008FA782 /* Debug */, 583 | 607FACF11AFB9204008FA782 /* Release */, 584 | ); 585 | defaultConfigurationIsVisible = 0; 586 | defaultConfigurationName = Release; 587 | }; 588 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "JOCircularSlider_Tests" */ = { 589 | isa = XCConfigurationList; 590 | buildConfigurations = ( 591 | 607FACF31AFB9204008FA782 /* Debug */, 592 | 607FACF41AFB9204008FA782 /* Release */, 593 | ); 594 | defaultConfigurationIsVisible = 0; 595 | defaultConfigurationName = Release; 596 | }; 597 | /* End XCConfigurationList section */ 598 | }; 599 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 600 | } 601 | -------------------------------------------------------------------------------- /Example/JOCircularSlider.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/JOCircularSlider.xcodeproj/xcshareddata/xcschemes/JOCircularSlider-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /Example/JOCircularSlider.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/JOCircularSlider.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/JOCircularSlider.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Example/JOCircularSlider/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // JOCircularSlider 4 | // 5 | // Created by Jalal Ouraigua on 12/05/2018. 6 | // Copyright (c) 2018 Jalal Ouraigua. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // 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. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Example/JOCircularSlider/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Example/JOCircularSlider/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/JOCircularSlider/Assets.xcassets/thumb.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "thumb.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template" 14 | } 15 | } -------------------------------------------------------------------------------- /Example/JOCircularSlider/Assets.xcassets/thumb.imageset/thumb.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouraigua-zz/JOCircularSlider/c3cf5527fd10347f5c8fcfcc625c08b692c1916d/Example/JOCircularSlider/Assets.xcassets/thumb.imageset/thumb.pdf -------------------------------------------------------------------------------- /Example/JOCircularSlider/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Example/JOCircularSlider/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 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 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 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | -------------------------------------------------------------------------------- /Example/JOCircularSlider/GradientView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GradientView.swift 3 | // JOCircularSlider_Example 4 | // 5 | // Created by Jalal Ouraigua on 05/12/2018. 6 | // Copyright © 2018 CocoaPods. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @IBDesignable 12 | class GradientView: UIView { 13 | 14 | @IBInspectable 15 | var color1: UIColor = .red { didSet { setNeedsDisplay() }} 16 | 17 | @IBInspectable 18 | var color2: UIColor = .blue { didSet { setNeedsDisplay() }} 19 | 20 | override func draw(_ rect: CGRect) { 21 | 22 | let colorSpace = CGColorSpaceCreateDeviceRGB() 23 | let cgColors = [color1.cgColor, color2.cgColor] 24 | let locations: [CGFloat] = [0.0, 1.0] 25 | 26 | let context = UIGraphicsGetCurrentContext()! 27 | 28 | guard let gradient = CGGradient(colorsSpace: colorSpace, colors: cgColors as CFArray, locations: locations) else { return } 29 | 30 | 31 | context.drawLinearGradient(gradient, start: .zero, end: CGPoint(x: 0, y: bounds.height), options: CGGradientDrawingOptions(rawValue: 0)) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Example/JOCircularSlider/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 | 2.0.3 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 | UIStatusBarStyle 34 | UIStatusBarStyleLightContent 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | 43 | UIViewControllerBasedStatusBarAppearance 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Example/JOCircularSlider/Utils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Utils.swift 3 | // JOCircularSlider_Example 4 | // 5 | // Created by Jalal Ouraigua on 06/12/2018. 6 | // Copyright © 2018 CocoaPods. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import JOCircularSlider 11 | 12 | @IBDesignable 13 | class DesignableSlider: UISlider { 14 | 15 | @IBInspectable 16 | var thumbImage: UIImage { 17 | get { return currentThumbImage ?? UIImage()} 18 | set { setThumbImage(newValue, for: .normal)} 19 | } 20 | } 21 | 22 | enum Theme: Int { 23 | 24 | case dark 25 | case light 26 | 27 | var gradientViewColor1: UIColor { 28 | switch self { 29 | case .light: return UIColor(red: 239/255.0, green: 239/255.0, blue: 240/255.0, alpha: 1) 30 | case .dark: return UIColor(red: 28/255.0, green: 33/255.0, blue: 40/255.0, alpha: 1) 31 | } 32 | } 33 | 34 | var gradientViewColor2: UIColor { 35 | switch self { 36 | case .light: return UIColor(red: 212/255.0, green: 216/255.0, blue: 221/255.0, alpha: 1) 37 | case .dark: return UIColor(red: 34/255.0, green: 36/255.0, blue: 42/255.0, alpha: 1) 38 | } 39 | } 40 | 41 | var onColor: UIColor { 42 | return self == .light ? Constants.dotBlueColor : Constants.dotOrangeColor 43 | } 44 | var color1: UIColor { 45 | return self == .light ? Constants.lightColor1 : Constants.darkColor1 46 | } 47 | var color2: UIColor { 48 | return self == .light ? Constants.lightColor2 : Constants.darkColor2 49 | } 50 | var color3: UIColor { 51 | return self == .light ? Constants.lightColor3 : Constants.darkColor3 52 | } 53 | var color4: UIColor { 54 | return self == .light ? Constants.lightColor4 : Constants.darkColor4 55 | } 56 | var highlightColor: UIColor { 57 | return self == .light ? Constants.lightHighlightColor : Constants.darkHighlightColor 58 | } 59 | var textColor: UIColor { 60 | return self == .light ? Constants.lightTextColor : Constants.darkTextColor 61 | } 62 | var maxidotOffColor: UIColor { 63 | return self == .light ? Constants.dotGrayColor : .black 64 | } 65 | var pointerColor1: UIColor { 66 | return self == .light ? Constants.lightColor4 : .black 67 | } 68 | var pointerColor2: UIColor { 69 | return self == .light ? .white : UIColor(red: 65/255.0, green: 69/255.0, blue: 81/255.0, alpha: 1.0) 70 | } 71 | var shadowOpacity: Float { 72 | return self == .light ? 0.4 : 0.8 73 | } 74 | 75 | var minidotColor: UIColor { 76 | return self == .light ? Constants.dotGrayColor : .black 77 | } 78 | 79 | var minidotHighlightColor: UIColor { 80 | return self == .light ? Constants.lightHighlightColor : Constants.darkHighlightColor 81 | } 82 | } 83 | 84 | enum Direction: Int { 85 | case antiClockwise 86 | case clockwise 87 | 88 | var startAngle: CGFloat { 89 | return self == .antiClockwise ? 230.0 : 140.0 90 | } 91 | var endAngle: CGFloat { 92 | return self == .antiClockwise ? 310.0 : 40.0 93 | } 94 | 95 | } 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /Example/JOCircularSlider/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // JOCircularSlider 4 | // 5 | // Created by Jalal Ouraigua on 12/05/2018. 6 | // Copyright (c) 2018 Jalal Ouraigua. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import JOCircularSlider 11 | 12 | class ViewController: UIViewController { 13 | 14 | @IBOutlet weak var circularSlider: CircularSlider! { 15 | didSet { 16 | circularSlider.addTarget(self, action: #selector(handleValueChanged(_:)), for: .valueChanged) 17 | circularSlider.addTarget(self, action: #selector(didBeginEditing), for: .editingDidBegin) 18 | circularSlider.addTarget(self, action: #selector(didEndEditing), for: .editingDidEnd) 19 | } 20 | } 21 | 22 | @IBOutlet weak var stackView: UIStackView! 23 | @IBOutlet weak var widthConstraint: NSLayoutConstraint! { 24 | didSet { 25 | let isPad = UIScreen.main.traitCollection.userInterfaceIdiom == .pad 26 | widthConstraint.constant = isPad ? -100.0 : 0 27 | } 28 | } 29 | 30 | private var theme: Theme = .dark 31 | 32 | @IBAction private func toggleTheme(_ sender: UISegmentedControl) { 33 | guard let theme = Theme(rawValue: sender.selectedSegmentIndex) else { return } 34 | self.theme = theme 35 | 36 | if let gradientView = view as? GradientView { 37 | gradientView.color1 = theme.gradientViewColor1 38 | gradientView.color2 = theme.gradientViewColor2 39 | } 40 | 41 | circularSlider.color1 = theme.color1 42 | circularSlider.color2 = theme.color2 43 | circularSlider.color3 = theme.color3 44 | circularSlider.color4 = theme.color4 45 | circularSlider.highlightColor = theme.highlightColor 46 | circularSlider.maxidotOnColor = theme.onColor 47 | circularSlider.maxidotOffColor = theme.maxidotOffColor 48 | circularSlider.textColor = theme.textColor 49 | circularSlider.pointerColor1 = theme.pointerColor1 50 | circularSlider.pointerColor2 = theme.pointerColor2 51 | circularSlider.knobShadowOpacity = theme.shadowOpacity 52 | circularSlider.minidotColor = theme.minidotColor 53 | circularSlider.minidotHighlightColor = theme.minidotHighlightColor 54 | 55 | // change controls tinit color 56 | let darkColor = UIColor(red: 86/255.0, green: 93/255.0, blue: 108/255.0, alpha: 1) 57 | let lightColor = UIColor(red: 136/255.0, green: 143/255.0, blue: 160/255.0, alpha: 1) 58 | let sliderDark = UIColor(red: 52/255.0, green: 60/255.0, blue: 72/255.0, alpha: 1) 59 | let sliderLight = UIColor(red: 128/255.0, green: 136/255.0, blue: 149/255.0, alpha: 1) 60 | 61 | for subview in stackView.subviews { 62 | 63 | if let slider = subview as? UISlider { 64 | slider.tintColor = theme == .dark ? sliderDark : sliderLight 65 | slider.maximumTrackTintColor = theme == .dark ? .black : UIColor.white.withAlphaComponent(0.4) 66 | 67 | } else { 68 | subview.tintColor = theme == .dark ? darkColor : lightColor 69 | } 70 | } 71 | } 72 | 73 | @IBAction private func toggleDirection(_ sender: UISegmentedControl) { 74 | 75 | guard let direction = Direction(rawValue: sender.selectedSegmentIndex) else { return } 76 | 77 | circularSlider.isClockwise = direction == .clockwise 78 | circularSlider.startAngle = direction.startAngle 79 | circularSlider.endAngle = direction.endAngle 80 | DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { 81 | let value = self.circularSlider.value 82 | self.circularSlider.value = value 83 | } 84 | } 85 | 86 | @IBAction private func toggleMiniView(_ sender: UISegmentedControl) { 87 | if sender.selectedSegmentIndex == 0 { 88 | circularSlider.minidotViewIsHidden = false 89 | circularSlider.maxidotCount = 10 90 | circularSlider.maxidotMaxDotCount = 3 91 | circularSlider.maxidotRadiusMultiplier = 0.09 92 | circularSlider.minidotColor = theme.minidotColor 93 | } else { 94 | circularSlider.minidotViewIsHidden = true 95 | circularSlider.maxidotCount = 40 96 | circularSlider.maxidotMaxDotCount = 10 97 | circularSlider.maxidotRadiusMultiplier = 0.25 98 | } 99 | } 100 | 101 | @IBAction private func changeRadius(_ sender: UISlider) { 102 | let newMultiplier = CGFloat(sender.value) 103 | if sender.tag == 2 { 104 | guard newMultiplier < circularSlider.knobMiddleCircleMultiplier else { return } 105 | circularSlider.knobInnerCircleMultiplier = newMultiplier 106 | } else if sender.tag == 0 { 107 | guard newMultiplier > circularSlider.knobMiddleCircleMultiplier else { return } 108 | circularSlider.knobOuterCircleMultiplier = min(0.99, newMultiplier) 109 | } else { 110 | guard newMultiplier < circularSlider.knobOuterCircleMultiplier && 111 | newMultiplier > circularSlider.knobInnerCircleMultiplier else { return } 112 | circularSlider.knobMiddleCircleMultiplier = newMultiplier 113 | } 114 | 115 | let value = circularSlider.value 116 | circularSlider.value = value 117 | } 118 | 119 | @IBAction private func changeDotCount(_ sender: UISlider) { 120 | circularSlider.maxidotCount = Int(sender.value) 121 | circularSlider.maxidotMaxDotCount = Int(sender.value / 5.0) 122 | } 123 | 124 | @IBAction private func changeColor(_ sender: UISlider) { 125 | circularSlider.maxidotOnColor = UIColor(hue: CGFloat(sender.value), saturation: 1, brightness: 1, alpha: 1) 126 | } 127 | 128 | 129 | @objc func didBeginEditing() { 130 | print("\n" + "didBeginEditing\n") 131 | } 132 | 133 | @objc func didEndEditing() { 134 | print("\n" + "didBeginEditing\n") 135 | } 136 | 137 | @IBAction func handleValueChanged(_ sender: CircularSlider) { 138 | print("value: \(sender.value)") 139 | 140 | // If you need to override the formatting of the text in the 141 | // label, then use this. 142 | // circularSlider.setLabelText(String(format: "%.3f", sender.value)) 143 | } 144 | 145 | 146 | } 147 | 148 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'JOCircularSlider_Example' do 4 | pod 'JOCircularSlider', :path => '../' 5 | 6 | target 'JOCircularSlider_Tests' do 7 | inherit! :search_paths 8 | 9 | 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - JOCircularSlider (1.0.0) 3 | 4 | DEPENDENCIES: 5 | - JOCircularSlider (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | JOCircularSlider: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | JOCircularSlider: b0a2366cc0d303bc43cdf32afb18c266b2448a2c 13 | 14 | PODFILE CHECKSUM: 5f59154dfd18781ce4e81da44fa6f83c4aa7dc7e 15 | 16 | COCOAPODS: 1.5.3 17 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/JOCircularSlider.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "JOCircularSlider", 3 | "version": "1.0.0", 4 | "summary": "A highly customaizable and reusable circular slider for iOS applications.", 5 | "description": "A highly customaizable and reusable circular slider for iOS applications.\nIt's written in Swift 4.2 and it's 100% IBDesignable and all parameters are IBInspectable.\nYou can control almost every aspect of the slider's design: Size, colors, direction (clockwise/anti-clockwise), etc...", 6 | "homepage": "https://github.com/ouraigua/JOCircularSlider", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "Jalal Ouraigua": "ouraigua@icloud.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/ouraigua/JOCircularSlider.git", 16 | "tag": "1.0.0" 17 | }, 18 | "social_media_url": "https://twitter.com/ouraigua", 19 | "platforms": { 20 | "ios": "10.0" 21 | }, 22 | "source_files": "JOCircularSlider/Classes/**/*" 23 | } 24 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - JOCircularSlider (1.0.0) 3 | 4 | DEPENDENCIES: 5 | - JOCircularSlider (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | JOCircularSlider: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | JOCircularSlider: b0a2366cc0d303bc43cdf32afb18c266b2448a2c 13 | 14 | PODFILE CHECKSUM: 5f59154dfd18781ce4e81da44fa6f83c4aa7dc7e 15 | 16 | COCOAPODS: 1.5.3 17 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/JOCircularSlider.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/JOCircularSlider/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 | 2.0.3 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/JOCircularSlider/JOCircularSlider-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_JOCircularSlider : NSObject 3 | @end 4 | @implementation PodsDummy_JOCircularSlider 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/JOCircularSlider/JOCircularSlider-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/JOCircularSlider/JOCircularSlider-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double JOCircularSliderVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char JOCircularSliderVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/JOCircularSlider/JOCircularSlider.modulemap: -------------------------------------------------------------------------------- 1 | framework module JOCircularSlider { 2 | umbrella header "JOCircularSlider-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/JOCircularSlider/JOCircularSlider.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/JOCircularSlider 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Example/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 | 2.0.3 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Example/Pods-JOCircularSlider_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## JOCircularSlider 5 | 6 | Copyright (c) 2018 Jalal Ouraigua 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Example/Pods-JOCircularSlider_Example-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2018 Jalal Ouraigua <ouraigua@icloud.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | JOCircularSlider 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Example/Pods-JOCircularSlider_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_JOCircularSlider_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_JOCircularSlider_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Example/Pods-JOCircularSlider_Example-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # frameworks to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 14 | 15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 17 | 18 | # Used as a return value for each invocation of `strip_invalid_archs` function. 19 | STRIP_BINARY_RETVAL=0 20 | 21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 24 | 25 | # Copies and strips a vendored framework 26 | install_framework() 27 | { 28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 29 | local source="${BUILT_PRODUCTS_DIR}/$1" 30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 32 | elif [ -r "$1" ]; then 33 | local source="$1" 34 | fi 35 | 36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 37 | 38 | if [ -L "${source}" ]; then 39 | echo "Symlinked..." 40 | source="$(readlink "${source}")" 41 | fi 42 | 43 | # Use filter instead of exclude so missing patterns don't throw errors. 44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 46 | 47 | local basename 48 | basename="$(basename -s .framework "$1")" 49 | binary="${destination}/${basename}.framework/${basename}" 50 | if ! [ -r "$binary" ]; then 51 | binary="${destination}/${basename}" 52 | fi 53 | 54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 56 | strip_invalid_archs "$binary" 57 | fi 58 | 59 | # Resign the code if required by the build settings to avoid unstable apps 60 | code_sign_if_enabled "${destination}/$(basename "$1")" 61 | 62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 64 | local swift_runtime_libs 65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 66 | for lib in $swift_runtime_libs; do 67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 69 | code_sign_if_enabled "${destination}/${lib}" 70 | done 71 | fi 72 | } 73 | 74 | # Copies and strips a vendored dSYM 75 | install_dsym() { 76 | local source="$1" 77 | if [ -r "$source" ]; then 78 | # Copy the dSYM into a the targets temp dir. 79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 81 | 82 | local basename 83 | basename="$(basename -s .framework.dSYM "$source")" 84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 85 | 86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 88 | strip_invalid_archs "$binary" 89 | fi 90 | 91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 92 | # Move the stripped file into its final destination. 93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 95 | else 96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 98 | fi 99 | fi 100 | } 101 | 102 | # Signs a framework with the provided identity 103 | code_sign_if_enabled() { 104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 105 | # Use the current code_sign_identitiy 106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 108 | 109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 110 | code_sign_cmd="$code_sign_cmd &" 111 | fi 112 | echo "$code_sign_cmd" 113 | eval "$code_sign_cmd" 114 | fi 115 | } 116 | 117 | # Strip invalid architectures 118 | strip_invalid_archs() { 119 | binary="$1" 120 | # Get architectures for current target binary 121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 122 | # Intersect them with the architectures we are building for 123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 124 | # If there are no archs supported by this binary then warn the user 125 | if [[ -z "$intersected_archs" ]]; then 126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 127 | STRIP_BINARY_RETVAL=0 128 | return 129 | fi 130 | stripped="" 131 | for arch in $binary_archs; do 132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 133 | # Strip non-valid architectures in-place 134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 135 | stripped="$stripped $arch" 136 | fi 137 | done 138 | if [[ "$stripped" ]]; then 139 | echo "Stripped $binary of architectures:$stripped" 140 | fi 141 | STRIP_BINARY_RETVAL=1 142 | } 143 | 144 | 145 | if [[ "$CONFIGURATION" == "Debug" ]]; then 146 | install_framework "${BUILT_PRODUCTS_DIR}/JOCircularSlider/JOCircularSlider.framework" 147 | fi 148 | if [[ "$CONFIGURATION" == "Release" ]]; then 149 | install_framework "${BUILT_PRODUCTS_DIR}/JOCircularSlider/JOCircularSlider.framework" 150 | fi 151 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 152 | wait 153 | fi 154 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Example/Pods-JOCircularSlider_Example-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Example/Pods-JOCircularSlider_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_JOCircularSlider_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_JOCircularSlider_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Example/Pods-JOCircularSlider_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JOCircularSlider" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/JOCircularSlider/JOCircularSlider.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "JOCircularSlider" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Example/Pods-JOCircularSlider_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_JOCircularSlider_Example { 2 | umbrella header "Pods-JOCircularSlider_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Example/Pods-JOCircularSlider_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JOCircularSlider" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/JOCircularSlider/JOCircularSlider.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "JOCircularSlider" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Tests/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 | 2.0.3 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Tests/Pods-JOCircularSlider_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Tests/Pods-JOCircularSlider_Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Tests/Pods-JOCircularSlider_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_JOCircularSlider_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_JOCircularSlider_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Tests/Pods-JOCircularSlider_Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # frameworks to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 14 | 15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 17 | 18 | # Used as a return value for each invocation of `strip_invalid_archs` function. 19 | STRIP_BINARY_RETVAL=0 20 | 21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 24 | 25 | # Copies and strips a vendored framework 26 | install_framework() 27 | { 28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 29 | local source="${BUILT_PRODUCTS_DIR}/$1" 30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 32 | elif [ -r "$1" ]; then 33 | local source="$1" 34 | fi 35 | 36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 37 | 38 | if [ -L "${source}" ]; then 39 | echo "Symlinked..." 40 | source="$(readlink "${source}")" 41 | fi 42 | 43 | # Use filter instead of exclude so missing patterns don't throw errors. 44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 46 | 47 | local basename 48 | basename="$(basename -s .framework "$1")" 49 | binary="${destination}/${basename}.framework/${basename}" 50 | if ! [ -r "$binary" ]; then 51 | binary="${destination}/${basename}" 52 | fi 53 | 54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 56 | strip_invalid_archs "$binary" 57 | fi 58 | 59 | # Resign the code if required by the build settings to avoid unstable apps 60 | code_sign_if_enabled "${destination}/$(basename "$1")" 61 | 62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 64 | local swift_runtime_libs 65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 66 | for lib in $swift_runtime_libs; do 67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 69 | code_sign_if_enabled "${destination}/${lib}" 70 | done 71 | fi 72 | } 73 | 74 | # Copies and strips a vendored dSYM 75 | install_dsym() { 76 | local source="$1" 77 | if [ -r "$source" ]; then 78 | # Copy the dSYM into a the targets temp dir. 79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 81 | 82 | local basename 83 | basename="$(basename -s .framework.dSYM "$source")" 84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 85 | 86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 88 | strip_invalid_archs "$binary" 89 | fi 90 | 91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 92 | # Move the stripped file into its final destination. 93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 95 | else 96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 98 | fi 99 | fi 100 | } 101 | 102 | # Signs a framework with the provided identity 103 | code_sign_if_enabled() { 104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 105 | # Use the current code_sign_identitiy 106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 108 | 109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 110 | code_sign_cmd="$code_sign_cmd &" 111 | fi 112 | echo "$code_sign_cmd" 113 | eval "$code_sign_cmd" 114 | fi 115 | } 116 | 117 | # Strip invalid architectures 118 | strip_invalid_archs() { 119 | binary="$1" 120 | # Get architectures for current target binary 121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 122 | # Intersect them with the architectures we are building for 123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 124 | # If there are no archs supported by this binary then warn the user 125 | if [[ -z "$intersected_archs" ]]; then 126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 127 | STRIP_BINARY_RETVAL=0 128 | return 129 | fi 130 | stripped="" 131 | for arch in $binary_archs; do 132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 133 | # Strip non-valid architectures in-place 134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 135 | stripped="$stripped $arch" 136 | fi 137 | done 138 | if [[ "$stripped" ]]; then 139 | echo "Stripped $binary of architectures:$stripped" 140 | fi 141 | STRIP_BINARY_RETVAL=1 142 | } 143 | 144 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 145 | wait 146 | fi 147 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Tests/Pods-JOCircularSlider_Tests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Tests/Pods-JOCircularSlider_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_JOCircularSlider_TestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_JOCircularSlider_TestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Tests/Pods-JOCircularSlider_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JOCircularSlider" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/JOCircularSlider/JOCircularSlider.framework/Headers" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Tests/Pods-JOCircularSlider_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_JOCircularSlider_Tests { 2 | umbrella header "Pods-JOCircularSlider_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOCircularSlider_Tests/Pods-JOCircularSlider_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JOCircularSlider" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/JOCircularSlider/JOCircularSlider.framework/Headers" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Example/Tests/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 | -------------------------------------------------------------------------------- /Example/Tests/Tests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | import JOCircularSlider 3 | 4 | class Tests: XCTestCase { 5 | 6 | override func setUp() { 7 | super.setUp() 8 | // Put setup code here. This method is called before the invocation of each test method in the class. 9 | } 10 | 11 | override func tearDown() { 12 | // Put teardown code here. This method is called after the invocation of each test method in the class. 13 | super.tearDown() 14 | } 15 | 16 | func testExample() { 17 | // This is an example of a functional test case. 18 | XCTAssert(true, "Pass") 19 | } 20 | 21 | func testPerformanceExample() { 22 | // This is an example of a performance test case. 23 | self.measure() { 24 | // Put the code you want to measure the time of here. 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /JOCircularSlider.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint JOCircularSlider.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'JOCircularSlider' 11 | s.version = '2.0.3' 12 | s.summary = 'A highly customisable and reusable iOS circular slider.' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = <<-DESC 21 | JOCircularSlider is a highly customisable and reusable iOS circular slider that mimics the behaviour of a knob control. It uses no preset images and every one of its components is drawn completely in code making it extremely adaptable to every design and theme. 22 | It's written in Swift 4.2 and it's 100% IBDesignable and all parameters are IBInspectable. 23 | You can control almost every aspect of the slider's design: Size, colors, direction (clockwise/anti-clockwise), etc... 24 | DESC 25 | 26 | s.homepage = 'https://github.com/ouraigua/JOCircularSlider' 27 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 28 | s.license = { :type => 'MIT', :file => 'LICENSE' } 29 | s.author = { 'Jalal Ouraigua' => 'ouraigua@icloud.com' } 30 | s.source = { :git => 'https://github.com/ouraigua/JOCircularSlider.git', :tag => s.version.to_s } 31 | s.social_media_url = 'https://twitter.com/ouraigua' 32 | 33 | s.ios.deployment_target = '10.0' 34 | 35 | s.source_files = 'JOCircularSlider/Classes/**/*' 36 | 37 | s.documentation_url = 'http://ouraigua.com/github/jocircularslider/docs/index.html' 38 | 39 | # s.resource_bundles = { 40 | # 'JOCircularSlider' => ['JOCircularSlider/Assets/*.png'] 41 | # } 42 | 43 | # s.public_header_files = 'Pod/Classes/**/*.h' 44 | # s.frameworks = 'UIKit', 'MapKit' 45 | # s.dependency 'AFNetworking', '~> 2.3' 46 | end 47 | -------------------------------------------------------------------------------- /JOCircularSlider/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouraigua-zz/JOCircularSlider/c3cf5527fd10347f5c8fcfcc625c08b692c1916d/JOCircularSlider/Assets/.gitkeep -------------------------------------------------------------------------------- /JOCircularSlider/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouraigua-zz/JOCircularSlider/c3cf5527fd10347f5c8fcfcc625c08b692c1916d/JOCircularSlider/Classes/.gitkeep -------------------------------------------------------------------------------- /JOCircularSlider/Classes/CircularLayer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CircularLayer.swift 3 | // JOCircularSlider 4 | // 5 | // Created by Jalal Ouraigua on 04/12/2018. 6 | // Copyright © 2018 Jalal Ouraigua. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public enum CircleMaskType { 12 | case stroke(width: CGFloat) 13 | case fill 14 | } 15 | 16 | public enum GradientType { 17 | case linear(direction: GradientDirection) 18 | case radial 19 | } 20 | 21 | public enum GradientDirection: Int { 22 | case leftToRight 23 | case rightToLeft 24 | case topToBottom 25 | case bottomToTop 26 | case topLeftToBottomRight 27 | case topRightToBottomLeft 28 | case bottomLeftToTopRight 29 | case bottomRightToTopLeft 30 | 31 | func coordinates(for rect: CGRect) -> (start: CGPoint, end: CGPoint) { 32 | switch self { 33 | case .leftToRight: return (CGPoint(x: 0, y: 0), CGPoint(x: rect.width, y: 0)) 34 | case .rightToLeft: return (CGPoint(x: rect.width, y: 0), CGPoint(x: 0, y: 0)) 35 | case .topToBottom: return (CGPoint(x: 0, y: 0), CGPoint(x: 0, y: rect.height)) 36 | case .bottomToTop: return (CGPoint(x: 0, y: rect.height), CGPoint(x: 0, y: 0)) 37 | case .topLeftToBottomRight: return (CGPoint(x: 0, y: 0), CGPoint(x: rect.width, y: rect.height)) 38 | case .topRightToBottomLeft: return (CGPoint(x: rect.width, y: 0), CGPoint(x: 0, y: rect.height)) 39 | case .bottomLeftToTopRight: return (CGPoint(x: 0, y: rect.height), CGPoint(x: rect.width, y: 0)) 40 | case .bottomRightToTopLeft: return (CGPoint(x: rect.width, y: rect.height), CGPoint(x: 0, y: 0)) 41 | } 42 | } 43 | } 44 | 45 | class CircularLayer: CALayer { 46 | 47 | // MARK: - Public Properties 48 | 49 | var gradientType: GradientType = .linear(direction: .topToBottom) { 50 | didSet { setNeedsDisplay() } 51 | } 52 | var locations: [CGFloat] = [0.0, 1.0] { 53 | didSet { setNeedsDisplay() } 54 | } 55 | var colors: [UIColor] = [.red, .blue] { 56 | didSet { setNeedsDisplay() } 57 | } 58 | var maskType: CircleMaskType = .fill { 59 | didSet { setNeedsDisplay() } 60 | } 61 | var multiplier: CGFloat = 1.0 { 62 | didSet { setNeedsDisplay() } 63 | } 64 | 65 | // MARK: - Private Properties 66 | 67 | fileprivate let maskLayer = CAShapeLayer() 68 | 69 | private var center: CGPoint { 70 | return CGPoint(x: bounds.width/2, y: bounds.height/2) 71 | } 72 | private var radius: CGFloat { 73 | return (bounds.width + bounds.height)/2 74 | } 75 | private var cgColors: [CGColor] { 76 | return colors.map {$0.cgColor} 77 | } 78 | 79 | // MARK: - Init 80 | 81 | init(gradientType: GradientType = .linear(direction: .topToBottom), 82 | colors: [UIColor], 83 | maskType: CircleMaskType, 84 | locations: [CGFloat] = [0.0, 1.0], 85 | multiplier: CGFloat = 1.0) { 86 | 87 | self.gradientType = gradientType 88 | self.colors = colors 89 | self.maskType = maskType 90 | self.locations = locations 91 | self.multiplier = multiplier 92 | 93 | super.init() 94 | needsDisplayOnBoundsChange = true 95 | } 96 | 97 | required init?(coder aDecoder: NSCoder) { 98 | super.init() 99 | needsDisplayOnBoundsChange = true 100 | } 101 | 102 | override init(layer: Any) { 103 | super.init(layer: layer) 104 | needsDisplayOnBoundsChange = true 105 | } 106 | 107 | override func draw(in ctx: CGContext) { 108 | 109 | let colorSpace = CGColorSpaceCreateDeviceRGB() 110 | guard let gradient = CGGradient(colorsSpace: colorSpace, colors: cgColors as CFArray, locations: locations) else { return } 111 | 112 | switch gradientType { 113 | case .radial: 114 | ctx.drawRadialGradient(gradient, startCenter: center, startRadius: 0.0, endCenter: center, endRadius: radius, options: CGGradientDrawingOptions(rawValue: 0)) 115 | case .linear(let direction): 116 | let coordinates = direction.coordinates(for: bounds) 117 | ctx.drawLinearGradient(gradient, start: coordinates.start, end: coordinates.end, options: CGGradientDrawingOptions(rawValue: 0)) 118 | } 119 | 120 | switch maskType { 121 | case .fill: break 122 | case .stroke(let width): 123 | maskLayer.fillColor = UIColor.clear.cgColor 124 | maskLayer.lineWidth = width 125 | maskLayer.strokeColor = UIColor.black.cgColor 126 | } 127 | 128 | maskLayer.path = circlePath(with: multiplier).cgPath 129 | self.mask = maskLayer 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /JOCircularSlider/Classes/CircularSlider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CircularSlider.swift 3 | // JOCircularSlider 4 | // 5 | // Created by Jalal Ouraigua on 04/12/2018. 6 | // Copyright © 2018 Jalal Ouraigua. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public struct Constants { 12 | 13 | public static let lightTextColor = UIColor(red: 204/255.0, green: 204/255.0, blue: 204/255.0, alpha: 1) 14 | public static let darkTextColor = UIColor.black 15 | public static let fontName = "HelveticaNeue-Light" // HelveticaNeue-Light Helvetica-Bold 16 | 17 | public static let lightColor1 = UIColor(red: 226/255.0, green: 226/255.0, blue: 226/255.0, alpha: 0.2) 18 | public static let lightColor2 = UIColor(red: 249/255.0, green: 249/255.0, blue: 249/255.0, alpha: 1) 19 | public static let lightColor3 = UIColor(red: 173/255.0, green: 174/255.0, blue: 175/255.0, alpha: 1) 20 | public static let lightColor4 = UIColor(red: 206/255.0, green: 206/255.0, blue: 206/255.0, alpha: 1) 21 | 22 | public static let darkColor1 = UIColor.black 23 | public static let darkColor2 = UIColor(red: 39/255.0, green: 46/255.0, blue: 56/255.0, alpha: 1) 24 | public static let darkColor3 = UIColor.black 25 | public static let darkColor4 = UIColor(red: 34/255.0, green: 37/255.0, blue: 44/255.0, alpha: 1) 26 | 27 | public static let lightHighlightColor = UIColor.white 28 | public static let darkHighlightColor = UIColor(red: 86/255.0, green: 93/255.0, blue: 108/255.0, alpha: 1) 29 | 30 | 31 | public static let dotBlueColor = UIColor(red: 31/255.0, green: 206/255.0, blue: 252/255.0, alpha: 1) 32 | public static let dotRedColor = UIColor(red: 248/255.0, green: 16/255.0, blue: 32/255.0, alpha: 1) 33 | public static let dotOrangeColor = UIColor(red: 1, green: 128/255.0, blue: 0, alpha: 1) 34 | public static let dotGrayColor = lightColor4 35 | public static let dotShadowOffset = CGSize(width: 2, height: 2) 36 | 37 | public static let outerMultiplier : CGFloat = 0.86 38 | public static let middleMultiplier : CGFloat = 0.7 39 | public static let innerMultiplier : CGFloat = 0.54 40 | } 41 | 42 | @IBDesignable 43 | open class CircularSlider: UIControl { 44 | 45 | // MARK: - Public API 46 | 47 | @IBInspectable open var color1: UIColor { 48 | get { return renderer.knobView.color1 } 49 | set { renderer.knobView.color1 = newValue } 50 | } 51 | 52 | @IBInspectable open var color2: UIColor { 53 | get { return renderer.knobView.color2 } 54 | set { renderer.knobView.color2 = newValue} 55 | } 56 | 57 | @IBInspectable open var color3: UIColor { 58 | get { return renderer.knobView.color3 } 59 | set { renderer.knobView.color3 = newValue} 60 | } 61 | 62 | @IBInspectable open var color4: UIColor { 63 | get { return renderer.knobView.color4 } 64 | set { 65 | renderer.knobView.color4 = newValue 66 | renderer.pointerView.color1 = newValue 67 | } 68 | } 69 | 70 | @IBInspectable open var highlightColor: UIColor { 71 | get { return renderer.knobView.highlightColor } 72 | set { 73 | renderer.knobView.highlightColor = newValue 74 | renderer.maxiDotView.highlightColor = newValue 75 | renderer.miniDotView.highlightColor = newValue 76 | renderer.textField.layer.shadowColor = newValue.cgColor 77 | renderer.setTextShadow(color: newValue, opacity: 1, offset: CGSize(width: 0.5, height: 0.5), radius: 0) 78 | } 79 | } 80 | 81 | @IBInspectable open var knobOuterCircleMultiplier: CGFloat { 82 | get { return renderer.knobView.outerCircleMultiplier } 83 | set { 84 | renderer.knobView.outerCircleMultiplier = newValue 85 | renderer.miniDotView.outerCircleRadius = (bounds.width/2 * newValue) 86 | renderer.maxiDotView.outerCircleRadius = (bounds.width/2 * newValue) 87 | } 88 | } 89 | 90 | @IBInspectable open var knobMiddleCircleMultiplier: CGFloat { 91 | get { return renderer.knobView.middleCircleMultiplier } 92 | set { 93 | renderer.knobView.middleCircleMultiplier = newValue 94 | } 95 | } 96 | 97 | @IBInspectable open var knobInnerCircleMultiplier: CGFloat { 98 | get { return renderer.knobView.innerCircleMultiplier } 99 | set { renderer.knobView.innerCircleMultiplier = newValue } 100 | } 101 | 102 | @IBInspectable open var knobShadowOpacity: Float { 103 | get { return renderer.knobView.shadowOpacity } 104 | set { renderer.knobView.shadowOpacity = newValue } 105 | } 106 | 107 | @IBInspectable open var pointerDistanceFromInnerCircleEdge: CGFloat { 108 | get { return renderer.pointerViewDistanceFromEdge } 109 | set { renderer.pointerViewDistanceFromEdge = newValue } 110 | } 111 | 112 | @IBInspectable open var pointerSizeMultiplier: CGFloat { 113 | get { return renderer.pointerViewMultiplier } 114 | set { renderer.pointerViewMultiplier = newValue } 115 | } 116 | 117 | @IBInspectable open var pointerColor1: UIColor { 118 | get { return renderer.pointerView.color1 } 119 | set { renderer.pointerView.color1 = newValue } 120 | } 121 | 122 | @IBInspectable open var pointerColor2: UIColor { 123 | get { return renderer.pointerView.color2 } 124 | set { renderer.pointerView.color2 = newValue } 125 | } 126 | 127 | @IBInspectable open var textIsHidden: Bool { 128 | get { return renderer.textFieldIsHidden } 129 | set { renderer.textFieldIsHidden = newValue} 130 | } 131 | 132 | @IBInspectable open var textFontSizeMultiplier: CGFloat { 133 | get { return renderer.fontSizeMultiplier } 134 | set { renderer.fontSizeMultiplier = newValue} 135 | } 136 | 137 | @IBInspectable open var textColor: UIColor { 138 | get { return renderer.textField.textColor! } 139 | set { renderer.textField.textColor = newValue} 140 | } 141 | 142 | @IBInspectable open var maxidotViewIsHidden: Bool { 143 | get { return renderer.maxiDotView.isHidden } 144 | set { renderer.maxiDotView.isHidden = newValue } 145 | } 146 | 147 | @IBInspectable open var maxidotOffColor: UIColor { 148 | get { return renderer.maxiDotView.offColor } 149 | set { renderer.maxiDotView.offColor = newValue } 150 | } 151 | 152 | @IBInspectable open var maxidotOnColor: UIColor { 153 | get { return renderer.maxiDotView.onColor } 154 | set { 155 | renderer.maxiDotView.onColor = newValue 156 | renderer.knobView.onColor = newValue 157 | //renderer.pointerView.color1 = newValue 158 | } 159 | } 160 | 161 | @IBInspectable open var maxidotMaxColor: UIColor { 162 | get { return renderer.maxiDotView.maxColor } 163 | set { renderer.maxiDotView.maxColor = newValue } 164 | } 165 | 166 | @IBInspectable open var maxidotCount: Int { 167 | get { return renderer.maxiDotView.maxiDotCount } 168 | set { 169 | let value = newValue % 2 == 0 ? newValue + 1 : newValue 170 | renderer.maxiDotView.maxiDotCount = value 171 | renderer.maxiDotView.reload() 172 | renderer.miniDotView.maxiDotCount = value 173 | renderer.miniDotView.reload() 174 | } 175 | } 176 | 177 | @IBInspectable open var maxidotRadiusMultiplier: CGFloat { 178 | get { return renderer.maxiDotView.dotRadiusMultiplier } 179 | set { renderer.maxiDotView.dotRadiusMultiplier = newValue } 180 | } 181 | 182 | @IBInspectable open var maxidotInset: CGFloat { 183 | get { return renderer.maxiDotView.dotInset } 184 | set { renderer.maxiDotView.dotInset = newValue } 185 | } 186 | 187 | @IBInspectable open var maxidotMaxDotCount: Int { 188 | get { return renderer.maxiDotView.maxDotCount } 189 | set { renderer.maxiDotView.maxDotCount = newValue } 190 | } 191 | 192 | @IBInspectable open var minidotViewIsHidden: Bool { 193 | get { return renderer.miniDotView.isHidden } 194 | set { renderer.miniDotView.isHidden = newValue } 195 | } 196 | 197 | @IBInspectable open var minidotColor: UIColor { 198 | get { return renderer.miniDotView.offColor } 199 | set { renderer.miniDotView.offColor = newValue } 200 | } 201 | 202 | @IBInspectable open var minidotHighlightColor: UIColor { 203 | get { return renderer.miniDotView.highlightColor ?? .white } 204 | set { renderer.miniDotView.highlightColor = newValue } 205 | } 206 | 207 | @IBInspectable open var minidotCountPerSegment: Int { 208 | get { return renderer.miniDotView.dotCountPerSegment } 209 | set { 210 | renderer.miniDotView.dotCountPerSegment = newValue 211 | renderer.miniDotView.reload() 212 | } 213 | } 214 | 215 | @IBInspectable open var minidotRadiusMultiplier: CGFloat { 216 | get { return renderer.miniDotView.dotRadiusMultiplier } 217 | set { renderer.miniDotView.dotRadiusMultiplier = newValue } 218 | } 219 | 220 | @IBInspectable open var minidotInset: CGFloat { 221 | get { return renderer.miniDotView.dotInset } 222 | set { renderer.miniDotView.dotInset = newValue } 223 | } 224 | 225 | @IBInspectable open var minidotHideHighlight: Bool { 226 | get { return renderer.miniDotView.highlightColor != nil } 227 | set { renderer.miniDotView.highlightColor = newValue ? highlightColor : nil } 228 | } 229 | 230 | /** 231 | This value will be pinned to minimumValue/maximumValue 232 | The default value of this property is 0.0. 233 | */ 234 | @IBInspectable open var value: CGFloat { // always min <= value <= max 235 | get { return CGFloat(renderer.value) * (maximumValue - minimumValue) + minimumValue } 236 | set { 237 | guard maximumValue >= minimumValue else { 238 | fatalError("`maximumValue` should be greater then `minimumValue`.") 239 | } 240 | let rangedValue = min(maximumValue, max(minimumValue, newValue)) 241 | renderer.value = Float((rangedValue - minimumValue) / (maximumValue - minimumValue)) 242 | } 243 | } 244 | 245 | @IBInspectable open var minimumValue: CGFloat = 0 246 | 247 | @IBInspectable open var maximumValue: CGFloat = 100 248 | 249 | @IBInspectable open var startAngle: CGFloat { 250 | get { return renderer.startAngle.toDegree } 251 | set { renderer.startAngle = newValue.toRadian } 252 | } 253 | 254 | @IBInspectable open var endAngle: CGFloat { 255 | get { return renderer.endAngle.toDegree } 256 | set { renderer.endAngle = newValue.toRadian } 257 | } 258 | 259 | @IBInspectable open var isClockwise: Bool { 260 | get { return renderer.isClockwise } 261 | set { renderer.isClockwise = newValue } 262 | } 263 | 264 | @IBInspectable open var labelDecimalPlaces: Int = 0 265 | 266 | // MARK: - Private Properties 267 | 268 | lazy private var renderer = Renderer(with: self) 269 | private var lastTouchAngle: CGFloat = 0 270 | private var centerPoint: CGPoint { return CGPoint(x: bounds.midX, y: bounds.midY) } 271 | 272 | // MARK: - Functions 273 | 274 | override public init(frame: CGRect) { 275 | super.init(frame: frame) 276 | value = minimumValue 277 | } 278 | 279 | required public init?(coder aDecoder: NSCoder) { 280 | super.init(coder: aDecoder) 281 | value = minimumValue 282 | } 283 | 284 | override open func layoutSubviews() { 285 | super.layoutSubviews() 286 | renderer.updateUI(in: bounds) 287 | } 288 | 289 | // MARK: - Touches 290 | 291 | override open func touchesBegan(_ touches: Set, with event: UIEvent?) { 292 | super.touchesBegan(touches, with: event) 293 | guard let location = touches.first?.location(in: self) else { return } 294 | 295 | let distanceToOrigin = location - centerPoint 296 | lastTouchAngle = atan2(distanceToOrigin.y, distanceToOrigin.x).toDegree 297 | sendActions(for: .editingDidBegin) 298 | } 299 | 300 | override open func touchesMoved(_ touches: Set, with event: UIEvent?) { 301 | super.touchesMoved(touches, with: event) 302 | guard let location = touches.first?.location(in: self) else { return } 303 | 304 | let distanceToOrigin = location - centerPoint 305 | let currentTouchAngle = atan2(distanceToOrigin.y, distanceToOrigin.x).toDegree 306 | 307 | let angelDelta = currentTouchAngle - lastTouchAngle // in degree 308 | lastTouchAngle = currentTouchAngle 309 | 310 | let angleRange = angleDifferenceInDegree(from: startAngle, to: endAngle, isClockwise: isClockwise) 311 | 312 | let angelDeltaAsPercentage = Float(angelDelta / angleRange) 313 | guard abs(angelDeltaAsPercentage) < 1 else { return } 314 | let newValue = renderer.value + (isClockwise ? angelDeltaAsPercentage : -angelDeltaAsPercentage) 315 | renderer.value = max(0, min(newValue, 1)) 316 | 317 | } 318 | 319 | open override func touchesEnded(_ touches: Set, with event: UIEvent?) { 320 | super.touchesEnded(touches, with: event) 321 | sendActions(for: .editingDidEnd) 322 | } 323 | 324 | // MARK: - Public 325 | 326 | open func setLabelFont(named: String, textColor: UIColor, multiplier: CGFloat) { 327 | textFontSizeMultiplier = multiplier 328 | let textSize = bounds.height * multiplier 329 | renderer.setTextFont(named: named, textColor: textColor, textSize: textSize) 330 | } 331 | 332 | open func setLabelShadow(color: UIColor, opacity: Float = 1, offset: CGSize = CGSize(width: 1, height: 1), radius: CGFloat = 0) { 333 | renderer.setTextShadow(color: color, opacity: opacity, offset: offset, radius: radius) 334 | } 335 | 336 | open func setLabelText(_ text: String?) { 337 | renderer.textField.text = text 338 | } 339 | 340 | } 341 | 342 | class Renderer { 343 | 344 | // MARK: - Properties 345 | 346 | weak var circularSlider: CircularSlider? 347 | 348 | fileprivate let knobView = KnobView(frame: .zero) 349 | fileprivate let pointerView = PointerView(frame: .zero) 350 | fileprivate let textField = UITextField() 351 | fileprivate var miniDotView: DotView! 352 | fileprivate var maxiDotView: DotView! 353 | 354 | fileprivate var isClockwise: Bool = true { 355 | didSet { 356 | miniDotView.isClockwise = isClockwise 357 | maxiDotView.isClockwise = isClockwise 358 | } 359 | } 360 | fileprivate var textFieldIsHidden: Bool = false 361 | fileprivate var fontSizeMultiplier: CGFloat = 0.5 362 | 363 | fileprivate var pointerViewDistanceFromEdge: CGFloat = 10.0 364 | fileprivate var pointerViewMultiplier: CGFloat = 0.15 365 | 366 | fileprivate var startAngle: CGFloat = (.pi/4.0)*3.0 { 367 | didSet { 368 | miniDotView.startAngle = startAngle 369 | maxiDotView.startAngle = startAngle 370 | } 371 | } 372 | 373 | fileprivate var endAngle: CGFloat = .pi/4.0 { 374 | didSet { 375 | miniDotView.endAngle = endAngle 376 | maxiDotView.endAngle = endAngle 377 | } 378 | } 379 | 380 | fileprivate var value: Float = 0.0 { // 0 <= renderer.value <= 1 381 | didSet { 382 | // updates 383 | updateText() 384 | if let bounds = circularSlider?.bounds { 385 | updatePointerView(in: bounds) 386 | } 387 | maxiDotView.updateColors(using: value) 388 | 389 | circularSlider?.sendActions(for: .valueChanged) 390 | } 391 | } 392 | 393 | // MARK: - Init 394 | 395 | init(with view: CircularSlider) { 396 | self.circularSlider = view 397 | commonInit() 398 | } 399 | 400 | func updateUI(in bounds: CGRect) { 401 | updatePointerView(in: bounds) 402 | updateTextField(in: bounds) 403 | updateDotViews(in: bounds) 404 | } 405 | 406 | func setTextFont(named: String, textColor: UIColor, textSize: CGFloat) { 407 | textField.textColor = textColor 408 | textField.font = UIFont(name: named, size: textSize) ?? UIFont.systemFont(ofSize: textSize) 409 | } 410 | 411 | func setTextShadow(color: UIColor, opacity: Float = 1, offset: CGSize = CGSize(width: 1, height: 1), radius: CGFloat = 0) { 412 | textField.layer.setShadow(color: color, opacity: opacity, offset: offset, radius: radius) 413 | } 414 | } 415 | 416 | // MARK: - Private API 417 | 418 | private extension Renderer { 419 | 420 | func commonInit() { 421 | addKnobView() 422 | addDotViews() 423 | addPointerView() 424 | addTextField() 425 | } 426 | 427 | func addKnobView() { 428 | circularSlider?.addSubview(knobView) 429 | knobView.translatesAutoresizingMaskIntoConstraints = false 430 | let views = ["view": knobView] 431 | let verticalConstraint = NSLayoutConstraint.constraints(withVisualFormat: "V:|[view]|", options: .init(rawValue: 0), metrics: nil, views: views) 432 | let horizontalConstraint = NSLayoutConstraint.constraints(withVisualFormat: "H:|[view]|", options: .init(rawValue: 0), metrics: nil, views: views) 433 | circularSlider?.addConstraints(verticalConstraint + horizontalConstraint) 434 | } 435 | 436 | func addPointerView() { 437 | circularSlider?.addSubview(pointerView) 438 | } 439 | 440 | func addInputAccessoryView() { 441 | let width = UIScreen.main.bounds.width 442 | let toolBar = UIToolbar(frame: CGRect(origin: .zero, size: CGSize(width: width, height: 48))) 443 | toolBar.barStyle = .blackTranslucent 444 | let flexibleSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil) 445 | let done = UIBarButtonItem(title: "Done", style: .done, target: self, action: #selector(keyboardDoneButtonTapped)) 446 | done.tintColor = .lightGray 447 | toolBar.items = [done, flexibleSpace] 448 | toolBar.sizeToFit() 449 | textField.inputAccessoryView = toolBar 450 | } 451 | 452 | func addTextField() { 453 | textField.backgroundColor = .clear 454 | textField.layer.cornerRadius = 3 455 | textField.textAlignment = .center 456 | textField.text = "" 457 | textField.keyboardType = .numbersAndPunctuation 458 | textField.keyboardAppearance = .dark 459 | textField.clearsOnInsertion = true 460 | textField.adjustsFontSizeToFitWidth = true 461 | if let height = circularSlider?.bounds.height { 462 | setTextFont(named: Constants.fontName, textColor: Constants.lightTextColor, textSize: height * fontSizeMultiplier) 463 | } 464 | setTextShadow(color: .white) 465 | 466 | addInputAccessoryView() 467 | circularSlider?.addSubview(textField) 468 | } 469 | 470 | func addDotViews() { 471 | miniDotView = DotView(type: .mini, startAngle: startAngle, endAngle: endAngle, isClockwise: isClockwise) 472 | circularSlider?.addSubview(miniDotView) 473 | 474 | maxiDotView = DotView(type: .maxi, startAngle: startAngle, endAngle: endAngle, isClockwise: isClockwise) 475 | circularSlider?.addSubview(maxiDotView) 476 | } 477 | 478 | @objc func keyboardDoneButtonTapped() { 479 | textField.endEditing(true) 480 | guard let text = textField.text, let newValue = Int(text) else { 481 | updateText() 482 | return 483 | } 484 | circularSlider?.value = CGFloat(newValue) 485 | circularSlider?.sendActions(for: .editingDidEnd) 486 | 487 | //maxiDotView.setNeedsLayout() 488 | } 489 | 490 | // MARK: - Updates 491 | 492 | func updateDotViews(in bounds: CGRect) { 493 | let dotViewFrame = CGRect(origin: CGPoint(x: bounds.midX, y: bounds.midY), size: bounds.size) 494 | miniDotView.frame = dotViewFrame 495 | maxiDotView.frame = dotViewFrame 496 | let outerCircleRadius = bounds.width/2 * knobView.outerCircleMultiplier 497 | miniDotView.outerCircleRadius = outerCircleRadius 498 | maxiDotView.outerCircleRadius = outerCircleRadius 499 | } 500 | 501 | func updateTextField(in bounds: CGRect) { 502 | 503 | let multiplier: CGFloat = max(0.1, min(0.5, fontSizeMultiplier/2)) 504 | 505 | let width = (bounds.width * knobView.innerCircleMultiplier) * 0.8 506 | let height = (bounds.height * knobView.innerCircleMultiplier) * multiplier 507 | let x = (bounds.width - width)/2 508 | let y = (bounds.height - height)/2 509 | textField.frame = CGRect(x: x, y: y, width: width, height: height) 510 | 511 | let name = textField.font?.fontName ?? Constants.fontName 512 | textField.font = UIFont(name: name, size: textField.frame.height) 513 | 514 | textField.isHidden = textFieldIsHidden 515 | } 516 | 517 | func updateText() { 518 | guard let circularSlider = circularSlider else { return } 519 | 520 | let minimum = Float(circularSlider.minimumValue) 521 | let maximum = Float(circularSlider.maximumValue) 522 | let _value = Float(circularSlider.value) 523 | 524 | var decimalPlaces = circularSlider.labelDecimalPlaces 525 | if value != 0 && _value.rounded(.towardZero) == 0 && decimalPlaces == 0 { 526 | decimalPlaces = 2 527 | } 528 | 529 | let newValue = _value.roundedDown(toPlaces: decimalPlaces) 530 | 531 | switch newValue { 532 | case minimum: textField.text = "MIN" 533 | case maximum: textField.text = "MAX" 534 | default: textField.text = String(format: "%.\(decimalPlaces)f", newValue) 535 | } 536 | } 537 | 538 | func updatePointerView(in bounds: CGRect) { 539 | 540 | let angleRange = angleDifferenceInDegree(from: startAngle.toDegree, to: endAngle.toDegree, isClockwise: isClockwise) 541 | let angle = isClockwise ? startAngle.toDegree + (angleRange * CGFloat(value)) : startAngle.toDegree - (angleRange * CGFloat(value)) 542 | 543 | let radius = (bounds.width * knobView.innerCircleMultiplier)/2 544 | let width = radius * pointerViewMultiplier 545 | 546 | let adjustX = bounds.midX - width/2 547 | let adjustY = bounds.midY - width/2 548 | 549 | let x = cos(angle.toRadian) * (radius - pointerViewDistanceFromEdge - width/2) + adjustX 550 | let y = sin(angle.toRadian) * (radius - pointerViewDistanceFromEdge - width/2) + adjustY 551 | 552 | pointerView.frame = CGRect(x: x, y: y, width: width, height: width) 553 | 554 | } 555 | 556 | } 557 | -------------------------------------------------------------------------------- /JOCircularSlider/Classes/DotLayer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DotLayer.swift 3 | // JOCircularSlider 4 | // 5 | // Created by Jalal Ouraigua on 04/12/2018. 6 | // Copyright © 2018 Jalal Ouraigua. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class DotLayer: CALayer { 12 | 13 | 14 | var color = Constants.dotGrayColor { 15 | didSet { 16 | gradientLayer.colors = [shadowColor ?? color.cgColor, color.cgColor] 17 | frontLayer.fillColor = color.cgColor 18 | } 19 | } 20 | var shadowMultiplier: CGFloat = 0.1 21 | 22 | 23 | override var shadowColor: CGColor? { 24 | get { return gradientLayer.colors?.first as! CGColor? } 25 | set { 26 | gradientLayer.colors = [newValue ?? color.cgColor, color.cgColor] 27 | } 28 | } 29 | 30 | var highlightColor: UIColor? = .white 31 | 32 | private let backLayer = CAShapeLayer() 33 | private let frontLayer = CAShapeLayer() 34 | private let gradientLayer = CAGradientLayer() 35 | private let maskLayer = CAShapeLayer() 36 | 37 | init(color: UIColor, 38 | shadowColor: UIColor? = UIColor.darkGray.withAlphaComponent(0.5), 39 | shadowMultiplier: CGFloat) { 40 | 41 | self.color = color 42 | self.shadowMultiplier = shadowMultiplier 43 | 44 | super.init() 45 | needsDisplayOnBoundsChange = true 46 | setupSublayers() 47 | self.shadowColor = shadowColor?.cgColor 48 | } 49 | 50 | override init(layer: Any) { 51 | super.init(layer: layer) 52 | setupSublayers() 53 | } 54 | 55 | required init?(coder aDecoder: NSCoder) { 56 | super.init(coder: aDecoder) 57 | setupSublayers() 58 | } 59 | 60 | private func setupSublayers() { 61 | 62 | backLayer.fillColor = color.cgColor 63 | frontLayer.fillColor = color.cgColor 64 | 65 | maskLayer.fillColor = nil 66 | maskLayer.strokeColor = color.cgColor 67 | 68 | gradientLayer.startPoint = CGPoint(x: 0, y: 0) 69 | gradientLayer.endPoint = CGPoint(x: 0.5, y: 0.5) 70 | gradientLayer.locations = [0, 1] 71 | 72 | addSublayer(backLayer) 73 | addSublayer(frontLayer) 74 | addSublayer(maskLayer) 75 | addSublayer(gradientLayer) 76 | 77 | gradientLayer.mask = maskLayer 78 | } 79 | 80 | override func layoutSublayers() { 81 | super.layoutSublayers() 82 | 83 | let path = UIBezierPath(ovalIn: bounds).cgPath 84 | let offset = CGSize(width: bounds.width * shadowMultiplier, height: bounds.height * shadowMultiplier) 85 | 86 | backLayer.path = path 87 | //backLayer.setShadow(color: highlightColor, opacity: 1, offset: CGSize(width: offset.width/2, height: offset.height), radius: 0) 88 | backLayer.setShadow(color: highlightColor, opacity: 1, offset: CGSize(width: offset.width, height: offset.height), radius: 0) 89 | 90 | frontLayer.path = path 91 | 92 | maskLayer.lineWidth = offset.width 93 | maskLayer.path = UIBezierPath(ovalIn: bounds.insetBy(dx: offset.width/2, dy: offset.height/2)).cgPath 94 | 95 | 96 | gradientLayer.frame = bounds 97 | 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /JOCircularSlider/Classes/DotView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DotView.swift 3 | // JOCircularSlider 4 | // 5 | // Created by Jalal Ouraigua on 04/12/2018. 6 | // Copyright © 2018 Jalal Ouraigua. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class DotView: UIView { 12 | 13 | enum DotType { 14 | case mini 15 | case maxi 16 | } 17 | 18 | // MARK: - Properties 19 | 20 | var type: DotType = .maxi 21 | var isClockwise = true { didSet { reload() }} 22 | var startAngle: CGFloat = (.pi/4.0)*3.0 23 | var endAngle: CGFloat = .pi/4.0 24 | var dotCountPerSegment: Int = 6 25 | var outerCircleRadius: CGFloat? { didSet { reload() }} 26 | 27 | lazy var maxDotCount: Int = { 28 | return Int(Float(maxiDotCount) / 5.0) + (maxiDotCount % 5 == 0 ? 0 : 1) 29 | }() 30 | 31 | lazy var dotInset: CGFloat = { 32 | return type == .mini ? 10.0 : 15.0 33 | }() 34 | 35 | lazy var maxiDotCount: Int = { 36 | return Int(angleRange / (.pi*2.0 / 15.0)) 37 | }() 38 | 39 | lazy var dotRadiusMultiplier: CGFloat = type == .mini ? 0.22 : 0.09 40 | 41 | // Colors 42 | 43 | var offColor: UIColor = Constants.dotGrayColor { 44 | didSet { reload() } 45 | } 46 | 47 | var onColor: UIColor = Constants.dotBlueColor { 48 | didSet { reload() } 49 | } 50 | 51 | var maxColor: UIColor = Constants.dotRedColor { 52 | didSet { reload() } 53 | } 54 | 55 | var highlightColor: UIColor? = .white { 56 | didSet { reload() } 57 | } 58 | 59 | private var currentIndex: Int = 0 60 | private var value: Float = 0 61 | 62 | // MARK: - Init 63 | 64 | init(type: DotType, startAngle: CGFloat, endAngle: CGFloat, isClockwise: Bool) { 65 | self.type = type 66 | self.startAngle = startAngle 67 | self.endAngle = endAngle 68 | self.isClockwise = isClockwise 69 | 70 | super.init(frame: .zero) 71 | commonInit() 72 | } 73 | 74 | required init?(coder aDecoder: NSCoder) { 75 | super.init(coder: aDecoder) 76 | commonInit() 77 | } 78 | 79 | override func layoutSubviews() { 80 | super.layoutSubviews() 81 | guard let sublayers = layer.sublayers else { return } 82 | 83 | let radius = outerCircleRadius == nil ? (bounds.width/2) - dotRadius - dotInset : outerCircleRadius! + dotRadius + dotInset 84 | 85 | for i in 0..= dotCount - maxDotCount else { dotLayer.color = onColor; continue } 119 | let newHue = hue > 0.5 ? hue + (j * ((1.0 - hue)/CGFloat(maxDotCount-1))) : hue - (j * (hue/CGFloat(maxDotCount-1))) 120 | dotLayer.color = UIColor(hue: newHue , saturation: saturation, brightness: brightness, alpha: 1) 121 | j += 1.0 122 | } 123 | } 124 | } 125 | 126 | // MARK: Private API 127 | 128 | private extension DotView { 129 | 130 | var dotCount: Int { 131 | switch type { 132 | case .mini: return (maxiDotCount - 1) * (dotCountPerSegment) + 1 133 | case .maxi: return maxiDotCount 134 | } 135 | } 136 | 137 | var dotRadius: CGFloat { 138 | let opposite = sin(unitAngle) * (bounds.width/2) 139 | return opposite/2 * dotRadiusMultiplier 140 | } 141 | 142 | var angleRange: CGFloat { 143 | return angleDifferenceInDegree(from: startAngle.toDegree, to: endAngle.toDegree, isClockwise: isClockwise).toRadian 144 | } 145 | 146 | var unitAngle: CGFloat { 147 | switch type { 148 | case .mini: return (angleRange / CGFloat(maxiDotCount - 1)) / CGFloat(dotCountPerSegment) 149 | case .maxi: return angleRange / CGFloat(dotCount - 1) 150 | } 151 | } 152 | 153 | func commonInit() { 154 | for _ in 0.. CGFloat { 12 | if isClockwise { 13 | return start >= end ? 360 - (start - end) : end - start 14 | } else { 15 | return start >= end ? start - end : 360 - (end - start) 16 | } 17 | } 18 | 19 | extension FloatingPoint { 20 | 21 | public var toRadian: Self { return self * .pi / 180 } 22 | 23 | public var toDegree: Self { 24 | let degree = self * 180 / .pi 25 | return degree >= 0 ? degree : 360 + degree 26 | } 27 | 28 | public func roundedDown(toPlaces places: Int) -> Self { 29 | let rounded = self.rounded(.down) 30 | let power = Self(Int(powf(10, Float(places)))) 31 | let decimal = ((self - rounded) * power).rounded(.down) 32 | return rounded + (decimal / power) 33 | } 34 | } 35 | 36 | extension CGPoint { 37 | 38 | static func + (lhs: CGPoint, rhs: CGPoint) -> CGPoint { 39 | return CGPoint(x: lhs.x + rhs.y, 40 | y: lhs.y + rhs.y) 41 | } 42 | 43 | static func - (lhs: CGPoint, rhs: CGPoint) -> CGPoint { 44 | return CGPoint(x: lhs.x - rhs.y, 45 | y: lhs.y - rhs.y) 46 | } 47 | } 48 | 49 | extension CALayer { 50 | 51 | func setShadow(color: UIColor?, opacity: Float = 1, offset: CGSize = CGSize(width: 1, height: 1), radius: CGFloat = 0) { 52 | self.shadowColor = color?.cgColor 53 | self.shadowOpacity = opacity 54 | self.shadowOffset = offset 55 | self.shadowRadius = radius 56 | } 57 | 58 | func circlePath(with multiplier: CGFloat) -> UIBezierPath { 59 | let multiplier = (1 - max(0, min(multiplier, 1))) / 2.0 60 | return UIBezierPath(ovalIn: bounds.insetBy(dx: bounds.width * multiplier, dy: bounds.height * multiplier)) 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /JOCircularSlider/Classes/KnobView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KnobView.swift 3 | // JOCircularSlider 4 | // 5 | // Created by Jalal Ouraigua on 04/12/2018. 6 | // Copyright © 2018 Jalal Ouraigua. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class KnobView: UIView { 12 | 13 | // MARK: - Public Properties 14 | 15 | var color1: UIColor = Constants.lightColor1 { 16 | didSet { 17 | outerCircleStroke.colors[0] = color1 18 | outerCircle.colors[0] = color1 19 | } 20 | } 21 | var color2: UIColor = Constants.lightColor2 { 22 | didSet { 23 | outerCircle.colors[1] = color2 24 | middleCircle.colors[0] = color2 25 | innerCircle.colors[0] = color2 26 | } 27 | } 28 | var color3: UIColor = Constants.lightColor3 { 29 | didSet { middleCircle.colors[1] = color3 } 30 | } 31 | var color4: UIColor = Constants.lightColor4 { 32 | didSet { innerCircle.colors[1] = color4 } 33 | } 34 | 35 | var highlightColor: UIColor = .white { 36 | didSet { 37 | outerCircleStroke.colors[1] = highlightColor 38 | } 39 | } 40 | 41 | var onColor: UIColor = Constants.dotBlueColor { 42 | didSet { 43 | glowCircleLayer.colors = [onColor, onColor.withAlphaComponent(0.7)] 44 | } 45 | } 46 | 47 | 48 | 49 | var shadowOpacity: Float = 0.4 { 50 | didSet { 51 | middleCircleShadow.shadowOpacity = shadowOpacity 52 | } 53 | } 54 | 55 | var outerCircleMultiplier: CGFloat = Constants.outerMultiplier { 56 | didSet { 57 | guard innerCircleMultiplier < middleCircleMultiplier && middleCircleMultiplier < outerCircleMultiplier else { 58 | fatalError("Values should be: innerCircleMultiplier < middleCircleMultiplier < outerCircleMultiplier.") 59 | } 60 | outerCircleStroke.multiplier = outerCircleMultiplier 61 | outerCircle.multiplier = outerCircleMultiplier 62 | } 63 | } 64 | var middleCircleMultiplier: CGFloat = Constants.middleMultiplier { 65 | didSet { 66 | guard innerCircleMultiplier < middleCircleMultiplier && middleCircleMultiplier < outerCircleMultiplier else { 67 | fatalError("Values should be: innerCircleMultiplier < middleCircleMultiplier < outerCircleMultiplier.") 68 | } 69 | middleCircle.multiplier = middleCircleMultiplier 70 | glowCircleLayer.multiplier = middleCircleMultiplier 71 | middleCircleShadow.path = layer.circlePath(with: middleCircleMultiplier).cgPath 72 | } 73 | } 74 | var innerCircleMultiplier: CGFloat = Constants.innerMultiplier { 75 | didSet { 76 | guard innerCircleMultiplier < middleCircleMultiplier && middleCircleMultiplier < outerCircleMultiplier else { 77 | fatalError("Values should be: innerCircleMultiplier < middleCircleMultiplier < outerCircleMultiplier.") 78 | } 79 | innerCircle.multiplier = innerCircleMultiplier 80 | } 81 | } 82 | 83 | // MARK: - Private Properties 84 | 85 | private let backgroundLayer: CircularLayer = { 86 | let layer = CircularLayer(colors: [.black, .clear], maskType: .fill) 87 | layer.gradientType = .radial 88 | layer.locations = [0, 0.45] 89 | layer.opacity = 0.5 90 | return layer 91 | }() 92 | 93 | lazy private var outerCircleStroke: CircularLayer = { 94 | let layer = CircularLayer(colors: [color1, highlightColor], maskType: .stroke(width: 1.2)) 95 | layer.locations = [0.0, 0.4] 96 | layer.multiplier = outerCircleMultiplier 97 | return layer 98 | }() 99 | 100 | lazy private var outerCircle: CircularLayer = { 101 | let layer = CircularLayer(colors: [color1, color2], maskType: .fill) 102 | layer.multiplier = outerCircleMultiplier 103 | return layer 104 | }() 105 | 106 | lazy private var glowCircleLayer: CircularLayer = { 107 | let layer = CircularLayer(colors: [onColor, onColor], maskType: .stroke(width: 5)) 108 | layer.multiplier = middleCircleMultiplier 109 | return layer 110 | }() 111 | 112 | lazy private var middleCircleShadow: CAShapeLayer = { 113 | let layer = CAShapeLayer() 114 | layer.setShadow(color: .black, opacity: shadowOpacity, offset: CGSize(width: 2, height: 11), radius: 6) 115 | layer.fillColor = Constants.lightColor3.cgColor 116 | return layer 117 | }() 118 | 119 | lazy private var middleCircle: CircularLayer = { 120 | let layer = CircularLayer(colors: [color2, color3], maskType: .fill) 121 | layer.multiplier = middleCircleMultiplier 122 | return layer 123 | }() 124 | 125 | lazy private var innerCircle: CircularLayer = { 126 | let layer = CircularLayer(colors: [color2, color4], maskType: .fill) 127 | layer.gradientType = .linear(direction: .topLeftToBottomRight) 128 | layer.multiplier = innerCircleMultiplier 129 | return layer 130 | }() 131 | 132 | // MARK: - Init 133 | 134 | override init(frame: CGRect) { 135 | super.init(frame: frame) 136 | commonInit() 137 | } 138 | 139 | required init?(coder aDecoder: NSCoder) { 140 | super.init(coder: aDecoder) 141 | commonInit() 142 | } 143 | 144 | override func layoutSubviews() { 145 | super.layoutSubviews() 146 | 147 | backgroundLayer.frame = bounds 148 | outerCircleStroke.frame = bounds 149 | outerCircle.frame = bounds 150 | middleCircle.frame = bounds 151 | innerCircle.frame = bounds 152 | 153 | middleCircleShadow.path = layer.circlePath(with: middleCircleMultiplier).cgPath 154 | glowCircleLayer.frame = bounds 155 | 156 | } 157 | 158 | private func commonInit() { 159 | backgroundColor = .clear 160 | 161 | layer.addSublayer(backgroundLayer) 162 | layer.insertSublayer(outerCircleStroke, above: backgroundLayer) 163 | layer.insertSublayer(outerCircle, above: outerCircleStroke) 164 | 165 | layer.insertSublayer(glowCircleLayer, above: outerCircle) 166 | layer.insertSublayer(middleCircleShadow, above: glowCircleLayer) 167 | layer.insertSublayer(middleCircle, above: middleCircleShadow) 168 | 169 | layer.insertSublayer(innerCircle, above: middleCircle) 170 | } 171 | 172 | } 173 | -------------------------------------------------------------------------------- /JOCircularSlider/Classes/PointerView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PointerView.swift 3 | // JOCircularSlider 4 | // 5 | // Created by Jalal Ouraigua on 04/12/2018. 6 | // Copyright © 2018 Jalal Ouraigua. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class PointerView: UIView { 12 | 13 | // MARK: Public Properties 14 | 15 | var color1: UIColor = Constants.lightColor4 { 16 | didSet { setNeedsDisplay() } 17 | } 18 | 19 | var color2: UIColor = .white { 20 | didSet { setNeedsDisplay() } 21 | } 22 | 23 | 24 | // MARK: - Private Properties 25 | 26 | private var cgColors: [CGColor] { return [color1.cgColor, color2.cgColor] } 27 | 28 | // MARK: - 29 | 30 | override func draw(_ rect: CGRect) { 31 | 32 | let path = UIBezierPath(ovalIn: rect) 33 | path.addClip() 34 | 35 | let colorSpace = CGColorSpaceCreateDeviceRGB() 36 | guard let gradient = CGGradient(colorsSpace: colorSpace, colors: cgColors as CFArray, locations: [0, 1]) else { return } 37 | 38 | let context = UIGraphicsGetCurrentContext()! 39 | context.drawLinearGradient(gradient, start: .zero, end: CGPoint(x: 0, y: rect.height), options: []) 40 | } 41 | 42 | override func layoutSubviews() { 43 | super.layoutSubviews() 44 | backgroundColor = .clear 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 Jalal Ouraigua 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](https://raw.githubusercontent.com/ouraigua/JOCircularSlider/master/Screenshots/banner.gif) 2 | 3 | [![Version](https://img.shields.io/cocoapods/v/JOCircularSlider.svg?style=flat)](https://cocoapods.org/pods/JOCircularSlider) 4 | [![Platform](https://img.shields.io/cocoapods/p/JOCircularSlider.svg?style=flat)](https://cocoapods.org/pods/JOCircularSlider) 5 | [![Language](https://img.shields.io/badge/language-Swift-orange.svg?style=flat)]() 6 | [![License](https://img.shields.io/cocoapods/l/JOCircularSlider.svg?style=flat)](https://cocoapods.org/pods/JOCircularSlider) 7 | [![Twitter: @ouraigua](https://img.shields.io/badge/twitter-@ouraigua-blue.svg?style=flat)](https://twitter.com/ouraigua) 8 | [![Readme Score](http://readme-score-api.herokuapp.com/score.svg?url=https://github.com/ouraigua/jocircularslider)](http://clayallsopp.github.io/readme-score?url=https://github.com/ouraigua/jocircularslider) 9 | [![codebeat badge](https://codebeat.co/badges/c4db03f5-903a-4b0e-84bb-98362fc5bd7a)](https://codebeat.co/projects/github-com-ouraigua-jocircularslider-master) 10 | 11 | # JOCircularSlider 12 | 13 | JOCircularSlider is a highly customisable and reusable iOS circular slider that mimics the behaviour of a knob control. 14 | It uses no preset images and every one of its components is drawn completely in code making it extremely adaptable to every design and theme. 15 | 16 | ## Example 17 | 18 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 19 | 20 | ![](https://raw.githubusercontent.com/ouraigua/JOCircularSlider/master/Screenshots/shot1.gif) 21 | ![](https://raw.githubusercontent.com/ouraigua/JOCircularSlider/master/Screenshots/shot2.gif) 22 | ![](https://raw.githubusercontent.com/ouraigua/JOCircularSlider/master/Screenshots/shot3.gif) 23 | 24 | ## Requirements 25 | 26 | - iOS 10.0+ 27 | - Xcode 10.0 28 | 29 | ## Installation 30 | 31 | JOCircularSlider is available through [CocoaPods](https://cocoapods.org). To install 32 | it, simply add the following line to your Podfile: 33 | 34 | ```ruby 35 | pod 'JOCircularSlider' 36 | ``` 37 | 38 | JOCircularSlider is also available through [Carthage](https://github.com/Carthage/Carthage). To install it, simply add the following line to your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile): 39 | 40 | ``` ruby 41 | github "ouraigua/JOCircularSlider" 42 | ``` 43 | 44 | ## Usage 45 | 1. Visually: 46 | 47 | Drag a UIView to your storyboard, change its class of to CircularSlider and start visually customising the design to your liking. 48 | All the parameters are IBInspectable, so you can configure the slider straight from the attribute inspector tab, without having to write a single line of code. 49 | 50 | ![](https://raw.githubusercontent.com/ouraigua/JOCircularSlider/master/Screenshots/shot4.gif) 51 | 52 | 2. Programatically: 53 | 54 | ```swift 55 | import JOCircularSlider 56 | 57 | let circularSlider = CircularSlider(frame: aFrame) 58 | circularSlider.startAngle = 230 59 | circularSlider.endAngle = 310 60 | circularSlider.minimumValue = 0 61 | circularSlider.maximumValue = 60 62 | circularSlider.isClockwise = false 63 | ``` 64 | These are just few of the many params you can configure for the slider. 65 | 66 | The slider's min/max values are IBInspectable and default to 0.0 and 100.0 respectively. 67 | They also support negative and positive values or a mixture of them. 68 | 69 | ```swift 70 | @IBInspectable open var minimumValue: CGFloat = 0 71 | @IBInspectable open var maximumValue: CGFloat = 100 72 | ``` 73 | 74 | The slider's `value` property is both { get set } and it is designed to work similarly to the familiar value property of UIKit's generic UISlider. 75 | 76 | ```swift 77 | /** 78 | This value will be pinned to minimumValue/maximumValue 79 | The default value of this property is 0.0. 80 | */ 81 | @IBInspectable open var value: CGFloat // { get set } 82 | 83 | ``` 84 | 85 | In order to get value change notifications, use the `Target-Action` pattern which is an inherent part of UIControl, like so: 86 | ``` swift 87 | /** 88 | Add target/action for particular event. 89 | - parameter target: The object whose action method is called 90 | - parameter action: A selector identifying the action method to be called 91 | - parameter Event: The control-specific events for which the action method is called 92 | So far I've only implemented the following: 93 | 94 | UIControl.Event.valueChanged 95 | UIControl.Event.editingDidBegin 96 | UIControl.Event.editingDidEnd 97 | */ 98 | circularSlider.addTarget(target: Any?, action: Selector, for: UIControl.Event) 99 | 100 | ``` 101 | 102 | To Control the appearance of the label displaying the value, use these: 103 | ```swift 104 | open func setLabelFont(named: String, textColor: UIColor, multiplier: CGFloat) 105 | open func setLabelShadow(color: UIColor, opacity: Float = 1, offset: CGSize = CGSize(width: 1, height: 1), radius: CGFloat = 0) 106 | ``` 107 | 108 | You can also specify the number of decimal places this label should show. 109 | The default is 0.0 unless for example the value is within [0.0, 1.0] 110 | ```swift 111 | @IBInspectable open var labelDecimalPlaces: Int = 0 112 | ``` 113 | If you need to override the text in the label, then just implement the following function inside the selector of the `Target-Action` 114 | method for the event `UIControl.Event.valueChanged` 115 | 116 | ```swift 117 | open func setLabelText(_ text: String?) 118 | ``` 119 | 120 | ## References 121 | 122 | The project is Inspired by: 123 | - [How To Make a Custom Control Tutorial: A Reusable Knob](https://www.raywenderlich.com/5294-how-to-make-a-custom-control-tutorial-a-reusable-knob) 124 | - [HGCircularSlider](https://github.com/HamzaGhazouani/HGCircularSlider) 125 | 126 | ## Author 127 | 128 | Jalal Ouraigua, ouraigua@icloud.com 129 | 130 | ## License 131 | 132 | JOCircularSlider is available under the MIT license. See the LICENSE file for more info. 133 | -------------------------------------------------------------------------------- /Screenshots/banner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouraigua-zz/JOCircularSlider/c3cf5527fd10347f5c8fcfcc625c08b692c1916d/Screenshots/banner.gif -------------------------------------------------------------------------------- /Screenshots/shot1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouraigua-zz/JOCircularSlider/c3cf5527fd10347f5c8fcfcc625c08b692c1916d/Screenshots/shot1.gif -------------------------------------------------------------------------------- /Screenshots/shot2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouraigua-zz/JOCircularSlider/c3cf5527fd10347f5c8fcfcc625c08b692c1916d/Screenshots/shot2.gif -------------------------------------------------------------------------------- /Screenshots/shot3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouraigua-zz/JOCircularSlider/c3cf5527fd10347f5c8fcfcc625c08b692c1916d/Screenshots/shot3.gif -------------------------------------------------------------------------------- /Screenshots/shot4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouraigua-zz/JOCircularSlider/c3cf5527fd10347f5c8fcfcc625c08b692c1916d/Screenshots/shot4.gif -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------