├── .gitignore ├── .travis.yml ├── Example ├── Podfile ├── SMLElevationView.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── SMLElevationView-Example.xcscheme ├── SMLElevationView │ ├── Base.lproj │ │ ├── Main_iPad.storyboard │ │ └── Main_iPhone.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── SMLAppDelegate.h │ ├── SMLAppDelegate.m │ ├── SMLElevationView-Info.plist │ ├── SMLElevationView-Prefix.pch │ ├── SMLViewController.h │ ├── SMLViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE ├── Pod ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── SMLElevationView.h │ └── SMLElevationView.m ├── README.md └── SMLElevationView.podspec /.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 | # We recommend against adding the Pods directory to your .gitignore. However 26 | # you should judge for yourself, the pros and cons are mentioned at: 27 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 28 | # 29 | # Note: if you ignore the Pods directory, make sure to uncomment 30 | # `pod install` in .travis.yml 31 | # 32 | Pods/ 33 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | language: objective-c 6 | cache: cocoapods 7 | podfile: Example/Podfile 8 | before_install: 9 | - gem install cocoapods # Since Travis is not always on latest version 10 | - pod install --project-directory=Example 11 | install: 12 | - gem install xcpretty --no-rdoc --no-ri --no-document --quiet 13 | script: 14 | - set -o pipefail && xcodebuild test -workspace Example/SMLElevationView.xcworkspace -scheme SMLElevationView-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c 15 | - pod lib lint --quick 16 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | use_frameworks! 3 | target 'SMLElevationView', :exclusive => true do 4 | pod "SMLElevationView" 5 | end 6 | 7 | target 'Tests', :exclusive => true do 8 | pod "SMLElevationView" 9 | 10 | pod 'FBSnapshotTestCase' 11 | end 12 | -------------------------------------------------------------------------------- /Example/SMLElevationView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 11 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 12 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 13 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; 14 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 15 | 6003F59E195388D20070C39A /* SMLAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* SMLAppDelegate.m */; }; 16 | 6003F5A1195388D20070C39A /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6003F59F195388D20070C39A /* Main_iPhone.storyboard */; }; 17 | 6003F5A4195388D20070C39A /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A2195388D20070C39A /* Main_iPad.storyboard */; }; 18 | 6003F5A7195388D20070C39A /* SMLViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* SMLViewController.m */; }; 19 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 20 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; 21 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 22 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 23 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 24 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 25 | 606BA7A98EFF1EDD91B95D08 /* Pods_SMLElevationView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34EFA415311D1FFEF8358245 /* Pods_SMLElevationView.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 26 | 6EEFCFE4061798ECC69131A3 /* Pods_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10D0656097D22E15EA516F08 /* Pods_Tests.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 6003F582195388D10070C39A /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 6003F589195388D20070C39A; 35 | remoteInfo = SMLElevationView; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 10D0656097D22E15EA516F08 /* Pods_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 34EFA415311D1FFEF8358245 /* Pods_SMLElevationView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SMLElevationView.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 5DAC4561E8BF5EC01EE68809 /* Pods-SMLElevationView.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SMLElevationView.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SMLElevationView/Pods-SMLElevationView.debug.xcconfig"; sourceTree = ""; }; 43 | 6003F58A195388D20070C39A /* SMLElevationView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SMLElevationView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 45 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 46 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 47 | 6003F595195388D20070C39A /* SMLElevationView-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SMLElevationView-Info.plist"; sourceTree = ""; }; 48 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 49 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 50 | 6003F59B195388D20070C39A /* SMLElevationView-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SMLElevationView-Prefix.pch"; sourceTree = ""; }; 51 | 6003F59C195388D20070C39A /* SMLAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMLAppDelegate.h; sourceTree = ""; }; 52 | 6003F59D195388D20070C39A /* SMLAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMLAppDelegate.m; sourceTree = ""; }; 53 | 6003F5A0195388D20070C39A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = ""; }; 54 | 6003F5A3195388D20070C39A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = ""; }; 55 | 6003F5A5195388D20070C39A /* SMLViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMLViewController.h; sourceTree = ""; }; 56 | 6003F5A6195388D20070C39A /* SMLViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMLViewController.m; sourceTree = ""; }; 57 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 58 | 6003F5AE195388D20070C39A /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 60 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 61 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 62 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 63 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 64 | 6E94481F1C9FA8F3A8EF1F89 /* Pods-SMLElevationView.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SMLElevationView.release.xcconfig"; path = "Pods/Target Support Files/Pods-SMLElevationView/Pods-SMLElevationView.release.xcconfig"; sourceTree = ""; }; 65 | 7F94F4E3682C94C107B02E89 /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = ""; }; 66 | BEE06A7321C416811BA1AC6C /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig"; sourceTree = ""; }; 67 | EA882FAE1CA6B36C169E02CB /* SMLElevationView.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SMLElevationView.podspec; path = ../SMLElevationView.podspec; sourceTree = ""; }; 68 | FB639F184E706C8A5C6AB5F0 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 69 | FD5B5F4AE4C5D2F5C0E631FB /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 70 | /* End PBXFileReference section */ 71 | 72 | /* Begin PBXFrameworksBuildPhase section */ 73 | 6003F587195388D20070C39A /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 78 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 79 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 80 | 606BA7A98EFF1EDD91B95D08 /* Pods_SMLElevationView.framework in Frameworks */, 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | 6003F5AB195388D20070C39A /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 89 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 90 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 91 | 6EEFCFE4061798ECC69131A3 /* Pods_Tests.framework in Frameworks */, 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | /* End PBXFrameworksBuildPhase section */ 96 | 97 | /* Begin PBXGroup section */ 98 | 6003F581195388D10070C39A = { 99 | isa = PBXGroup; 100 | children = ( 101 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 102 | 6003F593195388D20070C39A /* SMLElevationView */, 103 | 6003F5B5195388D20070C39A /* Tests */, 104 | 6003F58C195388D20070C39A /* Frameworks */, 105 | 6003F58B195388D20070C39A /* Products */, 106 | 673DAE3B9B791F7FE369D967 /* Pods */, 107 | ); 108 | sourceTree = ""; 109 | }; 110 | 6003F58B195388D20070C39A /* Products */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 6003F58A195388D20070C39A /* SMLElevationView.app */, 114 | 6003F5AE195388D20070C39A /* Tests.xctest */, 115 | ); 116 | name = Products; 117 | sourceTree = ""; 118 | }; 119 | 6003F58C195388D20070C39A /* Frameworks */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 6003F58D195388D20070C39A /* Foundation.framework */, 123 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 124 | 6003F591195388D20070C39A /* UIKit.framework */, 125 | 6003F5AF195388D20070C39A /* XCTest.framework */, 126 | 34EFA415311D1FFEF8358245 /* Pods_SMLElevationView.framework */, 127 | 10D0656097D22E15EA516F08 /* Pods_Tests.framework */, 128 | ); 129 | name = Frameworks; 130 | sourceTree = ""; 131 | }; 132 | 6003F593195388D20070C39A /* SMLElevationView */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 6003F59C195388D20070C39A /* SMLAppDelegate.h */, 136 | 6003F59D195388D20070C39A /* SMLAppDelegate.m */, 137 | 6003F59F195388D20070C39A /* Main_iPhone.storyboard */, 138 | 6003F5A2195388D20070C39A /* Main_iPad.storyboard */, 139 | 6003F5A5195388D20070C39A /* SMLViewController.h */, 140 | 6003F5A6195388D20070C39A /* SMLViewController.m */, 141 | 6003F5A8195388D20070C39A /* Images.xcassets */, 142 | 6003F594195388D20070C39A /* Supporting Files */, 143 | ); 144 | path = SMLElevationView; 145 | sourceTree = ""; 146 | }; 147 | 6003F594195388D20070C39A /* Supporting Files */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 6003F595195388D20070C39A /* SMLElevationView-Info.plist */, 151 | 6003F596195388D20070C39A /* InfoPlist.strings */, 152 | 6003F599195388D20070C39A /* main.m */, 153 | 6003F59B195388D20070C39A /* SMLElevationView-Prefix.pch */, 154 | ); 155 | name = "Supporting Files"; 156 | sourceTree = ""; 157 | }; 158 | 6003F5B5195388D20070C39A /* Tests */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | 6003F5BB195388D20070C39A /* Tests.m */, 162 | 6003F5B6195388D20070C39A /* Supporting Files */, 163 | ); 164 | path = Tests; 165 | sourceTree = ""; 166 | }; 167 | 6003F5B6195388D20070C39A /* Supporting Files */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | 6003F5B7195388D20070C39A /* Tests-Info.plist */, 171 | 6003F5B8195388D20070C39A /* InfoPlist.strings */, 172 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, 173 | ); 174 | name = "Supporting Files"; 175 | sourceTree = ""; 176 | }; 177 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { 178 | isa = PBXGroup; 179 | children = ( 180 | EA882FAE1CA6B36C169E02CB /* SMLElevationView.podspec */, 181 | FB639F184E706C8A5C6AB5F0 /* README.md */, 182 | FD5B5F4AE4C5D2F5C0E631FB /* LICENSE */, 183 | ); 184 | name = "Podspec Metadata"; 185 | sourceTree = ""; 186 | }; 187 | 673DAE3B9B791F7FE369D967 /* Pods */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | 5DAC4561E8BF5EC01EE68809 /* Pods-SMLElevationView.debug.xcconfig */, 191 | 6E94481F1C9FA8F3A8EF1F89 /* Pods-SMLElevationView.release.xcconfig */, 192 | 7F94F4E3682C94C107B02E89 /* Pods-Tests.debug.xcconfig */, 193 | BEE06A7321C416811BA1AC6C /* Pods-Tests.release.xcconfig */, 194 | ); 195 | name = Pods; 196 | sourceTree = ""; 197 | }; 198 | /* End PBXGroup section */ 199 | 200 | /* Begin PBXNativeTarget section */ 201 | 6003F589195388D20070C39A /* SMLElevationView */ = { 202 | isa = PBXNativeTarget; 203 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SMLElevationView" */; 204 | buildPhases = ( 205 | ECCF2DA4AECFAD5BB4762FDA /* Check Pods Manifest.lock */, 206 | 6003F586195388D20070C39A /* Sources */, 207 | 6003F587195388D20070C39A /* Frameworks */, 208 | 6003F588195388D20070C39A /* Resources */, 209 | 9C59A9B498D155A7E5C185D7 /* Copy Pods Resources */, 210 | 5440CDD0AC4E22716B178B0D /* Embed Pods Frameworks */, 211 | ); 212 | buildRules = ( 213 | ); 214 | dependencies = ( 215 | ); 216 | name = SMLElevationView; 217 | productName = SMLElevationView; 218 | productReference = 6003F58A195388D20070C39A /* SMLElevationView.app */; 219 | productType = "com.apple.product-type.application"; 220 | }; 221 | 6003F5AD195388D20070C39A /* Tests */ = { 222 | isa = PBXNativeTarget; 223 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "Tests" */; 224 | buildPhases = ( 225 | 6D80F11996A88310E1D4197C /* Check Pods Manifest.lock */, 226 | 6003F5AA195388D20070C39A /* Sources */, 227 | 6003F5AB195388D20070C39A /* Frameworks */, 228 | 6003F5AC195388D20070C39A /* Resources */, 229 | 0812FDA9EFD2E879ED3132F2 /* Copy Pods Resources */, 230 | B66EC0E9C6CE3AB5656F0B01 /* Embed Pods Frameworks */, 231 | ); 232 | buildRules = ( 233 | ); 234 | dependencies = ( 235 | 6003F5B4195388D20070C39A /* PBXTargetDependency */, 236 | ); 237 | name = Tests; 238 | productName = SMLElevationViewTests; 239 | productReference = 6003F5AE195388D20070C39A /* Tests.xctest */; 240 | productType = "com.apple.product-type.bundle.unit-test"; 241 | }; 242 | /* End PBXNativeTarget section */ 243 | 244 | /* Begin PBXProject section */ 245 | 6003F582195388D10070C39A /* Project object */ = { 246 | isa = PBXProject; 247 | attributes = { 248 | CLASSPREFIX = SML; 249 | LastUpgradeCheck = 0510; 250 | ORGANIZATIONNAME = "George Kiriy"; 251 | TargetAttributes = { 252 | 6003F5AD195388D20070C39A = { 253 | TestTargetID = 6003F589195388D20070C39A; 254 | }; 255 | }; 256 | }; 257 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "SMLElevationView" */; 258 | compatibilityVersion = "Xcode 3.2"; 259 | developmentRegion = English; 260 | hasScannedForEncodings = 0; 261 | knownRegions = ( 262 | en, 263 | Base, 264 | ); 265 | mainGroup = 6003F581195388D10070C39A; 266 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 267 | projectDirPath = ""; 268 | projectRoot = ""; 269 | targets = ( 270 | 6003F589195388D20070C39A /* SMLElevationView */, 271 | 6003F5AD195388D20070C39A /* Tests */, 272 | ); 273 | }; 274 | /* End PBXProject section */ 275 | 276 | /* Begin PBXResourcesBuildPhase section */ 277 | 6003F588195388D20070C39A /* Resources */ = { 278 | isa = PBXResourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | 6003F5A4195388D20070C39A /* Main_iPad.storyboard in Resources */, 282 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 283 | 6003F5A1195388D20070C39A /* Main_iPhone.storyboard in Resources */, 284 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | }; 288 | 6003F5AC195388D20070C39A /* Resources */ = { 289 | isa = PBXResourcesBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, 293 | ); 294 | runOnlyForDeploymentPostprocessing = 0; 295 | }; 296 | /* End PBXResourcesBuildPhase section */ 297 | 298 | /* Begin PBXShellScriptBuildPhase section */ 299 | 0812FDA9EFD2E879ED3132F2 /* Copy Pods Resources */ = { 300 | isa = PBXShellScriptBuildPhase; 301 | buildActionMask = 2147483647; 302 | files = ( 303 | ); 304 | inputPaths = ( 305 | ); 306 | name = "Copy Pods Resources"; 307 | outputPaths = ( 308 | ); 309 | runOnlyForDeploymentPostprocessing = 0; 310 | shellPath = /bin/sh; 311 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n"; 312 | showEnvVarsInLog = 0; 313 | }; 314 | 5440CDD0AC4E22716B178B0D /* Embed Pods Frameworks */ = { 315 | isa = PBXShellScriptBuildPhase; 316 | buildActionMask = 2147483647; 317 | files = ( 318 | ); 319 | inputPaths = ( 320 | ); 321 | name = "Embed Pods Frameworks"; 322 | outputPaths = ( 323 | ); 324 | runOnlyForDeploymentPostprocessing = 0; 325 | shellPath = /bin/sh; 326 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SMLElevationView/Pods-SMLElevationView-frameworks.sh\"\n"; 327 | showEnvVarsInLog = 0; 328 | }; 329 | 6D80F11996A88310E1D4197C /* Check Pods Manifest.lock */ = { 330 | isa = PBXShellScriptBuildPhase; 331 | buildActionMask = 2147483647; 332 | files = ( 333 | ); 334 | inputPaths = ( 335 | ); 336 | name = "Check Pods Manifest.lock"; 337 | outputPaths = ( 338 | ); 339 | runOnlyForDeploymentPostprocessing = 0; 340 | shellPath = /bin/sh; 341 | 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"; 342 | showEnvVarsInLog = 0; 343 | }; 344 | 9C59A9B498D155A7E5C185D7 /* Copy Pods Resources */ = { 345 | isa = PBXShellScriptBuildPhase; 346 | buildActionMask = 2147483647; 347 | files = ( 348 | ); 349 | inputPaths = ( 350 | ); 351 | name = "Copy Pods Resources"; 352 | outputPaths = ( 353 | ); 354 | runOnlyForDeploymentPostprocessing = 0; 355 | shellPath = /bin/sh; 356 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SMLElevationView/Pods-SMLElevationView-resources.sh\"\n"; 357 | showEnvVarsInLog = 0; 358 | }; 359 | B66EC0E9C6CE3AB5656F0B01 /* Embed Pods Frameworks */ = { 360 | isa = PBXShellScriptBuildPhase; 361 | buildActionMask = 2147483647; 362 | files = ( 363 | ); 364 | inputPaths = ( 365 | ); 366 | name = "Embed Pods Frameworks"; 367 | outputPaths = ( 368 | ); 369 | runOnlyForDeploymentPostprocessing = 0; 370 | shellPath = /bin/sh; 371 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh\"\n"; 372 | showEnvVarsInLog = 0; 373 | }; 374 | ECCF2DA4AECFAD5BB4762FDA /* Check Pods Manifest.lock */ = { 375 | isa = PBXShellScriptBuildPhase; 376 | buildActionMask = 2147483647; 377 | files = ( 378 | ); 379 | inputPaths = ( 380 | ); 381 | name = "Check Pods Manifest.lock"; 382 | outputPaths = ( 383 | ); 384 | runOnlyForDeploymentPostprocessing = 0; 385 | shellPath = /bin/sh; 386 | 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"; 387 | showEnvVarsInLog = 0; 388 | }; 389 | /* End PBXShellScriptBuildPhase section */ 390 | 391 | /* Begin PBXSourcesBuildPhase section */ 392 | 6003F586195388D20070C39A /* Sources */ = { 393 | isa = PBXSourcesBuildPhase; 394 | buildActionMask = 2147483647; 395 | files = ( 396 | 6003F59E195388D20070C39A /* SMLAppDelegate.m in Sources */, 397 | 6003F5A7195388D20070C39A /* SMLViewController.m in Sources */, 398 | 6003F59A195388D20070C39A /* main.m in Sources */, 399 | ); 400 | runOnlyForDeploymentPostprocessing = 0; 401 | }; 402 | 6003F5AA195388D20070C39A /* Sources */ = { 403 | isa = PBXSourcesBuildPhase; 404 | buildActionMask = 2147483647; 405 | files = ( 406 | 6003F5BC195388D20070C39A /* Tests.m in Sources */, 407 | ); 408 | runOnlyForDeploymentPostprocessing = 0; 409 | }; 410 | /* End PBXSourcesBuildPhase section */ 411 | 412 | /* Begin PBXTargetDependency section */ 413 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { 414 | isa = PBXTargetDependency; 415 | target = 6003F589195388D20070C39A /* SMLElevationView */; 416 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; 417 | }; 418 | /* End PBXTargetDependency section */ 419 | 420 | /* Begin PBXVariantGroup section */ 421 | 6003F596195388D20070C39A /* InfoPlist.strings */ = { 422 | isa = PBXVariantGroup; 423 | children = ( 424 | 6003F597195388D20070C39A /* en */, 425 | ); 426 | name = InfoPlist.strings; 427 | sourceTree = ""; 428 | }; 429 | 6003F59F195388D20070C39A /* Main_iPhone.storyboard */ = { 430 | isa = PBXVariantGroup; 431 | children = ( 432 | 6003F5A0195388D20070C39A /* Base */, 433 | ); 434 | name = Main_iPhone.storyboard; 435 | sourceTree = ""; 436 | }; 437 | 6003F5A2195388D20070C39A /* Main_iPad.storyboard */ = { 438 | isa = PBXVariantGroup; 439 | children = ( 440 | 6003F5A3195388D20070C39A /* Base */, 441 | ); 442 | name = Main_iPad.storyboard; 443 | sourceTree = ""; 444 | }; 445 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { 446 | isa = PBXVariantGroup; 447 | children = ( 448 | 6003F5B9195388D20070C39A /* en */, 449 | ); 450 | name = InfoPlist.strings; 451 | sourceTree = ""; 452 | }; 453 | /* End PBXVariantGroup section */ 454 | 455 | /* Begin XCBuildConfiguration section */ 456 | 6003F5BD195388D20070C39A /* Debug */ = { 457 | isa = XCBuildConfiguration; 458 | buildSettings = { 459 | ALWAYS_SEARCH_USER_PATHS = NO; 460 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 461 | CLANG_CXX_LIBRARY = "libc++"; 462 | CLANG_ENABLE_MODULES = YES; 463 | CLANG_ENABLE_OBJC_ARC = YES; 464 | CLANG_WARN_BOOL_CONVERSION = YES; 465 | CLANG_WARN_CONSTANT_CONVERSION = 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_INT_CONVERSION = YES; 470 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 471 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 472 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 473 | COPY_PHASE_STRIP = NO; 474 | GCC_C_LANGUAGE_STANDARD = gnu99; 475 | GCC_DYNAMIC_NO_PIC = NO; 476 | GCC_OPTIMIZATION_LEVEL = 0; 477 | GCC_PREPROCESSOR_DEFINITIONS = ( 478 | "DEBUG=1", 479 | "$(inherited)", 480 | ); 481 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 482 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 483 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 484 | GCC_WARN_UNDECLARED_SELECTOR = YES; 485 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 486 | GCC_WARN_UNUSED_FUNCTION = YES; 487 | GCC_WARN_UNUSED_VARIABLE = YES; 488 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 489 | ONLY_ACTIVE_ARCH = YES; 490 | SDKROOT = iphoneos; 491 | TARGETED_DEVICE_FAMILY = "1,2"; 492 | }; 493 | name = Debug; 494 | }; 495 | 6003F5BE195388D20070C39A /* Release */ = { 496 | isa = XCBuildConfiguration; 497 | buildSettings = { 498 | ALWAYS_SEARCH_USER_PATHS = NO; 499 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 500 | CLANG_CXX_LIBRARY = "libc++"; 501 | CLANG_ENABLE_MODULES = YES; 502 | CLANG_ENABLE_OBJC_ARC = YES; 503 | CLANG_WARN_BOOL_CONVERSION = YES; 504 | CLANG_WARN_CONSTANT_CONVERSION = YES; 505 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 506 | CLANG_WARN_EMPTY_BODY = YES; 507 | CLANG_WARN_ENUM_CONVERSION = YES; 508 | CLANG_WARN_INT_CONVERSION = YES; 509 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 510 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 511 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 512 | COPY_PHASE_STRIP = YES; 513 | ENABLE_NS_ASSERTIONS = NO; 514 | GCC_C_LANGUAGE_STANDARD = gnu99; 515 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 516 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 517 | GCC_WARN_UNDECLARED_SELECTOR = YES; 518 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 519 | GCC_WARN_UNUSED_FUNCTION = YES; 520 | GCC_WARN_UNUSED_VARIABLE = YES; 521 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 522 | SDKROOT = iphoneos; 523 | TARGETED_DEVICE_FAMILY = "1,2"; 524 | VALIDATE_PRODUCT = YES; 525 | }; 526 | name = Release; 527 | }; 528 | 6003F5C0195388D20070C39A /* Debug */ = { 529 | isa = XCBuildConfiguration; 530 | baseConfigurationReference = 5DAC4561E8BF5EC01EE68809 /* Pods-SMLElevationView.debug.xcconfig */; 531 | buildSettings = { 532 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 533 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 534 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 535 | GCC_PREFIX_HEADER = "SMLElevationView/SMLElevationView-Prefix.pch"; 536 | INFOPLIST_FILE = "SMLElevationView/SMLElevationView-Info.plist"; 537 | PRODUCT_NAME = "$(TARGET_NAME)"; 538 | WRAPPER_EXTENSION = app; 539 | }; 540 | name = Debug; 541 | }; 542 | 6003F5C1195388D20070C39A /* Release */ = { 543 | isa = XCBuildConfiguration; 544 | baseConfigurationReference = 6E94481F1C9FA8F3A8EF1F89 /* Pods-SMLElevationView.release.xcconfig */; 545 | buildSettings = { 546 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 547 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 548 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 549 | GCC_PREFIX_HEADER = "SMLElevationView/SMLElevationView-Prefix.pch"; 550 | INFOPLIST_FILE = "SMLElevationView/SMLElevationView-Info.plist"; 551 | PRODUCT_NAME = "$(TARGET_NAME)"; 552 | WRAPPER_EXTENSION = app; 553 | }; 554 | name = Release; 555 | }; 556 | 6003F5C3195388D20070C39A /* Debug */ = { 557 | isa = XCBuildConfiguration; 558 | baseConfigurationReference = 7F94F4E3682C94C107B02E89 /* Pods-Tests.debug.xcconfig */; 559 | buildSettings = { 560 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SMLElevationView.app/SMLElevationView"; 561 | FRAMEWORK_SEARCH_PATHS = ( 562 | "$(SDKROOT)/Developer/Library/Frameworks", 563 | "$(inherited)", 564 | "$(DEVELOPER_FRAMEWORKS_DIR)", 565 | ); 566 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 567 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 568 | GCC_PREPROCESSOR_DEFINITIONS = ( 569 | "DEBUG=1", 570 | "$(inherited)", 571 | ); 572 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 573 | PRODUCT_NAME = "$(TARGET_NAME)"; 574 | TEST_HOST = "$(BUNDLE_LOADER)"; 575 | WRAPPER_EXTENSION = xctest; 576 | }; 577 | name = Debug; 578 | }; 579 | 6003F5C4195388D20070C39A /* Release */ = { 580 | isa = XCBuildConfiguration; 581 | baseConfigurationReference = BEE06A7321C416811BA1AC6C /* Pods-Tests.release.xcconfig */; 582 | buildSettings = { 583 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SMLElevationView.app/SMLElevationView"; 584 | FRAMEWORK_SEARCH_PATHS = ( 585 | "$(SDKROOT)/Developer/Library/Frameworks", 586 | "$(inherited)", 587 | "$(DEVELOPER_FRAMEWORKS_DIR)", 588 | ); 589 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 590 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 591 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 592 | PRODUCT_NAME = "$(TARGET_NAME)"; 593 | TEST_HOST = "$(BUNDLE_LOADER)"; 594 | WRAPPER_EXTENSION = xctest; 595 | }; 596 | name = Release; 597 | }; 598 | /* End XCBuildConfiguration section */ 599 | 600 | /* Begin XCConfigurationList section */ 601 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "SMLElevationView" */ = { 602 | isa = XCConfigurationList; 603 | buildConfigurations = ( 604 | 6003F5BD195388D20070C39A /* Debug */, 605 | 6003F5BE195388D20070C39A /* Release */, 606 | ); 607 | defaultConfigurationIsVisible = 0; 608 | defaultConfigurationName = Release; 609 | }; 610 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SMLElevationView" */ = { 611 | isa = XCConfigurationList; 612 | buildConfigurations = ( 613 | 6003F5C0195388D20070C39A /* Debug */, 614 | 6003F5C1195388D20070C39A /* Release */, 615 | ); 616 | defaultConfigurationIsVisible = 0; 617 | defaultConfigurationName = Release; 618 | }; 619 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "Tests" */ = { 620 | isa = XCConfigurationList; 621 | buildConfigurations = ( 622 | 6003F5C3195388D20070C39A /* Debug */, 623 | 6003F5C4195388D20070C39A /* Release */, 624 | ); 625 | defaultConfigurationIsVisible = 0; 626 | defaultConfigurationName = Release; 627 | }; 628 | /* End XCConfigurationList section */ 629 | }; 630 | rootObject = 6003F582195388D10070C39A /* Project object */; 631 | } 632 | -------------------------------------------------------------------------------- /Example/SMLElevationView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/SMLElevationView.xcodeproj/xcshareddata/xcschemes/SMLElevationView-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Example/SMLElevationView/Base.lproj/Main_iPad.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 | -------------------------------------------------------------------------------- /Example/SMLElevationView/Base.lproj/Main_iPhone.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 | -------------------------------------------------------------------------------- /Example/SMLElevationView/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" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Example/SMLElevationView/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Example/SMLElevationView/SMLAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SMLAppDelegate.h 3 | // SMLElevationView 4 | // 5 | // Created by CocoaPods on 04/24/2015. 6 | // Copyright (c) 2014 George Kiriy. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SMLAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/SMLElevationView/SMLAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // SMLAppDelegate.m 3 | // SMLElevationView 4 | // 5 | // Created by CocoaPods on 04/24/2015. 6 | // Copyright (c) 2014 George Kiriy. All rights reserved. 7 | // 8 | 9 | #import "SMLAppDelegate.h" 10 | 11 | @implementation SMLAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 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 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/SMLElevationView/SMLElevationView-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main_iPhone 29 | UIMainStoryboardFile~ipad 30 | Main_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/SMLElevationView/SMLElevationView-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/SMLElevationView/SMLViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SMLViewController.h 3 | // SMLElevationView 4 | // 5 | // Created by George Kiriy on 04/24/2015. 6 | // Copyright (c) 2014 George Kiriy. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SMLViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/SMLElevationView/SMLViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SMLViewController.m 3 | // SMLElevationView 4 | // 5 | // Created by George Kiriy on 04/24/2015. 6 | // Copyright (c) 2014 George Kiriy. All rights reserved. 7 | // 8 | 9 | #import "SMLViewController.h" 10 | #import "SMLElevationView.h" 11 | #import 12 | 13 | @interface SMLViewController () 14 | @property (weak, nonatomic) IBOutlet SMLElevationView *elevationView; 15 | @end 16 | 17 | @implementation SMLViewController 18 | 19 | - (void)viewDidLoad 20 | { 21 | [super viewDidLoad]; 22 | 23 | self.elevationView.font = [UIFont systemFontOfSize:[UIFont systemFontSize]]; 24 | 25 | NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:[@"http://maps.googleapis.com/maps/api/elevation/json?path=36.578581,-118.291994|36.23998,-116.83171&samples=200&sensor=true_or_false" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; 26 | 27 | [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { 28 | NSError *error; 29 | NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error]; 30 | if (!error) 31 | { 32 | NSMutableArray *locations = [NSMutableArray array]; 33 | 34 | for(NSDictionary * pt in dict[@"results"]) 35 | { 36 | CLLocation *loc = [[CLLocation alloc] initWithCoordinate:CLLocationCoordinate2DMake([pt[@"location"][@"lat"] doubleValue], [pt[@"location"][@"lng"] doubleValue]) altitude:[pt[@"elevation"] doubleValue] horizontalAccuracy:1 verticalAccuracy:1 timestamp:[NSDate new]]; 37 | [locations addObject:loc]; 38 | } 39 | 40 | self.elevationView.path = locations; 41 | } 42 | }]; 43 | } 44 | 45 | - (void)didReceiveMemoryWarning 46 | { 47 | [super didReceiveMemoryWarning]; 48 | // Dispose of any resources that can be recreated. 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Example/SMLElevationView/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/SMLElevationView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SMLElevationView 4 | // 5 | // Created by George Kiriy on 04/24/2015. 6 | // Copyright (c) 2014 George Kiriy. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "SMLAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([SMLAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/Tests/Tests-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 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every test case source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | 9 | #import 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SMLElevationViewTests.m 3 | // SMLElevationViewTests 4 | // 5 | // Created by George Kiriy on 04/24/2015. 6 | // Copyright (c) 2014 George Kiriy. All rights reserved. 7 | // 8 | 9 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 George Kiriy 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 | -------------------------------------------------------------------------------- /Pod/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpsnp/SMLElevationView/8133cee20bc481c7ca85f03db5e2534fe906eea4/Pod/Assets/.gitkeep -------------------------------------------------------------------------------- /Pod/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpsnp/SMLElevationView/8133cee20bc481c7ca85f03db5e2534fe906eea4/Pod/Classes/.gitkeep -------------------------------------------------------------------------------- /Pod/Classes/SMLElevationView.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | Units of measurement for display. 5 | */ 6 | typedef enum : NSUInteger { 7 | /** 8 | * Metric units. Altitude in meters, distance in kilometers. 9 | */ 10 | SMLElevationViewUnitsMetric, 11 | /** 12 | * Imperial units. Altitude in feet, distance in miles. 13 | */ 14 | SMLElevationViewUnitsImperial 15 | } SMLElevationViewUnits; 16 | 17 | IB_DESIGNABLE 18 | 19 | /** 20 | * View that displays elevation profile of path. 21 | */ 22 | @interface SMLElevationView : UIView 23 | 24 | /** 25 | * Color of elevation profile line 26 | */ 27 | @property (strong, nonatomic) IBInspectable UIColor *strokeColor; 28 | 29 | /** 30 | * Color of fill under elevation profile 31 | */ 32 | @property (strong, nonatomic) IBInspectable UIColor *fillColor; 33 | 34 | /** 35 | * Color of grid lines 36 | */ 37 | @property (strong, nonatomic) IBInspectable UIColor *gridColor; 38 | 39 | /** 40 | * Color of labels under grid lines 41 | */ 42 | @property (strong, nonatomic) IBInspectable UIColor *labelsColor; 43 | 44 | /** 45 | * Font of labels 46 | */ 47 | @property (strong, nonatomic) UIFont *font; 48 | 49 | /** 50 | * Count of horisontal grid segments 51 | */ 52 | @property (nonatomic) IBInspectable NSUInteger distanceSegments; 53 | 54 | /** 55 | * Count of vertical grid segments 56 | */ 57 | @property (nonatomic) IBInspectable NSUInteger altitudeSegments; 58 | 59 | /** 60 | * Width of elevation profile line 61 | */ 62 | @property (nonatomic) IBInspectable NSUInteger lineWidth; 63 | 64 | /** 65 | * Width of grid lines 66 | */ 67 | @property (nonatomic) IBInspectable NSUInteger gridWidth; 68 | 69 | /** 70 | * Array of CLLocations that represent path 71 | */ 72 | @property (strong, nonatomic) NSArray *path; 73 | 74 | /** 75 | * Units of measurement 76 | */ 77 | @property (nonatomic) SMLElevationViewUnits units; 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Pod/Classes/SMLElevationView.m: -------------------------------------------------------------------------------- 1 | #import"SMLElevationView.h" 2 | #import 3 | 4 | CGFloat const METERS_TO_FEET = 3.2808399; 5 | CGFloat const METERS_TO_MILES = 0.000621371192; 6 | CGFloat const METERS_TO_KILOMETERS = 0.001; 7 | 8 | @interface SMLElevationView() 9 | 10 | @property (nonatomic, readonly) CGFloat lowPoint; 11 | @property (nonatomic, readonly) CGFloat highPoint; 12 | @property (nonatomic, readonly) CGFloat distance; 13 | @property (nonatomic, readonly) CGFloat elevationDelta; 14 | 15 | 16 | @end 17 | 18 | @implementation SMLElevationView 19 | 20 | #pragma mark - Init 21 | 22 | - (id)initWithCoder:(NSCoder*)aDecoder 23 | { 24 | if(self = [super initWithCoder:aDecoder]) 25 | { 26 | [self setup]; 27 | } 28 | return self; 29 | } 30 | 31 | - (instancetype)init 32 | { 33 | if(self = [super init]) 34 | { 35 | [self setup]; 36 | } 37 | return self; 38 | } 39 | 40 | - (instancetype)initWithFrame:(CGRect)frame 41 | { 42 | if(self = [super initWithFrame:frame]) 43 | { 44 | [self setup]; 45 | } 46 | return self; 47 | } 48 | 49 | - (void)setup 50 | { 51 | _strokeColor = [UIColor orangeColor]; 52 | _fillColor = [UIColor colorWithRed:1.0 green:0.5 blue:0.0 alpha:0.5]; 53 | _gridColor = [UIColor grayColor]; 54 | _labelsColor = [UIColor whiteColor]; 55 | _font = [UIFont systemFontOfSize:8]; 56 | _distanceSegments = 5; 57 | _altitudeSegments = 4; 58 | _lineWidth = 2; 59 | _gridWidth = 1; 60 | } 61 | 62 | #pragma mark - Interfacebuilder 63 | 64 | - (void)prepareForInterfaceBuilder 65 | { 66 | NSDictionary *dict = @{@"results":@[@{@"elevation":@4350.96044921875,@"location":@{@"lat":@36.578581,@"lng":@-118.291994},@"resolution":@305.4064636230469},@{@"elevation":@3401.97509765625,@"location":@{@"lat":@36.56120453108409,@"lng":@-118.2148210871541},@"resolution":@305.4064636230469},@{@"elevation":@1718.481567382812,@"location":@{@"lat":@36.54377835025277,@"lng":@-118.1376829307608},@"resolution":@305.4064636230469},@{@"elevation":@1297.453491210938,@"location":@{@"lat":@36.52630251149865,@"lng":@-118.0605795922009},@"resolution":@305.4064636230469},@{@"elevation":@1083.901000976562,@"location":@{@"lat":@36.50877706890078,@"lng":@-117.9835111324712},@"resolution":@305.4064636230469},@{@"elevation":@1086.812866210938,@"location":@{@"lat":@36.49120207662418,@"lng":@-117.9064776121845},@"resolution":@305.4064636230469},@{@"elevation":@1280.449096679688,@"location":@{@"lat":@36.47357758891917,@"lng":@-117.8294790915696},@"resolution":@305.4064636230469},@{@"elevation":@2149.911865234375,@"location":@{@"lat":@36.4559036601207,@"lng":@-117.7525156304715},@"resolution":@305.4064636230469},@{@"elevation":@1629.696166992188,@"location":@{@"lat":@36.43818034464772,@"lng":@-117.6755872883518},@"resolution":@305.4064636230469},@{@"elevation":@1469.10205078125,@"location":@{@"lat":@36.42040769700269,@"lng":@-117.5986941242883},@"resolution":@305.4064636230469},@{@"elevation":@1164.840698242188,@"location":@{@"lat":@36.40258577177073,@"lng":@-117.5218361969757},@"resolution":@305.4064636230469},@{@"elevation":@486.82568359375,@"location":@{@"lat":@36.38471462361922,@"lng":@-117.4450135647253},@"resolution":@305.4064636230469},@{@"elevation":@560.2628784179688,@"location":@{@"lat":@36.36679430729701,@"lng":@-117.3682262854655},@"resolution":@305.4064636230469},@{@"elevation":@1211.659790039062,@"location":@{@"lat":@36.34882487763383,@"lng":@-117.2914744167416},@"resolution":@305.4064636230469},@{@"elevation":@1870.713256835938,@"location":@{@"lat":@36.3308063895398,@"lng":@-117.2147580157163},@"resolution":@305.4064636230469},@{@"elevation":@1731.371704101562,@"location":@{@"lat":@36.3127388980046,@"lng":@-117.13807713917},@"resolution":@305.4064636230469},@{@"elevation":@1865.640869140625,@"location":@{@"lat":@36.29462245809699,@"lng":@-117.0614318435005},@"resolution":@305.4064636230469},@{@"elevation":@934.2860717773438,@"location":@{@"lat":@36.27645712496418,@"lng":@-116.9848221847234},@"resolution":@305.4064636230469},@{@"elevation":@46.81528091430664,@"location":@{@"lat":@36.25824295383111,@"lng":@-116.9082482184725},@"resolution":@305.4064636230469},@{@"elevation":@-84.61699676513672,@"location":@{@"lat":@36.23998,@"lng":@-116.83171},@"resolution":@305.4064636230469}],@"status":@"OK"}; 67 | 68 | NSMutableArray *locations = [NSMutableArray array]; 69 | 70 | for(NSDictionary * pt in dict[@"results"]) 71 | { 72 | CLLocation *loc = [[CLLocation alloc] initWithCoordinate:CLLocationCoordinate2DMake([pt[@"location"][@"lat"] doubleValue], [pt[@"location"][@"lng"] doubleValue]) altitude:[pt[@"elevation"] doubleValue] horizontalAccuracy:1 verticalAccuracy:1 timestamp:[NSDate new]]; 73 | [locations addObject:loc]; 74 | } 75 | 76 | self.path = locations; 77 | } 78 | 79 | #pragma mark - Setters 80 | 81 | - (void)setUnits:(SMLElevationViewUnits)units 82 | { 83 | _units = units; 84 | [self setNeedsDisplay]; 85 | } 86 | 87 | - (void)setPath:(NSArray *)points 88 | { 89 | _path = points; 90 | 91 | CLLocation *firstPoint = [points firstObject]; 92 | 93 | _lowPoint = firstPoint.altitude; 94 | _highPoint = firstPoint.altitude; 95 | _distance = 0; 96 | 97 | CLLocation *prevLocation = firstPoint; 98 | for (CLLocation *newLocation in points) 99 | { 100 | double elevation = newLocation.altitude; 101 | if (elevation > self.highPoint) 102 | _highPoint = elevation; 103 | if (elevation < self.lowPoint) 104 | _lowPoint = elevation; 105 | 106 | _distance += [newLocation distanceFromLocation:prevLocation]; 107 | 108 | prevLocation = newLocation; 109 | } 110 | 111 | _elevationDelta = _highPoint-_lowPoint; 112 | 113 | [self setNeedsDisplay]; 114 | } 115 | 116 | #pragma mark - Calculations 117 | 118 | - (CGFloat)getYofPoint:(CLLocation *)point inRect:(CGRect)rect 119 | { 120 | return rect.origin.y + rect.size.height - [self getNormalizedElevationOfPoint:point] * rect.size.height; 121 | } 122 | 123 | - (CGFloat)getNormalizedElevationOfPoint:(CLLocation *)point 124 | { 125 | CGFloat result = 0; 126 | if (self.lowPoint < INFINITY) 127 | { 128 | if (self.elevationDelta == 0) 129 | result = self.lowPoint; 130 | else 131 | result = (point.altitude - self.lowPoint) / self.elevationDelta; 132 | } 133 | return result; 134 | } 135 | 136 | #pragma mark - Labelsconstructing 137 | 138 | - (NSAttributedString *)makeLabelForFloat:(CGFloat)number withPrecision:(CGFloat)precision andPostfix:(NSString *)postfix 139 | { 140 | NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; 141 | formatter.roundingIncrement = [NSNumber numberWithDouble:precision]; 142 | formatter.numberStyle = NSNumberFormatterDecimalStyle; 143 | 144 | NSString *labelText = [[formatter stringFromNumber:[NSNumber numberWithDouble:number]] stringByAppendingString:postfix]; 145 | return [[NSAttributedString alloc] initWithString:labelText attributes:@{NSFontAttributeName:self.font, NSForegroundColorAttributeName:self.labelsColor}]; 146 | } 147 | 148 | - (NSAttributedString *)makeLabelForAltitude:(CGFloat)altitude 149 | { 150 | NSAttributedString *result = nil; 151 | 152 | switch (self.units) 153 | { 154 | case SMLElevationViewUnitsImperial: 155 | result = [self makeLabelForFloat:altitude * METERS_TO_FEET withPrecision:1 andPostfix:@"ft"]; 156 | break; 157 | case SMLElevationViewUnitsMetric: 158 | result = [self makeLabelForFloat:altitude withPrecision:1 andPostfix:@"m"]; 159 | break; 160 | default: 161 | break; 162 | } 163 | 164 | return result; 165 | } 166 | 167 | - (NSAttributedString *)makeLabelForDistance:(CGFloat)distance 168 | { 169 | NSAttributedString *result = nil; 170 | 171 | switch (self.units) 172 | { 173 | case SMLElevationViewUnitsImperial: 174 | result = [self makeLabelForFloat:distance * METERS_TO_MILES withPrecision:0.1 andPostfix:@"mi"]; 175 | break; 176 | case SMLElevationViewUnitsMetric: 177 | result = [self makeLabelForFloat:distance * METERS_TO_KILOMETERS withPrecision:0.1 andPostfix:@"km"]; 178 | break; 179 | default: 180 | break; 181 | } 182 | 183 | return result; 184 | } 185 | 186 | #pragma mark - Drawing 187 | 188 | - (void)drawHorisontalLineWithRatio:(CGFloat)ratio inRect:(CGRect)rect andLabel:(BOOL)drawLabel 189 | { 190 | UIBezierPath *path = [[UIBezierPath alloc] init]; 191 | 192 | [path moveToPoint:CGPointMake(rect.origin.x, rect.origin.y + rect.size.height * ratio)]; 193 | [path addLineToPoint:CGPointMake(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height * ratio)]; 194 | 195 | [self.gridColor setStroke]; 196 | [path setLineWidth:self.gridWidth]; 197 | [path stroke]; 198 | 199 | if (drawLabel) 200 | { 201 | NSAttributedString *label = [self makeLabelForAltitude:self.highPoint - self.elevationDelta * ratio]; 202 | [label drawAtPoint:CGPointMake(rect.origin.x - label.size.width - 2, rect.origin.y + rect.size.height * ratio - label.size.height / 2)]; 203 | } 204 | } 205 | 206 | - (void)drawVerticalLineWithRatio:(CGFloat)ratio inRect:(CGRect)rect andLabel:(BOOL)drawLabel 207 | { 208 | UIBezierPath *path = [[UIBezierPath alloc] init]; 209 | 210 | [path moveToPoint:CGPointMake(rect.origin.x + rect.size.width * ratio, rect.origin.y)]; 211 | [path addLineToPoint:CGPointMake(rect.origin.x + rect.size.width * ratio, rect.origin.y + rect.size.height)]; 212 | 213 | [self.gridColor setStroke]; 214 | [path setLineWidth:self.gridWidth]; 215 | [path stroke]; 216 | 217 | if (drawLabel) 218 | { 219 | NSAttributedString *label = [self makeLabelForDistance:self.distance * ratio]; 220 | [label drawAtPoint:CGPointMake(rect.origin.x + rect.size.width * ratio - label.size.width / 2, rect.origin.y + rect.size.height)]; 221 | } 222 | } 223 | 224 | - (void)drawNetInRect:(CGRect)rect 225 | { 226 | 227 | for (CGFloat i = 0; i <= 1; i += 1.0 / self.altitudeSegments) 228 | [self drawHorisontalLineWithRatio:i inRect:rect andLabel:YES]; 229 | for (CGFloat i = 0; i <= 1; i += 1.0 / self.distanceSegments) 230 | [self drawVerticalLineWithRatio:i inRect:rect andLabel:(i > 0)]; 231 | } 232 | 233 | - (void)drawGraphicInRect:(CGRect)rect 234 | { 235 | UIBezierPath *path = [[UIBezierPath alloc] init]; 236 | double x = rect.origin.x; 237 | 238 | CLLocation *prevLocation = [self.path firstObject]; 239 | 240 | CGPoint currentPoint = CGPointMake(x, [self getYofPoint:prevLocation inRect:rect]); 241 | [path moveToPoint:currentPoint]; 242 | 243 | for(CLLocation *newLocation in self.path) 244 | { 245 | x += [newLocation distanceFromLocation:prevLocation] / _distance * rect.size.width; 246 | currentPoint = CGPointMake(x, [self getYofPoint:newLocation inRect:rect]); 247 | [path addLineToPoint:currentPoint]; 248 | prevLocation = newLocation; 249 | } 250 | [self.strokeColor setStroke]; 251 | [self.fillColor setFill]; 252 | 253 | [path setLineWidth:self.lineWidth]; 254 | [path setLineJoinStyle:kCGLineJoinRound]; 255 | [path setLineCapStyle:kCGLineCapRound]; 256 | [path stroke]; 257 | 258 | currentPoint = CGPointMake(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height); 259 | [path addLineToPoint:currentPoint]; 260 | currentPoint = CGPointMake(rect.origin.x, rect.origin.y + rect.size.height); 261 | [path addLineToPoint:currentPoint]; 262 | [path fill]; 263 | } 264 | 265 | - (void)drawRect:(CGRect)rect 266 | { 267 | NSAttributedString *altitudeLabel = [self makeLabelForAltitude:self.highPoint]; 268 | NSAttributedString *distanceLabel = [self makeLabelForDistance:self.distance]; 269 | CGFloat altitudeLabelWidthWithInsets = altitudeLabel.size.width + 4; 270 | CGFloat halfLabelHeight = altitudeLabel.size.height * 0.5; 271 | CGRect graphicRect = CGRectMake(rect.origin.x + altitudeLabelWidthWithInsets, 272 | rect.origin.y + halfLabelHeight, 273 | rect.size.width - altitudeLabelWidthWithInsets - distanceLabel.size.width * 0.5 - 2, 274 | rect.size.height - halfLabelHeight * 3); 275 | [self drawNetInRect:graphicRect]; 276 | [self drawGraphicInRect:graphicRect]; 277 | } 278 | 279 | @end 280 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SMLElevationView 2 | 3 | [![CI Status](http://img.shields.io/travis/mpsnp/SMLElevationView.svg?style=flat)](https://travis-ci.org/mpsnp/SMLElevationView) 4 | [![Version](https://img.shields.io/cocoapods/v/SMLElevationView.svg?style=flat)](http://cocoapods.org/pods/SMLElevationView) 5 | [![License](https://img.shields.io/cocoapods/l/SMLElevationView.svg?style=flat)](http://cocoapods.org/pods/SMLElevationView) 6 | [![Platform](https://img.shields.io/cocoapods/p/SMLElevationView.svg?style=flat)](http://cocoapods.org/pods/SMLElevationView) 7 | 8 | ![Screenshot](http://i57.fastpic.ru/big/2015/0504/ed/a15997f92836aaf5f8212cbd7e4543ed.png) 9 | 10 | View was designed for displaying elevation profile of trip. It is fully configurable, you can: 11 | 12 | - Change colors of 13 | - Labels' 14 | - Grid 15 | - Stroke of profile 16 | - Fill of profile 17 | - Change widths of 18 | - Grid lines 19 | - Profile line 20 | - Switch between metric and imperial units. 21 | - Specify how many horisontal and vertical lines of grid you need 22 | 23 | View is `IB_DESIGNABLE` and all of its key properties are `IBInspectable`. 24 | 25 | View supports resizing and was designed for use with autolayout. 26 | 27 | ## Installation 28 | 29 | SMLElevationView is available through [CocoaPods](http://cocoapods.org). To install 30 | it, simply add the following line to your Podfile: 31 | 32 | ```ruby 33 | pod "SMLElevationView" 34 | ``` 35 | 36 | ## Author 37 | 38 | George Kiriy, gkiriy@smedialink.com 39 | 40 | ## License 41 | 42 | SMLElevationView is available under the MIT license. See the LICENSE file for more info. 43 | -------------------------------------------------------------------------------- /SMLElevationView.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint SMLElevationView.podspec' to ensure this is a 3 | # valid spec and remove all comments before submitting the spec. 4 | # 5 | # Any lines starting with a # are optional, but encouraged 6 | # 7 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 8 | # 9 | 10 | Pod::Spec.new do |s| 11 | s.name = "SMLElevationView" 12 | s.version = "0.1.3" 13 | s.summary = "View for display elevation profile of trip." 14 | s.description = <<-DESC 15 | 16 | View was designed for displaying elevation profile of trip. It is fully configurable, you can: 17 | 18 | - Change colors of 19 | - Labels' 20 | - Grid 21 | - Stroke of profile 22 | - Fill of profile 23 | - Change widths of 24 | - Grid lines 25 | - Profile line 26 | - Switch between metric and imperial units. 27 | - Specify how many horisontal and vertical lines of grid you need 28 | 29 | View is `IB_DESIGNABLE` and all of its key properties are `IBInspectable`. 30 | 31 | View supports resizing and was designed for use with autolayout. 32 | 33 | DESC 34 | s.homepage = "https://github.com/mpsnp/SMLElevationView" 35 | s.screenshots = "http://i57.fastpic.ru/big/2015/0504/cd/32ec673495aaba27bc6b3b74e40609cd.png", "http://i57.fastpic.ru/big/2015/0504/ed/a15997f92836aaf5f8212cbd7e4543ed.png" 36 | s.license = 'MIT' 37 | s.author = { "George Kiriy" => "gkiriy@smedialink.com" } 38 | s.source = { :git => "https://github.com/mpsnp/SMLElevationView.git", :tag => s.version.to_s } 39 | # s.social_media_url = 'https://twitter.com/' 40 | 41 | s.platform = :ios, '7.0' 42 | s.requires_arc = true 43 | 44 | s.source_files = 'Pod/Classes/**/*' 45 | # s.resource_bundles = { 46 | # 'SMLElevationView' => ['Pod/Assets/*.png'] 47 | # } 48 | 49 | s.public_header_files = 'Pod/Classes/**/*.h' 50 | s.frameworks = 'CoreLocation' 51 | end 52 | --------------------------------------------------------------------------------