├── .gitignore ├── .travis.yml ├── Example ├── Podfile ├── Podfile.lock ├── Tests │ ├── Info.plist │ └── Tests.swift ├── Yashin.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ ├── Yashin-Example.xcscheme │ │ └── Yashin_Tests.xcscheme ├── Yashin.xcworkspace │ └── contents.xcworkspacedata └── Yashin │ ├── AppDelegate.swift │ ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard │ ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ └── ViewController.swift ├── LICENSE ├── Pod ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ └── Yashin.swift ├── README.md ├── Yashin.podspec ├── _Pods.xcodeproj └── screenshots ├── 1.png ├── 2.png └── 3.png /.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 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | # Pods/ 34 | 35 | # Pods 36 | Example/Pods/* 37 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | os: osx 3 | podfile: Example/Podfile 4 | osx_image: xcode7 5 | 6 | before_script: 7 | - gem install xcpretty 8 | - gem install cocoapods -N 9 | 10 | script: 11 | - xcodebuild -workspace Example/Yashin.xcworkspace -scheme Yashin_Tests -destination 'platform=iOS Simulator,name=iPhone 6s Plus' test 12 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | use_frameworks! 3 | platform :ios,'9.0' 4 | 5 | target 'Yashin_Example', :exclusive => true do 6 | pod "Yashin", :path => "../" 7 | end 8 | 9 | target 'Yashin_Tests', :exclusive => true do 10 | pod "Yashin", :path => "../" 11 | 12 | 13 | end 14 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Yashin (0.3.1) 3 | 4 | DEPENDENCIES: 5 | - Yashin (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | Yashin: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | Yashin: 954aa2e5594b745b8da3ca3ed008361b62476248 13 | 14 | COCOAPODS: 0.39.0 15 | -------------------------------------------------------------------------------- /Example/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.cocoapods.$(PRODUCT_NAME:rfc1034identifier) 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 UIKit 2 | import XCTest 3 | import Yashin 4 | 5 | class Tests: XCTestCase { 6 | 7 | var radarChart = Yashin() 8 | 9 | override func setUp() { 10 | super.setUp() 11 | } 12 | 13 | override func tearDown() { 14 | super.tearDown() 15 | } 16 | 17 | func testValidateMinAndMax() { 18 | 19 | radarChart.set( 20 | ["aaa", "bbb", "ccc",], 21 | [ 22 | ([4, 5, 8], UIColor.greenColor().colorWithAlphaComponent(0.40)), 23 | ([10, 3, 6], UIColor.darkGrayColor().colorWithAlphaComponent(0.40)) 24 | ] 25 | ) 26 | 27 | XCTAssert(radarChart.validateMinAndMax() == true, "when default minValue and maxValue") 28 | 29 | radarChart.minValue = 10 30 | radarChart.maxValue = 0 31 | 32 | XCTAssert(radarChart.validateMinAndMax() == false, "when minValue is more than maxValue") 33 | 34 | radarChart.maxValue = 10 35 | 36 | XCTAssert(radarChart.validateMinAndMax() == false, "when minValue equals maxValue") 37 | 38 | radarChart.maxValue = 100 39 | 40 | XCTAssert(radarChart.validateMinAndMax() == true, "when minValue is less than maxValue") 41 | } 42 | 43 | func testValidateKeyCount() { 44 | 45 | radarChart.set( 46 | ["aaa", "bbb"], 47 | [ 48 | ([4, 5], UIColor.greenColor().colorWithAlphaComponent(0.40)), 49 | ([10, 3], UIColor.darkGrayColor().colorWithAlphaComponent(0.40)) 50 | ] 51 | ) 52 | 53 | XCTAssert(radarChart.validateKeyCount() == false, "when key count is less than 3") 54 | 55 | radarChart.set( 56 | ["aaa", "bbb", "ccc"], 57 | [ 58 | ([4, 5, 8], UIColor.greenColor().colorWithAlphaComponent(0.40)), 59 | ([10, 3, 6], UIColor.darkGrayColor().colorWithAlphaComponent(0.40)) 60 | ] 61 | ) 62 | 63 | XCTAssert(radarChart.validateMinAndMax() == true, "when key count is more than 2") 64 | } 65 | 66 | func testValidateIntegrityKeyAndValue() { 67 | 68 | radarChart.set( 69 | ["aaa", "bbb", "ccc"], 70 | [ 71 | ([4, 5], UIColor.greenColor().colorWithAlphaComponent(0.40)) 72 | ] 73 | ) 74 | 75 | XCTAssert(radarChart.validateIntegrityKeyAndValue() == false, "when key and value integrity is wrong (single data) [1]") 76 | 77 | radarChart.set( 78 | ["aaa", "bbb"], 79 | [ 80 | ([4, 5, 8], UIColor.greenColor().colorWithAlphaComponent(0.40)) 81 | ] 82 | ) 83 | 84 | XCTAssert(radarChart.validateIntegrityKeyAndValue() == false, "when key and value integrity is wrong (single data) [2]") 85 | 86 | radarChart.set( 87 | ["aaa", "bbb", "ccc"], 88 | [ 89 | ([4, 5, 8], UIColor.greenColor().colorWithAlphaComponent(0.40)), 90 | ([10, 3], UIColor.darkGrayColor().colorWithAlphaComponent(0.40)) 91 | ] 92 | ) 93 | 94 | XCTAssert(radarChart.validateIntegrityKeyAndValue() == false, "when key and value integrity is wrong (multi data)") 95 | 96 | radarChart.set( 97 | ["aaa", "bbb", "ccc"], 98 | [ 99 | ([4, 5, 8], UIColor.greenColor().colorWithAlphaComponent(0.40)), 100 | ([10, 3, 6], UIColor.darkGrayColor().colorWithAlphaComponent(0.40)) 101 | ] 102 | ) 103 | 104 | XCTAssert(radarChart.validateIntegrityKeyAndValue() == true, "when key and value integrity is correct") 105 | } 106 | 107 | func testValidateSufficientFrame() { 108 | 109 | radarChart = Yashin(frame: CGRectMake(0, 0, 100, 100)) 110 | 111 | radarChart.set( 112 | ["aaa", "bbb"], 113 | [ 114 | ([4, 5], UIColor.greenColor().colorWithAlphaComponent(0.40)), 115 | ([10, 3], UIColor.darkGrayColor().colorWithAlphaComponent(0.40)) 116 | ] 117 | ) 118 | 119 | XCTAssert(radarChart.validateSufficientFrame() == false, "when frame is smaller than expected") 120 | 121 | radarChart.frame = CGRectMake(0, 0, 180, 180) 122 | 123 | XCTAssert(radarChart.validateSufficientFrame() == true, "when frame is big enough [1]") 124 | 125 | radarChart.padding = 100 126 | 127 | XCTAssert(radarChart.validateSufficientFrame() == false, "when frame is smaller than expected (after padding is changed)") 128 | 129 | radarChart.frame = CGRectMake(0, 0, 260, 260) 130 | 131 | XCTAssert(radarChart.validateSufficientFrame() == true, "when frame is big enough [2]") 132 | } 133 | 134 | func testPerformanceDraw() { 135 | self.measureBlock() { 136 | // 137 | } 138 | } 139 | 140 | } 141 | -------------------------------------------------------------------------------- /Example/Yashin.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1F661C55552A5743605E02CC /* Pods_Yashin_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 597DA040FFDE71D55A651B45 /* Pods_Yashin_Tests.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 11 | 2D47D283286FEE78C7B9540A /* Pods_Yashin_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A7DC10B4C59525A74A01D86 /* Pods_Yashin_Example.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 12 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 13 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; 14 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 15 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 16 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 17 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 607FACCF1AFB9204008FA782; 26 | remoteInfo = Yashin; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 1316D7088EF8D5E090723807 /* Pods-Yashin_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Yashin_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Yashin_Tests/Pods-Yashin_Tests.release.xcconfig"; sourceTree = ""; }; 32 | 1A7DC10B4C59525A74A01D86 /* Pods_Yashin_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Yashin_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 2F8F1D8D0AB68A1BD059C0FC /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 34 | 3F78E5ED5B03263410DEBF00 /* Yashin.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Yashin.podspec; path = ../Yashin.podspec; sourceTree = ""; }; 35 | 557ABC9C9A9131B423560C6E /* Pods-Yashin_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Yashin_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Yashin_Example/Pods-Yashin_Example.release.xcconfig"; sourceTree = ""; }; 36 | 597DA040FFDE71D55A651B45 /* Pods_Yashin_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Yashin_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 607FACD01AFB9204008FA782 /* Yashin_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Yashin_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40 | 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 41 | 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 43 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 44 | 607FACE51AFB9204008FA782 /* Yashin_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Yashin_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 | 6F32B7081D63C31D2AC2543A /* Pods-Yashin_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Yashin_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Yashin_Tests/Pods-Yashin_Tests.debug.xcconfig"; sourceTree = ""; }; 48 | 71CDE12F0A0F4EF1DEA4B4B2 /* Pods-Yashin_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Yashin_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Yashin_Example/Pods-Yashin_Example.debug.xcconfig"; sourceTree = ""; }; 49 | B83D495ABAC5F56158B99E29 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 607FACCD1AFB9204008FA782 /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 2D47D283286FEE78C7B9540A /* Pods_Yashin_Example.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | 607FACE21AFB9204008FA782 /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | 1F661C55552A5743605E02CC /* Pods_Yashin_Tests.framework in Frameworks */, 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | /* End PBXFrameworksBuildPhase section */ 70 | 71 | /* Begin PBXGroup section */ 72 | 0DE849103B8B09A8857CEAB1 /* Pods */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 71CDE12F0A0F4EF1DEA4B4B2 /* Pods-Yashin_Example.debug.xcconfig */, 76 | 557ABC9C9A9131B423560C6E /* Pods-Yashin_Example.release.xcconfig */, 77 | 6F32B7081D63C31D2AC2543A /* Pods-Yashin_Tests.debug.xcconfig */, 78 | 1316D7088EF8D5E090723807 /* Pods-Yashin_Tests.release.xcconfig */, 79 | ); 80 | name = Pods; 81 | sourceTree = ""; 82 | }; 83 | 133515CB1F088B26AEF3D34E /* Frameworks */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 1A7DC10B4C59525A74A01D86 /* Pods_Yashin_Example.framework */, 87 | 597DA040FFDE71D55A651B45 /* Pods_Yashin_Tests.framework */, 88 | ); 89 | name = Frameworks; 90 | sourceTree = ""; 91 | }; 92 | 607FACC71AFB9204008FA782 = { 93 | isa = PBXGroup; 94 | children = ( 95 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 96 | 607FACD21AFB9204008FA782 /* Example for Yashin */, 97 | 607FACE81AFB9204008FA782 /* Tests */, 98 | 607FACD11AFB9204008FA782 /* Products */, 99 | 0DE849103B8B09A8857CEAB1 /* Pods */, 100 | 133515CB1F088B26AEF3D34E /* Frameworks */, 101 | ); 102 | sourceTree = ""; 103 | }; 104 | 607FACD11AFB9204008FA782 /* Products */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 607FACD01AFB9204008FA782 /* Yashin_Example.app */, 108 | 607FACE51AFB9204008FA782 /* Yashin_Tests.xctest */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | 607FACD21AFB9204008FA782 /* Example for Yashin */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 117 | 607FACD71AFB9204008FA782 /* ViewController.swift */, 118 | 607FACD91AFB9204008FA782 /* Main.storyboard */, 119 | 607FACDC1AFB9204008FA782 /* Images.xcassets */, 120 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 121 | 607FACD31AFB9204008FA782 /* Supporting Files */, 122 | ); 123 | name = "Example for Yashin"; 124 | path = Yashin; 125 | sourceTree = ""; 126 | }; 127 | 607FACD31AFB9204008FA782 /* Supporting Files */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 607FACD41AFB9204008FA782 /* Info.plist */, 131 | ); 132 | name = "Supporting Files"; 133 | sourceTree = ""; 134 | }; 135 | 607FACE81AFB9204008FA782 /* Tests */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 607FACEB1AFB9204008FA782 /* Tests.swift */, 139 | 607FACE91AFB9204008FA782 /* Supporting Files */, 140 | ); 141 | path = Tests; 142 | sourceTree = ""; 143 | }; 144 | 607FACE91AFB9204008FA782 /* Supporting Files */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | 607FACEA1AFB9204008FA782 /* Info.plist */, 148 | ); 149 | name = "Supporting Files"; 150 | sourceTree = ""; 151 | }; 152 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | 3F78E5ED5B03263410DEBF00 /* Yashin.podspec */, 156 | 2F8F1D8D0AB68A1BD059C0FC /* README.md */, 157 | B83D495ABAC5F56158B99E29 /* LICENSE */, 158 | ); 159 | name = "Podspec Metadata"; 160 | sourceTree = ""; 161 | }; 162 | /* End PBXGroup section */ 163 | 164 | /* Begin PBXNativeTarget section */ 165 | 607FACCF1AFB9204008FA782 /* Yashin_Example */ = { 166 | isa = PBXNativeTarget; 167 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "Yashin_Example" */; 168 | buildPhases = ( 169 | 9EC7E5FFB41EE7E49992138C /* Check Pods Manifest.lock */, 170 | 607FACCC1AFB9204008FA782 /* Sources */, 171 | 607FACCD1AFB9204008FA782 /* Frameworks */, 172 | 607FACCE1AFB9204008FA782 /* Resources */, 173 | F793158FFB1729383C36CC89 /* Embed Pods Frameworks */, 174 | D4207154B10E6DC02B2ADEBB /* Copy Pods Resources */, 175 | ); 176 | buildRules = ( 177 | ); 178 | dependencies = ( 179 | ); 180 | name = Yashin_Example; 181 | productName = Yashin; 182 | productReference = 607FACD01AFB9204008FA782 /* Yashin_Example.app */; 183 | productType = "com.apple.product-type.application"; 184 | }; 185 | 607FACE41AFB9204008FA782 /* Yashin_Tests */ = { 186 | isa = PBXNativeTarget; 187 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "Yashin_Tests" */; 188 | buildPhases = ( 189 | 8044B6B76F2375B57517F22A /* Check Pods Manifest.lock */, 190 | 607FACE11AFB9204008FA782 /* Sources */, 191 | 607FACE21AFB9204008FA782 /* Frameworks */, 192 | 607FACE31AFB9204008FA782 /* Resources */, 193 | D0CCD7E85408E5F0B9E7E833 /* Embed Pods Frameworks */, 194 | 4F84C221D208BA6D821E1C7F /* Copy Pods Resources */, 195 | ); 196 | buildRules = ( 197 | ); 198 | dependencies = ( 199 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */, 200 | ); 201 | name = Yashin_Tests; 202 | productName = Tests; 203 | productReference = 607FACE51AFB9204008FA782 /* Yashin_Tests.xctest */; 204 | productType = "com.apple.product-type.bundle.unit-test"; 205 | }; 206 | /* End PBXNativeTarget section */ 207 | 208 | /* Begin PBXProject section */ 209 | 607FACC81AFB9204008FA782 /* Project object */ = { 210 | isa = PBXProject; 211 | attributes = { 212 | LastSwiftUpdateCheck = 0720; 213 | LastUpgradeCheck = 0630; 214 | ORGANIZATIONNAME = CocoaPods; 215 | TargetAttributes = { 216 | 607FACCF1AFB9204008FA782 = { 217 | CreatedOnToolsVersion = 6.3.1; 218 | }; 219 | 607FACE41AFB9204008FA782 = { 220 | CreatedOnToolsVersion = 6.3.1; 221 | TestTargetID = 607FACCF1AFB9204008FA782; 222 | }; 223 | }; 224 | }; 225 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "Yashin" */; 226 | compatibilityVersion = "Xcode 3.2"; 227 | developmentRegion = English; 228 | hasScannedForEncodings = 0; 229 | knownRegions = ( 230 | en, 231 | Base, 232 | ); 233 | mainGroup = 607FACC71AFB9204008FA782; 234 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 235 | projectDirPath = ""; 236 | projectRoot = ""; 237 | targets = ( 238 | 607FACCF1AFB9204008FA782 /* Yashin_Example */, 239 | 607FACE41AFB9204008FA782 /* Yashin_Tests */, 240 | ); 241 | }; 242 | /* End PBXProject section */ 243 | 244 | /* Begin PBXResourcesBuildPhase section */ 245 | 607FACCE1AFB9204008FA782 /* Resources */ = { 246 | isa = PBXResourcesBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 250 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 251 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | }; 255 | 607FACE31AFB9204008FA782 /* Resources */ = { 256 | isa = PBXResourcesBuildPhase; 257 | buildActionMask = 2147483647; 258 | files = ( 259 | ); 260 | runOnlyForDeploymentPostprocessing = 0; 261 | }; 262 | /* End PBXResourcesBuildPhase section */ 263 | 264 | /* Begin PBXShellScriptBuildPhase section */ 265 | 4F84C221D208BA6D821E1C7F /* Copy Pods Resources */ = { 266 | isa = PBXShellScriptBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | ); 270 | inputPaths = ( 271 | ); 272 | name = "Copy Pods Resources"; 273 | outputPaths = ( 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | shellPath = /bin/sh; 277 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Yashin_Tests/Pods-Yashin_Tests-resources.sh\"\n"; 278 | showEnvVarsInLog = 0; 279 | }; 280 | 8044B6B76F2375B57517F22A /* Check Pods Manifest.lock */ = { 281 | isa = PBXShellScriptBuildPhase; 282 | buildActionMask = 2147483647; 283 | files = ( 284 | ); 285 | inputPaths = ( 286 | ); 287 | name = "Check Pods Manifest.lock"; 288 | outputPaths = ( 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | shellPath = /bin/sh; 292 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 293 | showEnvVarsInLog = 0; 294 | }; 295 | 9EC7E5FFB41EE7E49992138C /* Check Pods Manifest.lock */ = { 296 | isa = PBXShellScriptBuildPhase; 297 | buildActionMask = 2147483647; 298 | files = ( 299 | ); 300 | inputPaths = ( 301 | ); 302 | name = "Check Pods Manifest.lock"; 303 | outputPaths = ( 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | shellPath = /bin/sh; 307 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 308 | showEnvVarsInLog = 0; 309 | }; 310 | D0CCD7E85408E5F0B9E7E833 /* Embed Pods Frameworks */ = { 311 | isa = PBXShellScriptBuildPhase; 312 | buildActionMask = 2147483647; 313 | files = ( 314 | ); 315 | inputPaths = ( 316 | ); 317 | name = "Embed Pods Frameworks"; 318 | outputPaths = ( 319 | ); 320 | runOnlyForDeploymentPostprocessing = 0; 321 | shellPath = /bin/sh; 322 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Yashin_Tests/Pods-Yashin_Tests-frameworks.sh\"\n"; 323 | showEnvVarsInLog = 0; 324 | }; 325 | D4207154B10E6DC02B2ADEBB /* Copy Pods Resources */ = { 326 | isa = PBXShellScriptBuildPhase; 327 | buildActionMask = 2147483647; 328 | files = ( 329 | ); 330 | inputPaths = ( 331 | ); 332 | name = "Copy Pods Resources"; 333 | outputPaths = ( 334 | ); 335 | runOnlyForDeploymentPostprocessing = 0; 336 | shellPath = /bin/sh; 337 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Yashin_Example/Pods-Yashin_Example-resources.sh\"\n"; 338 | showEnvVarsInLog = 0; 339 | }; 340 | F793158FFB1729383C36CC89 /* Embed Pods Frameworks */ = { 341 | isa = PBXShellScriptBuildPhase; 342 | buildActionMask = 2147483647; 343 | files = ( 344 | ); 345 | inputPaths = ( 346 | ); 347 | name = "Embed Pods Frameworks"; 348 | outputPaths = ( 349 | ); 350 | runOnlyForDeploymentPostprocessing = 0; 351 | shellPath = /bin/sh; 352 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Yashin_Example/Pods-Yashin_Example-frameworks.sh\"\n"; 353 | showEnvVarsInLog = 0; 354 | }; 355 | /* End PBXShellScriptBuildPhase section */ 356 | 357 | /* Begin PBXSourcesBuildPhase section */ 358 | 607FACCC1AFB9204008FA782 /* Sources */ = { 359 | isa = PBXSourcesBuildPhase; 360 | buildActionMask = 2147483647; 361 | files = ( 362 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 363 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 364 | ); 365 | runOnlyForDeploymentPostprocessing = 0; 366 | }; 367 | 607FACE11AFB9204008FA782 /* Sources */ = { 368 | isa = PBXSourcesBuildPhase; 369 | buildActionMask = 2147483647; 370 | files = ( 371 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */, 372 | ); 373 | runOnlyForDeploymentPostprocessing = 0; 374 | }; 375 | /* End PBXSourcesBuildPhase section */ 376 | 377 | /* Begin PBXTargetDependency section */ 378 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { 379 | isa = PBXTargetDependency; 380 | target = 607FACCF1AFB9204008FA782 /* Yashin_Example */; 381 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; 382 | }; 383 | /* End PBXTargetDependency section */ 384 | 385 | /* Begin PBXVariantGroup section */ 386 | 607FACD91AFB9204008FA782 /* Main.storyboard */ = { 387 | isa = PBXVariantGroup; 388 | children = ( 389 | 607FACDA1AFB9204008FA782 /* Base */, 390 | ); 391 | name = Main.storyboard; 392 | sourceTree = ""; 393 | }; 394 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { 395 | isa = PBXVariantGroup; 396 | children = ( 397 | 607FACDF1AFB9204008FA782 /* Base */, 398 | ); 399 | name = LaunchScreen.xib; 400 | sourceTree = ""; 401 | }; 402 | /* End PBXVariantGroup section */ 403 | 404 | /* Begin XCBuildConfiguration section */ 405 | 607FACED1AFB9204008FA782 /* Debug */ = { 406 | isa = XCBuildConfiguration; 407 | buildSettings = { 408 | ALWAYS_SEARCH_USER_PATHS = NO; 409 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 410 | CLANG_CXX_LIBRARY = "libc++"; 411 | CLANG_ENABLE_MODULES = YES; 412 | CLANG_ENABLE_OBJC_ARC = YES; 413 | CLANG_WARN_BOOL_CONVERSION = YES; 414 | CLANG_WARN_CONSTANT_CONVERSION = YES; 415 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 416 | CLANG_WARN_EMPTY_BODY = YES; 417 | CLANG_WARN_ENUM_CONVERSION = YES; 418 | CLANG_WARN_INT_CONVERSION = YES; 419 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 420 | CLANG_WARN_UNREACHABLE_CODE = YES; 421 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 422 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 423 | COPY_PHASE_STRIP = NO; 424 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 425 | ENABLE_STRICT_OBJC_MSGSEND = YES; 426 | GCC_C_LANGUAGE_STANDARD = gnu99; 427 | GCC_DYNAMIC_NO_PIC = NO; 428 | GCC_NO_COMMON_BLOCKS = YES; 429 | GCC_OPTIMIZATION_LEVEL = 0; 430 | GCC_PREPROCESSOR_DEFINITIONS = ( 431 | "DEBUG=1", 432 | "$(inherited)", 433 | ); 434 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 435 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 436 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 437 | GCC_WARN_UNDECLARED_SELECTOR = YES; 438 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 439 | GCC_WARN_UNUSED_FUNCTION = YES; 440 | GCC_WARN_UNUSED_VARIABLE = YES; 441 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 442 | MTL_ENABLE_DEBUG_INFO = YES; 443 | ONLY_ACTIVE_ARCH = YES; 444 | SDKROOT = iphoneos; 445 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 446 | }; 447 | name = Debug; 448 | }; 449 | 607FACEE1AFB9204008FA782 /* Release */ = { 450 | isa = XCBuildConfiguration; 451 | buildSettings = { 452 | ALWAYS_SEARCH_USER_PATHS = NO; 453 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 454 | CLANG_CXX_LIBRARY = "libc++"; 455 | CLANG_ENABLE_MODULES = YES; 456 | CLANG_ENABLE_OBJC_ARC = YES; 457 | CLANG_WARN_BOOL_CONVERSION = YES; 458 | CLANG_WARN_CONSTANT_CONVERSION = YES; 459 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 460 | CLANG_WARN_EMPTY_BODY = YES; 461 | CLANG_WARN_ENUM_CONVERSION = YES; 462 | CLANG_WARN_INT_CONVERSION = YES; 463 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 464 | CLANG_WARN_UNREACHABLE_CODE = YES; 465 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 466 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 467 | COPY_PHASE_STRIP = NO; 468 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 469 | ENABLE_NS_ASSERTIONS = NO; 470 | ENABLE_STRICT_OBJC_MSGSEND = YES; 471 | GCC_C_LANGUAGE_STANDARD = gnu99; 472 | GCC_NO_COMMON_BLOCKS = YES; 473 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 474 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 475 | GCC_WARN_UNDECLARED_SELECTOR = YES; 476 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 477 | GCC_WARN_UNUSED_FUNCTION = YES; 478 | GCC_WARN_UNUSED_VARIABLE = YES; 479 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 480 | MTL_ENABLE_DEBUG_INFO = NO; 481 | SDKROOT = iphoneos; 482 | VALIDATE_PRODUCT = YES; 483 | }; 484 | name = Release; 485 | }; 486 | 607FACF01AFB9204008FA782 /* Debug */ = { 487 | isa = XCBuildConfiguration; 488 | baseConfigurationReference = 71CDE12F0A0F4EF1DEA4B4B2 /* Pods-Yashin_Example.debug.xcconfig */; 489 | buildSettings = { 490 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 491 | INFOPLIST_FILE = Yashin/Info.plist; 492 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 493 | MODULE_NAME = ExampleApp; 494 | PRODUCT_NAME = "$(TARGET_NAME)"; 495 | }; 496 | name = Debug; 497 | }; 498 | 607FACF11AFB9204008FA782 /* Release */ = { 499 | isa = XCBuildConfiguration; 500 | baseConfigurationReference = 557ABC9C9A9131B423560C6E /* Pods-Yashin_Example.release.xcconfig */; 501 | buildSettings = { 502 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 503 | INFOPLIST_FILE = Yashin/Info.plist; 504 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 505 | MODULE_NAME = ExampleApp; 506 | PRODUCT_NAME = "$(TARGET_NAME)"; 507 | }; 508 | name = Release; 509 | }; 510 | 607FACF31AFB9204008FA782 /* Debug */ = { 511 | isa = XCBuildConfiguration; 512 | baseConfigurationReference = 6F32B7081D63C31D2AC2543A /* Pods-Yashin_Tests.debug.xcconfig */; 513 | buildSettings = { 514 | BUNDLE_LOADER = "$(TEST_HOST)"; 515 | FRAMEWORK_SEARCH_PATHS = ( 516 | "$(SDKROOT)/Developer/Library/Frameworks", 517 | "$(inherited)", 518 | ); 519 | GCC_PREPROCESSOR_DEFINITIONS = ( 520 | "DEBUG=1", 521 | "$(inherited)", 522 | ); 523 | INFOPLIST_FILE = Tests/Info.plist; 524 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 525 | PRODUCT_NAME = "$(TARGET_NAME)"; 526 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Yashin_Example.app/Yashin_Example"; 527 | }; 528 | name = Debug; 529 | }; 530 | 607FACF41AFB9204008FA782 /* Release */ = { 531 | isa = XCBuildConfiguration; 532 | baseConfigurationReference = 1316D7088EF8D5E090723807 /* Pods-Yashin_Tests.release.xcconfig */; 533 | buildSettings = { 534 | BUNDLE_LOADER = "$(TEST_HOST)"; 535 | FRAMEWORK_SEARCH_PATHS = ( 536 | "$(SDKROOT)/Developer/Library/Frameworks", 537 | "$(inherited)", 538 | ); 539 | INFOPLIST_FILE = Tests/Info.plist; 540 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 541 | PRODUCT_NAME = "$(TARGET_NAME)"; 542 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Yashin_Example.app/Yashin_Example"; 543 | }; 544 | name = Release; 545 | }; 546 | /* End XCBuildConfiguration section */ 547 | 548 | /* Begin XCConfigurationList section */ 549 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "Yashin" */ = { 550 | isa = XCConfigurationList; 551 | buildConfigurations = ( 552 | 607FACED1AFB9204008FA782 /* Debug */, 553 | 607FACEE1AFB9204008FA782 /* Release */, 554 | ); 555 | defaultConfigurationIsVisible = 0; 556 | defaultConfigurationName = Release; 557 | }; 558 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "Yashin_Example" */ = { 559 | isa = XCConfigurationList; 560 | buildConfigurations = ( 561 | 607FACF01AFB9204008FA782 /* Debug */, 562 | 607FACF11AFB9204008FA782 /* Release */, 563 | ); 564 | defaultConfigurationIsVisible = 0; 565 | defaultConfigurationName = Release; 566 | }; 567 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "Yashin_Tests" */ = { 568 | isa = XCConfigurationList; 569 | buildConfigurations = ( 570 | 607FACF31AFB9204008FA782 /* Debug */, 571 | 607FACF41AFB9204008FA782 /* Release */, 572 | ); 573 | defaultConfigurationIsVisible = 0; 574 | defaultConfigurationName = Release; 575 | }; 576 | /* End XCConfigurationList section */ 577 | }; 578 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 579 | } 580 | -------------------------------------------------------------------------------- /Example/Yashin.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Yashin.xcodeproj/xcshareddata/xcschemes/Yashin-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 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /Example/Yashin.xcodeproj/xcshareddata/xcschemes/Yashin_Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 17 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 39 | 40 | 41 | 42 | 48 | 49 | 51 | 52 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/Yashin.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/Yashin/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Yashin 4 | // 5 | // Created by ushisantoasobu on 12/29/2015. 6 | // Copyright (c) 2015 ushisantoasobu. 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: [NSObject: AnyObject]?) -> 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/Yashin/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/Yashin/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 | -------------------------------------------------------------------------------- /Example/Yashin/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Example/Yashin/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/Yashin/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Yashin 4 | // 5 | // Created by ushisantoasobu on 12/29/2015. 6 | // Copyright (c) 2015 ushisantoasobu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Yashin 11 | 12 | class ViewController: UIViewController { 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | 17 | setupRadarChart() 18 | } 19 | 20 | override func didReceiveMemoryWarning() { 21 | super.didReceiveMemoryWarning() 22 | // Dispose of any resources that can be recreated. 23 | } 24 | 25 | private func setupRadarChart() { 26 | let radarChart = Yashin(frame: self.view.frame) 27 | self.view.addSubview(radarChart) 28 | 29 | radarChart.set( 30 | ["shoot", "pass", "dribble", "speed", "power", "stamina", "mentality"], 31 | [ 32 | ([6,9,5,8,7,4,6], UIColor.greenColor().colorWithAlphaComponent(0.40)), 33 | ([7,6,7,7,8,8,6], UIColor.blackColor().colorWithAlphaComponent(0.40)), 34 | ([8,7,8,7,7,9,5], UIColor.redColor().colorWithAlphaComponent(0.40)) 35 | ] 36 | ) 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 shunsuke sato 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Pod/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ushisantoasobu/Yashin/df556b42bf76c417e3b74f7e99a68512da977462/Pod/Assets/.gitkeep -------------------------------------------------------------------------------- /Pod/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ushisantoasobu/Yashin/df556b42bf76c417e3b74f7e99a68512da977462/Pod/Classes/.gitkeep -------------------------------------------------------------------------------- /Pod/Classes/Yashin.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Yashin.swift 3 | // 4 | // Created by SatoShunsuke on 2015/12/29. 5 | // 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | public class Yashin : UIView { 12 | 13 | public typealias Value = ([UInt], UIColor) 14 | 15 | private var keys = [String]() 16 | private var values = [Value]() 17 | 18 | public var minValue :UInt = 0 19 | public var maxValue :UInt = 10 20 | public var padding :CGFloat = 60 21 | public var scaleLineWidth :CGFloat = 3.0 22 | public var scaleLineHidden = false 23 | 24 | // font 25 | public var fontSize :CGFloat = 11.0 26 | 27 | // color 28 | public var lineColor = UIColor.darkGrayColor() 29 | public var subLineColor = UIColor.darkGrayColor().colorWithAlphaComponent(0.50) 30 | 31 | public override init(frame: CGRect) { 32 | super.init(frame: frame) 33 | self.userInteractionEnabled = false 34 | self.backgroundColor = UIColor.clearColor() 35 | } 36 | 37 | required public init?(coder aDecoder: NSCoder) { 38 | fatalError("init(coder:) has not been implemented") 39 | } 40 | 41 | public func set(keys :[String], _ values :[Value]) { 42 | self.keys = keys 43 | self.values = values 44 | } 45 | 46 | public override func drawRect(rect: CGRect) { 47 | 48 | if !self.validateMinAndMax() { 49 | print("Invalid combination minValue and maxValue") 50 | return 51 | } 52 | 53 | if !self.validateKeyCount() { 54 | print("key count is needed at least 3") 55 | return 56 | } 57 | 58 | if !self.validateIntegrityKeyAndValue() { 59 | print("invalid combination key and value") 60 | return 61 | } 62 | 63 | if !self.validateSufficientFrame() { 64 | print("frame size is too small to show") 65 | return 66 | } 67 | 68 | let keyCount = self.keys.count 69 | let valueCount = self.values.count 70 | let len = min(self.frame.width, self.frame.height) - padding * 2 71 | let center = CGPointMake(self.center.x - self.frame.origin.x, self.center.y - self.frame.origin.y) 72 | let scales :[CGFloat] = self.getScaleValues(self.minValue, self.maxValue) 73 | 74 | var rad :CGFloat = 2 * CGFloat(M_PI) * 3 / 4 75 | var maxPoints = [CGPoint]() 76 | var valuePoints = Array(count: valueCount, repeatedValue: [CGPoint]()) 77 | 78 | for (index, key) in self.keys.enumerate() { 79 | 80 | let currentMaxPoint = self.getPoint(center, len: len / 2, rad: rad) 81 | maxPoints.append(currentMaxPoint) 82 | 83 | for (valueIndex, value) in self.values.enumerate() { 84 | let values :[UInt] = value.0 85 | let valueRatio :CGFloat = min(1.0, (CGFloat(values[index]) - CGFloat(self.minValue)) / CGFloat(self.maxValue - self.minValue)) 86 | let point = self.getPoint(center, len: len * valueRatio / 2, rad: rad) 87 | valuePoints[valueIndex].append(point) 88 | } 89 | 90 | // draw inner-line 91 | self.subLineColor.setStroke() 92 | self.drawLine(currentMaxPoint, center) 93 | 94 | // draw text 95 | let paragraphStyle = NSMutableParagraphStyle() 96 | let dic = [ 97 | NSParagraphStyleAttributeName : paragraphStyle, 98 | NSForegroundColorAttributeName : self.lineColor, 99 | NSFontAttributeName : UIFont.systemFontOfSize(self.fontSize) 100 | ] 101 | let namePoint = self.getPoint(center, len: (len + 10) / 2, rad: rad) 102 | let textWidth :CGFloat = 200.0 103 | let textHeight :CGFloat = 14.0 104 | var textX :CGFloat = namePoint.x 105 | var textY :CGFloat = namePoint.y 106 | 107 | if index == 0 { 108 | paragraphStyle.alignment = NSTextAlignment.Center 109 | textX = namePoint.x - textWidth / 2 110 | textY = namePoint.y - textHeight 111 | } else if index == keyCount / 2 && keyCount % 2 == 0 { 112 | paragraphStyle.alignment = NSTextAlignment.Center 113 | textX = namePoint.x - textWidth / 2 114 | } else if index == keyCount / 4 && keyCount % 4 == 0 { 115 | paragraphStyle.alignment = NSTextAlignment.Left 116 | textY = namePoint.y - textHeight / 2 117 | } else if index == keyCount / 4 * 3 && keyCount % 4 == 0 { 118 | paragraphStyle.alignment = NSTextAlignment.Right 119 | textX = namePoint.x - textWidth 120 | textY = namePoint.y - textHeight / 2 121 | } else { 122 | if namePoint.x < center.x { 123 | paragraphStyle.alignment = NSTextAlignment.Right 124 | textX = namePoint.x - textWidth 125 | } else { 126 | paragraphStyle.alignment = NSTextAlignment.Left 127 | } 128 | 129 | if namePoint.y < center.y { 130 | textY = namePoint.y - textHeight 131 | } 132 | } 133 | key.drawInRect(CGRectMake(textX, textY, textWidth, textHeight), withAttributes: dic) 134 | 135 | let nextRad = rad + 2 * CGFloat(M_PI) / CGFloat(keyCount) 136 | 137 | // draw scale lines 138 | if scaleLineHidden || (self.maxValue - self.minValue < 2) { 139 | rad = nextRad 140 | continue 141 | } 142 | self.subLineColor.setStroke() 143 | for scaleValue in scales { 144 | let ratio :CGFloat = (scaleValue - CGFloat(self.minValue)) / CGFloat(self.maxValue - self.minValue) 145 | let targetPoint = self.getPoint(center, len: len / 2 * ratio, rad: rad) 146 | let fromRad = rad + CGFloat(M_PI) / 2 147 | let toRad = rad + CGFloat(M_PI) / 2 * 3 148 | let fromPoint = self.getPoint(targetPoint, len: scaleLineWidth, rad: fromRad) 149 | let toPoint = self.getPoint(targetPoint, len: scaleLineWidth, rad: toRad) 150 | self.drawLine(fromPoint, toPoint) 151 | } 152 | 153 | rad = nextRad 154 | } 155 | 156 | // draw outer-line 157 | for (index, _) in maxPoints.enumerate() { 158 | self.lineColor.setStroke() 159 | if index == maxPoints.count - 1 { 160 | self.drawLine(maxPoints[index], maxPoints[0]) 161 | } else { 162 | self.drawLine(maxPoints[index], maxPoints[index + 1]) 163 | } 164 | } 165 | 166 | // fill value 167 | for (index, points) in valuePoints.enumerate() { 168 | let fillColor :UIColor = self.values[index].1 169 | let fillPath = UIBezierPath() 170 | fillColor.setFill() 171 | for (subIndex, point) in points.enumerate() { 172 | if subIndex == 0 { 173 | fillPath.moveToPoint(point) 174 | } 175 | fillPath.addLineToPoint(point) 176 | } 177 | fillPath.fill() 178 | } 179 | 180 | } 181 | 182 | // MARK: - validate 183 | 184 | public func validateMinAndMax() -> Bool { 185 | return self.minValue < self.maxValue 186 | } 187 | 188 | public func validateKeyCount() -> Bool { 189 | let count = self.keys.count 190 | return !(count < 3) 191 | } 192 | 193 | public func validateIntegrityKeyAndValue() -> Bool { 194 | let count = self.keys.count 195 | for value in self.values { 196 | if value.0.count != count { 197 | return false 198 | } 199 | } 200 | return true 201 | } 202 | 203 | public func validateSufficientFrame() -> Bool { 204 | let len = min(self.frame.width, self.frame.height) - padding * 2 205 | return !(len < 60) 206 | } 207 | 208 | // MARK: - private funcs 209 | 210 | private func drawLine(from :CGPoint, _ to :CGPoint, width :CGFloat = 1.0) { 211 | let path = UIBezierPath() 212 | path.lineWidth = width 213 | path.moveToPoint(from) 214 | path.addLineToPoint(to) 215 | path.stroke() 216 | } 217 | 218 | private func getPoint(centerPoint :CGPoint, len :CGFloat, rad :CGFloat) -> CGPoint { 219 | return CGPointMake(centerPoint.x + len * cos(rad), centerPoint.y + len * sin(rad)) 220 | } 221 | 222 | private func getScaleValues(minValue :UInt, _ maxValue :UInt) -> [CGFloat] { 223 | var values = [CGFloat]() 224 | if (maxValue - minValue) < 2 { 225 | return values 226 | } 227 | if (maxValue - minValue) < 10 { 228 | for value in (minValue + 1)...(maxValue - 1) { 229 | values.append(CGFloat(value)) 230 | } 231 | return values 232 | } 233 | for index in 1...(10 - 1) { 234 | let diff :CGFloat = CGFloat(maxValue - minValue) / 10.0 235 | values.append(CGFloat(minValue) + diff * CGFloat(index)) 236 | } 237 | return values 238 | } 239 | } 240 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Yashin 2 | 3 | Simple Rader Chart written in Swift. 4 | 5 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 6 | [![CI Status](http://img.shields.io/travis/ushisantoasobu/Yashin.svg?style=flat)](https://travis-ci.org/ushisantoasobu/Yashin) 7 | [![Version](https://img.shields.io/cocoapods/v/Yashin.svg?style=flat)](http://cocoapods.org/pods/Yashin) 8 | [![License](https://img.shields.io/cocoapods/l/Yashin.svg?style=flat)](http://cocoapods.org/pods/Yashin) 9 | [![Platform](https://img.shields.io/cocoapods/p/Yashin.svg?style=flat)](http://cocoapods.org/pods/Yashin) 10 | 11 | ## Usage 12 | 13 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 14 | 15 | ### Basic 16 | 17 | ```Swift 18 | import UIKit 19 | import Yashin 20 | 21 | class SomeViewController: UIViewController { 22 | 23 | override func viewDidLoad() { 24 | super.viewDidLoad() 25 | 26 | let radarChart = Yashin(frame: self.view.frame) 27 | self.view.addSubview(radarChart) 28 | 29 | radarChart.set( 30 | ["shoot", "pass", "dribble", "speed", "power", "stamina", "mentality"], 31 | [([8,9,8,8,7,6,9], UIColor.greenColor().colorWithAlphaComponent(0.40))] 32 | ) 33 | } 34 | } 35 | ``` 36 | 37 | 38 | 39 | ### Setting some properties 40 | 41 | ```Swift 42 | // param 43 | radarChart.maxValue = 100 // Max value of chart. Default is 10 44 | radarChart.minValue = 0 // Min value of chart. Default is 0 45 | 46 | // appearance 47 | radarChart.padding = 100 // Padding from chart to outline frame. Default is 60.0 48 | radarChart.fontSize = 13.0 // Font size. Default is 11.0 49 | radarChart.scaleLineWidth = 4.0 // Scale-line width. Default is 2.0 50 | radarChart.scaleLineHidden = false // Scale-line hidden flag. Default is false 51 | 52 | // color 53 | radarChart.lineColor = UIColor.brownColor() // Color of chart outer-line. Default is UIColor.darkGrayColor() 54 | radarChart.subLineColor = UIColor.lightGrayColor() // Color of chart inner-line. Default is UIColor.darkGrayColor().colorWithAlphaComponent(0.50) 55 | 56 | radarChart.set( 57 | ["shoot", "pass", "dribble", "speed", "power", "stamina", "mentality"], 58 | [([84,91,88,83,75,60,94], UIColor.greenColor().colorWithAlphaComponent(0.40))] 59 | ) 60 | ``` 61 | 62 | 63 | 64 | ### Setting multi data 65 | 66 | ```Swift 67 | radarChart.set( 68 | ["shoot", "pass", "dribble", "speed", "power", "stamina", "mentality"], 69 | [ 70 | ([6,9,5,8,7,4,6], UIColor.greenColor().colorWithAlphaComponent(0.40)), 71 | ([7,6,7,7,8,8,6], UIColor.blackColor().colorWithAlphaComponent(0.40)), 72 | ([8,7,8,7,7,9,5], UIColor.redColor().colorWithAlphaComponent(0.40)) 73 | ] 74 | ) 75 | ``` 76 | 77 | 78 | 79 | ## Requirements 80 | 81 | - iOS 9.0 or later 82 | - Xcode 7.2 83 | 84 | ## Installation 85 | 86 | ### Carthage 87 | 88 | Add the following to your Cartfile: 89 | 90 | ```ruby 91 | github "ushisantoasobu/Yashin" 92 | ``` 93 | 94 | And run `carthage update`, then add the framework as described in [Carthage Readme](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) 95 | 96 | ### CocoaPods 97 | 98 | Yashin is available through [CocoaPods](http://cocoapods.org). To install 99 | it, simply add the following line to your Podfile: 100 | 101 | ```ruby 102 | pod "Yashin" 103 | ``` 104 | 105 | ## Author 106 | 107 | ushisantoasobu, babblemann.shunsee@gmail.com 108 | 109 | ## License 110 | 111 | Yashin is available under the MIT license. See the LICENSE file for more info. 112 | -------------------------------------------------------------------------------- /Yashin.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint Yashin.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 http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = "Yashin" 11 | s.version = "0.3.2" 12 | s.summary = "Simple Rader Chart written in Swift." 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 | s.description = "With setting up 2 lines of code and data-list, you can draw simple but cool Rader Chart" 20 | 21 | s.homepage = "https://github.com/ushisantoasobu/Yashin" 22 | # s.screenshots = "https://github.com/ushisantoasobu/Yashin/blob/master/screenshots/1", "https://github.com/ushisantoasobu/Yashin/blob/master/screenshots/2" 23 | s.license = 'MIT' 24 | s.author = { "ushisantoasobu" => "babblemann.shunsee@gmail.com" } 25 | s.source = { :git => "https://github.com/ushisantoasobu/Yashin.git", :tag => s.version.to_s } 26 | s.social_media_url = 'https://twitter.com/ushisantoasobu' 27 | 28 | s.platform = :ios, '9.0' 29 | s.requires_arc = true 30 | 31 | s.source_files = 'Pod/Classes/**/*' 32 | s.resource_bundles = { 33 | 'Yashin' => ['Pod/Assets/*.png'] 34 | } 35 | 36 | # s.public_header_files = 'Pod/Classes/**/*.h' 37 | # s.frameworks = 'UIKit', 'MapKit' 38 | # s.dependency 'AFNetworking', '~> 2.3' 39 | end 40 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj -------------------------------------------------------------------------------- /screenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ushisantoasobu/Yashin/df556b42bf76c417e3b74f7e99a68512da977462/screenshots/1.png -------------------------------------------------------------------------------- /screenshots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ushisantoasobu/Yashin/df556b42bf76c417e3b74f7e99a68512da977462/screenshots/2.png -------------------------------------------------------------------------------- /screenshots/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ushisantoasobu/Yashin/df556b42bf76c417e3b74f7e99a68512da977462/screenshots/3.png --------------------------------------------------------------------------------