├── LICENSE ├── README.md ├── SvpplyTable.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── SvpplyTable.xccheckout │ └── xcuserdata │ │ └── liuminqian.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── liuminqian.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── SvpplyTable.xcscheme │ └── xcschememanagement.plist ├── SvpplyTable ├── .DS_Store ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── Resources │ └── categories.json ├── STAppDelegate.h ├── STAppDelegate.m ├── STCategory.h ├── STCategory.m ├── STTableViewCell.h ├── STTableViewCell.m ├── STTableViewController.h ├── STTableViewController.m ├── SvpplyTable-Info.plist ├── SvpplyTable-Prefix.pch ├── UIColor+HexString.h ├── UIColor+HexString.m ├── Vendors │ └── .DS_Store ├── en.lproj │ └── InfoPlist.strings └── main.m └── SvpplyTableTests ├── SvpplyTableTests-Info.plist ├── SvpplyTableTests.m └── en.lproj └── InfoPlist.strings /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Minqian Liu (http://liuminqian.github.io/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SvpplyTable 2 | =========== 3 | 4 | SvpplyTable is a demo to realize expandable and collapsable menu animation, Like Svpply app. 5 | 6 | ## How to Use 7 | 8 | You can replace categories.json with your content. And you should follow categories.json format. 9 | 10 | ## categories.json Format Sample 11 | 12 | 13 | 14 | 15 | {"meta":{ 16 | "status":200, 17 | "msg":"OK", 18 | "time":1335541016 19 | }, 20 | "response":{ 21 | "categories":[ 22 | { 23 | "name":"All Products", 24 | "url":"https:\/\/api.svpply.com\/v1\/shop.json", 25 | "text_color":"#000000", 26 | "border_color":"#000000", 27 | "children":[ 28 | { 29 | "name":"Men\u2019s", 30 | "url":"https:\/\/api.svpply.com\/v1\/shop\/mens.json", 31 | "text_color":"#FF5B54", 32 | "border_color":"#FFDEDD", 33 | "children":[ 34 | { 35 | "name":"Clothing", 36 | "url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing.json", 37 | "text_color":"#FF5B54", 38 | "border_color":"#FFDEDD" 39 | } 40 | ] 41 | } 42 | ] 43 | } 44 | ] 45 | } 46 | } 47 | 48 | 49 | 50 | ## Sample Screenshot 51 | ![](http://publicopensource.qiniudn.com/STable.gif) 52 | 53 | ## Contact 54 | 55 | Email: liuminqian0211@gmail.com 56 | 57 | ## Conclude 58 | 59 | This is my first opensource code, so I need your help to improve this repo. 60 | 61 | If you have any advice or problem, please contact me. 62 | 63 | ------ 64 | 65 | This project was made by Xcode5 DP2. If you want to use it in older Xcode, you need new project. 66 | 67 | Thank you for [devTang](http://blog.devtang.com/). 68 | 69 | ##License 70 | 71 | SvpplyTable are available under the MIT license. See the LICENSE file for more info. 72 | -------------------------------------------------------------------------------- /SvpplyTable.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2344B10317BB217F00C8A6D0 /* STTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2344B0FF17BA323C00C8A6D0 /* STTableViewCell.m */; }; 11 | 2344B10417BB218500C8A6D0 /* UIColor+HexString.m in Sources */ = {isa = PBXBuildFile; fileRef = 2344B10217BB215000C8A6D0 /* UIColor+HexString.m */; }; 12 | 23682FCF17BA068100A44E5F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23682FCE17BA068100A44E5F /* Foundation.framework */; }; 13 | 23682FD117BA068100A44E5F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23682FD017BA068100A44E5F /* CoreGraphics.framework */; }; 14 | 23682FD317BA068100A44E5F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23682FD217BA068100A44E5F /* UIKit.framework */; }; 15 | 23682FD917BA068100A44E5F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 23682FD717BA068100A44E5F /* InfoPlist.strings */; }; 16 | 23682FDB17BA068100A44E5F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 23682FDA17BA068100A44E5F /* main.m */; }; 17 | 23682FDF17BA068100A44E5F /* STAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 23682FDE17BA068100A44E5F /* STAppDelegate.m */; }; 18 | 23682FE117BA068100A44E5F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 23682FE017BA068100A44E5F /* Images.xcassets */; }; 19 | 23682FE817BA068100A44E5F /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23682FE717BA068100A44E5F /* XCTest.framework */; }; 20 | 23682FE917BA068100A44E5F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23682FCE17BA068100A44E5F /* Foundation.framework */; }; 21 | 23682FEA17BA068100A44E5F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23682FD217BA068100A44E5F /* UIKit.framework */; }; 22 | 23682FF217BA068100A44E5F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 23682FF017BA068100A44E5F /* InfoPlist.strings */; }; 23 | 23682FF417BA068100A44E5F /* SvpplyTableTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 23682FF317BA068100A44E5F /* SvpplyTableTests.m */; }; 24 | 23682FFF17BA06E200A44E5F /* categories.json in Resources */ = {isa = PBXBuildFile; fileRef = 23682FFE17BA06E200A44E5F /* categories.json */; }; 25 | 2368300517BA0B7700A44E5F /* STCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = 2368300117BA07C900A44E5F /* STCategory.m */; }; 26 | 2368301217BA1A9300A44E5F /* STTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2368301117BA1A4300A44E5F /* STTableViewController.m */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 23682FEB17BA068100A44E5F /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 23682FC317BA068000A44E5F /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 23682FCA17BA068000A44E5F; 35 | remoteInfo = SvpplyTable; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 2344B0FE17BA323C00C8A6D0 /* STTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = STTableViewCell.h; sourceTree = ""; }; 41 | 2344B0FF17BA323C00C8A6D0 /* STTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = STTableViewCell.m; sourceTree = ""; }; 42 | 2344B10117BB215000C8A6D0 /* UIColor+HexString.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIColor+HexString.h"; sourceTree = ""; }; 43 | 2344B10217BB215000C8A6D0 /* UIColor+HexString.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIColor+HexString.m"; sourceTree = ""; }; 44 | 23682FCB17BA068100A44E5F /* SvpplyTable.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SvpplyTable.app; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 23682FCE17BA068100A44E5F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 46 | 23682FD017BA068100A44E5F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 47 | 23682FD217BA068100A44E5F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 48 | 23682FD617BA068100A44E5F /* SvpplyTable-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SvpplyTable-Info.plist"; sourceTree = ""; }; 49 | 23682FD817BA068100A44E5F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 50 | 23682FDA17BA068100A44E5F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 51 | 23682FDC17BA068100A44E5F /* SvpplyTable-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SvpplyTable-Prefix.pch"; sourceTree = ""; }; 52 | 23682FDD17BA068100A44E5F /* STAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = STAppDelegate.h; sourceTree = ""; }; 53 | 23682FDE17BA068100A44E5F /* STAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = STAppDelegate.m; sourceTree = ""; }; 54 | 23682FE017BA068100A44E5F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 55 | 23682FE617BA068100A44E5F /* SvpplyTableTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SvpplyTableTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 23682FE717BA068100A44E5F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 57 | 23682FEF17BA068100A44E5F /* SvpplyTableTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SvpplyTableTests-Info.plist"; sourceTree = ""; }; 58 | 23682FF117BA068100A44E5F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 59 | 23682FF317BA068100A44E5F /* SvpplyTableTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SvpplyTableTests.m; sourceTree = ""; }; 60 | 23682FFE17BA06E200A44E5F /* categories.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = categories.json; sourceTree = ""; }; 61 | 2368300017BA07C900A44E5F /* STCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = STCategory.h; sourceTree = ""; }; 62 | 2368300117BA07C900A44E5F /* STCategory.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = STCategory.m; sourceTree = ""; }; 63 | 2368301017BA1A4300A44E5F /* STTableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = STTableViewController.h; sourceTree = ""; }; 64 | 2368301117BA1A4300A44E5F /* STTableViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = STTableViewController.m; sourceTree = ""; }; 65 | /* End PBXFileReference section */ 66 | 67 | /* Begin PBXFrameworksBuildPhase section */ 68 | 23682FC817BA068000A44E5F /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | 23682FD117BA068100A44E5F /* CoreGraphics.framework in Frameworks */, 73 | 23682FD317BA068100A44E5F /* UIKit.framework in Frameworks */, 74 | 23682FCF17BA068100A44E5F /* Foundation.framework in Frameworks */, 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | 23682FE317BA068100A44E5F /* Frameworks */ = { 79 | isa = PBXFrameworksBuildPhase; 80 | buildActionMask = 2147483647; 81 | files = ( 82 | 23682FE817BA068100A44E5F /* XCTest.framework in Frameworks */, 83 | 23682FEA17BA068100A44E5F /* UIKit.framework in Frameworks */, 84 | 23682FE917BA068100A44E5F /* Foundation.framework in Frameworks */, 85 | ); 86 | runOnlyForDeploymentPostprocessing = 0; 87 | }; 88 | /* End PBXFrameworksBuildPhase section */ 89 | 90 | /* Begin PBXGroup section */ 91 | 23682FC217BA068000A44E5F = { 92 | isa = PBXGroup; 93 | children = ( 94 | 23682FD417BA068100A44E5F /* SvpplyTable */, 95 | 23682FED17BA068100A44E5F /* SvpplyTableTests */, 96 | 23682FCD17BA068100A44E5F /* Frameworks */, 97 | 23682FCC17BA068100A44E5F /* Products */, 98 | ); 99 | sourceTree = ""; 100 | }; 101 | 23682FCC17BA068100A44E5F /* Products */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 23682FCB17BA068100A44E5F /* SvpplyTable.app */, 105 | 23682FE617BA068100A44E5F /* SvpplyTableTests.xctest */, 106 | ); 107 | name = Products; 108 | sourceTree = ""; 109 | }; 110 | 23682FCD17BA068100A44E5F /* Frameworks */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 23682FCE17BA068100A44E5F /* Foundation.framework */, 114 | 23682FD017BA068100A44E5F /* CoreGraphics.framework */, 115 | 23682FD217BA068100A44E5F /* UIKit.framework */, 116 | 23682FE717BA068100A44E5F /* XCTest.framework */, 117 | ); 118 | name = Frameworks; 119 | sourceTree = ""; 120 | }; 121 | 23682FD417BA068100A44E5F /* SvpplyTable */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 2368300217BA09CC00A44E5F /* Vendors */, 125 | 23682FFD17BA06B100A44E5F /* Resources */, 126 | 23682FDD17BA068100A44E5F /* STAppDelegate.h */, 127 | 23682FDE17BA068100A44E5F /* STAppDelegate.m */, 128 | 2368301017BA1A4300A44E5F /* STTableViewController.h */, 129 | 2368301117BA1A4300A44E5F /* STTableViewController.m */, 130 | 23682FE017BA068100A44E5F /* Images.xcassets */, 131 | 23682FD517BA068100A44E5F /* Supporting Files */, 132 | 2368300017BA07C900A44E5F /* STCategory.h */, 133 | 2368300117BA07C900A44E5F /* STCategory.m */, 134 | 2344B0FE17BA323C00C8A6D0 /* STTableViewCell.h */, 135 | 2344B0FF17BA323C00C8A6D0 /* STTableViewCell.m */, 136 | 2344B10117BB215000C8A6D0 /* UIColor+HexString.h */, 137 | 2344B10217BB215000C8A6D0 /* UIColor+HexString.m */, 138 | ); 139 | path = SvpplyTable; 140 | sourceTree = ""; 141 | }; 142 | 23682FD517BA068100A44E5F /* Supporting Files */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 23682FD617BA068100A44E5F /* SvpplyTable-Info.plist */, 146 | 23682FD717BA068100A44E5F /* InfoPlist.strings */, 147 | 23682FDA17BA068100A44E5F /* main.m */, 148 | 23682FDC17BA068100A44E5F /* SvpplyTable-Prefix.pch */, 149 | ); 150 | name = "Supporting Files"; 151 | sourceTree = ""; 152 | }; 153 | 23682FED17BA068100A44E5F /* SvpplyTableTests */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | 23682FF317BA068100A44E5F /* SvpplyTableTests.m */, 157 | 23682FEE17BA068100A44E5F /* Supporting Files */, 158 | ); 159 | path = SvpplyTableTests; 160 | sourceTree = ""; 161 | }; 162 | 23682FEE17BA068100A44E5F /* Supporting Files */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | 23682FEF17BA068100A44E5F /* SvpplyTableTests-Info.plist */, 166 | 23682FF017BA068100A44E5F /* InfoPlist.strings */, 167 | ); 168 | name = "Supporting Files"; 169 | sourceTree = ""; 170 | }; 171 | 23682FFD17BA06B100A44E5F /* Resources */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | 23682FFE17BA06E200A44E5F /* categories.json */, 175 | ); 176 | path = Resources; 177 | sourceTree = ""; 178 | }; 179 | 2368300217BA09CC00A44E5F /* Vendors */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | ); 183 | path = Vendors; 184 | sourceTree = ""; 185 | }; 186 | /* End PBXGroup section */ 187 | 188 | /* Begin PBXNativeTarget section */ 189 | 23682FCA17BA068000A44E5F /* SvpplyTable */ = { 190 | isa = PBXNativeTarget; 191 | buildConfigurationList = 23682FF717BA068100A44E5F /* Build configuration list for PBXNativeTarget "SvpplyTable" */; 192 | buildPhases = ( 193 | 23682FC717BA068000A44E5F /* Sources */, 194 | 23682FC817BA068000A44E5F /* Frameworks */, 195 | 23682FC917BA068000A44E5F /* Resources */, 196 | ); 197 | buildRules = ( 198 | ); 199 | dependencies = ( 200 | ); 201 | name = SvpplyTable; 202 | productName = SvpplyTable; 203 | productReference = 23682FCB17BA068100A44E5F /* SvpplyTable.app */; 204 | productType = "com.apple.product-type.application"; 205 | }; 206 | 23682FE517BA068100A44E5F /* SvpplyTableTests */ = { 207 | isa = PBXNativeTarget; 208 | buildConfigurationList = 23682FFA17BA068100A44E5F /* Build configuration list for PBXNativeTarget "SvpplyTableTests" */; 209 | buildPhases = ( 210 | 23682FE217BA068100A44E5F /* Sources */, 211 | 23682FE317BA068100A44E5F /* Frameworks */, 212 | 23682FE417BA068100A44E5F /* Resources */, 213 | ); 214 | buildRules = ( 215 | ); 216 | dependencies = ( 217 | 23682FEC17BA068100A44E5F /* PBXTargetDependency */, 218 | ); 219 | name = SvpplyTableTests; 220 | productName = SvpplyTableTests; 221 | productReference = 23682FE617BA068100A44E5F /* SvpplyTableTests.xctest */; 222 | productType = "com.apple.product-type.bundle.unit-test"; 223 | }; 224 | /* End PBXNativeTarget section */ 225 | 226 | /* Begin PBXProject section */ 227 | 23682FC317BA068000A44E5F /* Project object */ = { 228 | isa = PBXProject; 229 | attributes = { 230 | CLASSPREFIX = ST; 231 | LastUpgradeCheck = 0500; 232 | ORGANIZATIONNAME = "Minqian Liu"; 233 | TargetAttributes = { 234 | 23682FE517BA068100A44E5F = { 235 | TestTargetID = 23682FCA17BA068000A44E5F; 236 | }; 237 | }; 238 | }; 239 | buildConfigurationList = 23682FC617BA068000A44E5F /* Build configuration list for PBXProject "SvpplyTable" */; 240 | compatibilityVersion = "Xcode 3.2"; 241 | developmentRegion = English; 242 | hasScannedForEncodings = 0; 243 | knownRegions = ( 244 | en, 245 | ); 246 | mainGroup = 23682FC217BA068000A44E5F; 247 | productRefGroup = 23682FCC17BA068100A44E5F /* Products */; 248 | projectDirPath = ""; 249 | projectRoot = ""; 250 | targets = ( 251 | 23682FCA17BA068000A44E5F /* SvpplyTable */, 252 | 23682FE517BA068100A44E5F /* SvpplyTableTests */, 253 | ); 254 | }; 255 | /* End PBXProject section */ 256 | 257 | /* Begin PBXResourcesBuildPhase section */ 258 | 23682FC917BA068000A44E5F /* Resources */ = { 259 | isa = PBXResourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | 23682FD917BA068100A44E5F /* InfoPlist.strings in Resources */, 263 | 23682FFF17BA06E200A44E5F /* categories.json in Resources */, 264 | 23682FE117BA068100A44E5F /* Images.xcassets in Resources */, 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | 23682FE417BA068100A44E5F /* Resources */ = { 269 | isa = PBXResourcesBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | 23682FF217BA068100A44E5F /* InfoPlist.strings in Resources */, 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | /* End PBXResourcesBuildPhase section */ 277 | 278 | /* Begin PBXSourcesBuildPhase section */ 279 | 23682FC717BA068000A44E5F /* Sources */ = { 280 | isa = PBXSourcesBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | 2344B10417BB218500C8A6D0 /* UIColor+HexString.m in Sources */, 284 | 2344B10317BB217F00C8A6D0 /* STTableViewCell.m in Sources */, 285 | 2368301217BA1A9300A44E5F /* STTableViewController.m in Sources */, 286 | 2368300517BA0B7700A44E5F /* STCategory.m in Sources */, 287 | 23682FDB17BA068100A44E5F /* main.m in Sources */, 288 | 23682FDF17BA068100A44E5F /* STAppDelegate.m in Sources */, 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | 23682FE217BA068100A44E5F /* Sources */ = { 293 | isa = PBXSourcesBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | 23682FF417BA068100A44E5F /* SvpplyTableTests.m in Sources */, 297 | ); 298 | runOnlyForDeploymentPostprocessing = 0; 299 | }; 300 | /* End PBXSourcesBuildPhase section */ 301 | 302 | /* Begin PBXTargetDependency section */ 303 | 23682FEC17BA068100A44E5F /* PBXTargetDependency */ = { 304 | isa = PBXTargetDependency; 305 | target = 23682FCA17BA068000A44E5F /* SvpplyTable */; 306 | targetProxy = 23682FEB17BA068100A44E5F /* PBXContainerItemProxy */; 307 | }; 308 | /* End PBXTargetDependency section */ 309 | 310 | /* Begin PBXVariantGroup section */ 311 | 23682FD717BA068100A44E5F /* InfoPlist.strings */ = { 312 | isa = PBXVariantGroup; 313 | children = ( 314 | 23682FD817BA068100A44E5F /* en */, 315 | ); 316 | name = InfoPlist.strings; 317 | sourceTree = ""; 318 | }; 319 | 23682FF017BA068100A44E5F /* InfoPlist.strings */ = { 320 | isa = PBXVariantGroup; 321 | children = ( 322 | 23682FF117BA068100A44E5F /* en */, 323 | ); 324 | name = InfoPlist.strings; 325 | sourceTree = ""; 326 | }; 327 | /* End PBXVariantGroup section */ 328 | 329 | /* Begin XCBuildConfiguration section */ 330 | 23682FF517BA068100A44E5F /* Debug */ = { 331 | isa = XCBuildConfiguration; 332 | buildSettings = { 333 | ALWAYS_SEARCH_USER_PATHS = NO; 334 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 335 | CLANG_CXX_LIBRARY = "libc++"; 336 | CLANG_ENABLE_MODULES = YES; 337 | CLANG_ENABLE_OBJC_ARC = YES; 338 | CLANG_WARN_BOOL_CONVERSION = YES; 339 | CLANG_WARN_CONSTANT_CONVERSION = YES; 340 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 341 | CLANG_WARN_EMPTY_BODY = YES; 342 | CLANG_WARN_ENUM_CONVERSION = YES; 343 | CLANG_WARN_INT_CONVERSION = YES; 344 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 345 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 346 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 347 | COPY_PHASE_STRIP = NO; 348 | GCC_C_LANGUAGE_STANDARD = gnu99; 349 | GCC_DYNAMIC_NO_PIC = NO; 350 | GCC_OPTIMIZATION_LEVEL = 0; 351 | GCC_PREPROCESSOR_DEFINITIONS = ( 352 | "DEBUG=1", 353 | "$(inherited)", 354 | ); 355 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 356 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 357 | GCC_WARN_UNDECLARED_SELECTOR = YES; 358 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 359 | GCC_WARN_UNUSED_FUNCTION = YES; 360 | GCC_WARN_UNUSED_VARIABLE = YES; 361 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 362 | ONLY_ACTIVE_ARCH = YES; 363 | SDKROOT = iphoneos; 364 | }; 365 | name = Debug; 366 | }; 367 | 23682FF617BA068100A44E5F /* Release */ = { 368 | isa = XCBuildConfiguration; 369 | buildSettings = { 370 | ALWAYS_SEARCH_USER_PATHS = NO; 371 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 372 | CLANG_CXX_LIBRARY = "libc++"; 373 | CLANG_ENABLE_MODULES = YES; 374 | CLANG_ENABLE_OBJC_ARC = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_CONSTANT_CONVERSION = YES; 377 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 378 | CLANG_WARN_EMPTY_BODY = YES; 379 | CLANG_WARN_ENUM_CONVERSION = YES; 380 | CLANG_WARN_INT_CONVERSION = YES; 381 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 382 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 383 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 384 | COPY_PHASE_STRIP = YES; 385 | ENABLE_NS_ASSERTIONS = NO; 386 | GCC_C_LANGUAGE_STANDARD = gnu99; 387 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 388 | GCC_WARN_UNDECLARED_SELECTOR = YES; 389 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 390 | GCC_WARN_UNUSED_FUNCTION = YES; 391 | GCC_WARN_UNUSED_VARIABLE = YES; 392 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 393 | SDKROOT = iphoneos; 394 | VALIDATE_PRODUCT = YES; 395 | }; 396 | name = Release; 397 | }; 398 | 23682FF817BA068100A44E5F /* Debug */ = { 399 | isa = XCBuildConfiguration; 400 | buildSettings = { 401 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 402 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 403 | CODE_SIGN_IDENTITY = ""; 404 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 405 | GCC_PREFIX_HEADER = "SvpplyTable/SvpplyTable-Prefix.pch"; 406 | INFOPLIST_FILE = "SvpplyTable/SvpplyTable-Info.plist"; 407 | PRODUCT_NAME = "$(TARGET_NAME)"; 408 | WRAPPER_EXTENSION = app; 409 | }; 410 | name = Debug; 411 | }; 412 | 23682FF917BA068100A44E5F /* Release */ = { 413 | isa = XCBuildConfiguration; 414 | buildSettings = { 415 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 416 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 417 | CODE_SIGN_IDENTITY = ""; 418 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 419 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 420 | GCC_PREFIX_HEADER = "SvpplyTable/SvpplyTable-Prefix.pch"; 421 | INFOPLIST_FILE = "SvpplyTable/SvpplyTable-Info.plist"; 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | WRAPPER_EXTENSION = app; 424 | }; 425 | name = Release; 426 | }; 427 | 23682FFB17BA068100A44E5F /* Debug */ = { 428 | isa = XCBuildConfiguration; 429 | buildSettings = { 430 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SvpplyTable.app/SvpplyTable"; 431 | FRAMEWORK_SEARCH_PATHS = ( 432 | "$(SDKROOT)/Developer/Library/Frameworks", 433 | "$(inherited)", 434 | "$(SYSTEM_APPS_DIR)/Xcode5-DP2.app/Contents/Developer/Library/Frameworks", 435 | ); 436 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 437 | GCC_PREFIX_HEADER = "SvpplyTable/SvpplyTable-Prefix.pch"; 438 | GCC_PREPROCESSOR_DEFINITIONS = ( 439 | "DEBUG=1", 440 | "$(inherited)", 441 | ); 442 | INFOPLIST_FILE = "SvpplyTableTests/SvpplyTableTests-Info.plist"; 443 | PRODUCT_NAME = "$(TARGET_NAME)"; 444 | TEST_HOST = "$(BUNDLE_LOADER)"; 445 | WRAPPER_EXTENSION = xctest; 446 | }; 447 | name = Debug; 448 | }; 449 | 23682FFC17BA068100A44E5F /* Release */ = { 450 | isa = XCBuildConfiguration; 451 | buildSettings = { 452 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SvpplyTable.app/SvpplyTable"; 453 | FRAMEWORK_SEARCH_PATHS = ( 454 | "$(SDKROOT)/Developer/Library/Frameworks", 455 | "$(inherited)", 456 | "$(SYSTEM_APPS_DIR)/Xcode5-DP2.app/Contents/Developer/Library/Frameworks", 457 | ); 458 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 459 | GCC_PREFIX_HEADER = "SvpplyTable/SvpplyTable-Prefix.pch"; 460 | INFOPLIST_FILE = "SvpplyTableTests/SvpplyTableTests-Info.plist"; 461 | PRODUCT_NAME = "$(TARGET_NAME)"; 462 | TEST_HOST = "$(BUNDLE_LOADER)"; 463 | WRAPPER_EXTENSION = xctest; 464 | }; 465 | name = Release; 466 | }; 467 | /* End XCBuildConfiguration section */ 468 | 469 | /* Begin XCConfigurationList section */ 470 | 23682FC617BA068000A44E5F /* Build configuration list for PBXProject "SvpplyTable" */ = { 471 | isa = XCConfigurationList; 472 | buildConfigurations = ( 473 | 23682FF517BA068100A44E5F /* Debug */, 474 | 23682FF617BA068100A44E5F /* Release */, 475 | ); 476 | defaultConfigurationIsVisible = 0; 477 | defaultConfigurationName = Release; 478 | }; 479 | 23682FF717BA068100A44E5F /* Build configuration list for PBXNativeTarget "SvpplyTable" */ = { 480 | isa = XCConfigurationList; 481 | buildConfigurations = ( 482 | 23682FF817BA068100A44E5F /* Debug */, 483 | 23682FF917BA068100A44E5F /* Release */, 484 | ); 485 | defaultConfigurationIsVisible = 0; 486 | defaultConfigurationName = Release; 487 | }; 488 | 23682FFA17BA068100A44E5F /* Build configuration list for PBXNativeTarget "SvpplyTableTests" */ = { 489 | isa = XCConfigurationList; 490 | buildConfigurations = ( 491 | 23682FFB17BA068100A44E5F /* Debug */, 492 | 23682FFC17BA068100A44E5F /* Release */, 493 | ); 494 | defaultConfigurationIsVisible = 0; 495 | defaultConfigurationName = Release; 496 | }; 497 | /* End XCConfigurationList section */ 498 | }; 499 | rootObject = 23682FC317BA068000A44E5F /* Project object */; 500 | } 501 | -------------------------------------------------------------------------------- /SvpplyTable.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SvpplyTable.xcodeproj/project.xcworkspace/xcshareddata/SvpplyTable.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 14C74EF7-6528-456E-AC53-C30E8B65C06F 9 | IDESourceControlProjectName 10 | SvpplyTable 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 20D0970C-70F6-4DA2-9BD5-95FF18F90257 14 | ssh://github.com/liuminqian/SvpplyTable.git 15 | 16 | IDESourceControlProjectPath 17 | SvpplyTable.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 20D0970C-70F6-4DA2-9BD5-95FF18F90257 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/liuminqian/SvpplyTable.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | 20D0970C-70F6-4DA2-9BD5-95FF18F90257 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 20D0970C-70F6-4DA2-9BD5-95FF18F90257 36 | IDESourceControlWCCName 37 | SvpplyTable 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /SvpplyTable.xcodeproj/project.xcworkspace/xcuserdata/liuminqian.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/666lm/SvpplyTable/651819859650bff2b43c6ba66535b7d89f54f98a/SvpplyTable.xcodeproj/project.xcworkspace/xcuserdata/liuminqian.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SvpplyTable.xcodeproj/xcuserdata/liuminqian.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /SvpplyTable.xcodeproj/xcuserdata/liuminqian.xcuserdatad/xcschemes/SvpplyTable.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 | -------------------------------------------------------------------------------- /SvpplyTable.xcodeproj/xcuserdata/liuminqian.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SvpplyTable.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 23682FCA17BA068000A44E5F 16 | 17 | primary 18 | 19 | 20 | 23682FE517BA068100A44E5F 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SvpplyTable/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/666lm/SvpplyTable/651819859650bff2b43c6ba66535b7d89f54f98a/SvpplyTable/.DS_Store -------------------------------------------------------------------------------- /SvpplyTable/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" : "60x60", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /SvpplyTable/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 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /SvpplyTable/Resources/categories.json: -------------------------------------------------------------------------------- 1 | {"meta":{"status":200,"msg":"OK","time":1335541016},"response":{"categories":[{"name":"All Products","url":"https:\/\/api.svpply.com\/v1\/shop.json","text_color":"#000000","border_color":"#000000","children":[{"name":"Men\u2019s","url":"https:\/\/api.svpply.com\/v1\/shop\/mens.json","text_color":"#FF5B54","border_color":"#FFDEDD","children":[{"name":"Clothing","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing.json","text_color":"#FF5B54","border_color":"#FFDEDD","children":[{"name":"Tops","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing\/tops.json","text_color":"#FF5B54","border_color":"#FFDEDD","children":[{"name":"Shirts","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing\/tops\/shirts.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Sweaters","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing\/tops\/sweaters.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Sweatshirts","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing\/tops\/sweatshirts.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"T-Shirts","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing\/tops\/t-shirts.json","text_color":"#FF5B54","border_color":"#FFDEDD"}]},{"name":"Bottoms","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing\/bottoms.json","text_color":"#FF5B54","border_color":"#FFDEDD","children":[{"name":"Jeans","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing\/bottoms\/jeans.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Pants","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing\/bottoms\/pants.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Shorts","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing\/bottoms\/shorts.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Socks","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing\/bottoms\/socks.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Underwear","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing\/bottoms\/underwear.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Swim","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing\/bottoms\/swim.json","text_color":"#FF5B54","border_color":"#FFDEDD"}]},{"name":"Outerwear","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing\/outerwear.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Suits","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/clothing\/suits.json","text_color":"#FF5B54","border_color":"#FFDEDD"}]},{"name":"Shoes","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/shoes.json","text_color":"#FF5B54","border_color":"#FFDEDD","children":[{"name":"Casual","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/shoes\/casual.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Sneakers","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/shoes\/sneakers.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Dress","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/shoes\/dress.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Boots","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/shoes\/boots.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Sandals","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/shoes\/sandals.json","text_color":"#FF5B54","border_color":"#FFDEDD"}]},{"name":"Accessories","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories.json","text_color":"#FF5B54","border_color":"#FFDEDD","children":[{"name":"Bags","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/bags.json","text_color":"#FF5B54","border_color":"#FFDEDD","children":[{"name":"Backpacks","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/bags\/backpacks.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Messenger","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/bags\/messenger.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Luggage","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/bags\/luggage.json","text_color":"#FF5B54","border_color":"#FFDEDD"}]},{"name":"Watches","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/watches.json","text_color":"#FF5B54","border_color":"#FFDEDD","children":[{"name":"Casual","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/watches\/casual.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Formal","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/watches\/formal.json","text_color":"#FF5B54","border_color":"#FFDEDD"}]},{"name":"Wallets","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/wallets.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Belts","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/belts.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Ties","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/ties.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Hats","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/hats.json","text_color":"#FF5B54","border_color":"#FFDEDD","children":[{"name":"Caps","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/hats\/caps.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Classic","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/hats\/classic.json","text_color":"#FF5B54","border_color":"#FFDEDD"},{"name":"Beanies","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/hats\/beanies.json","text_color":"#FF5B54","border_color":"#FFDEDD"}]},{"name":"Glasses","url":"https:\/\/api.svpply.com\/v1\/shop\/mens\/accessories\/glasses.json","text_color":"#FF5B54","border_color":"#FFDEDD"}]}]},{"name":"Women\u2019s","url":"https:\/\/api.svpply.com\/v1\/shop\/womens.json","text_color":"#8A4E77","border_color":"#E8DCE4","children":[{"name":"Clothing","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing.json","text_color":"#8A4E77","border_color":"#E8DCE4","children":[{"name":"Dresses","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/dresses.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Tops","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/tops.json","text_color":"#8A4E77","border_color":"#E8DCE4","children":[{"name":"Shirts","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/tops\/shirts.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Sweaters","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/tops\/sweaters.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Sweatshirts","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/tops\/sweatshirts.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"T-Shirts","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/tops\/t-shirts.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Blazers","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/tops\/blazers.json","text_color":"#8A4E77","border_color":"#E8DCE4"}]},{"name":"Bottoms","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/bottoms.json","text_color":"#8A4E77","border_color":"#E8DCE4","children":[{"name":"Jeans","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/bottoms\/jeans.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Pants","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/bottoms\/pants.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Shorts","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/bottoms\/shorts.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Rompers","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/bottoms\/rompers.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Skirts","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/bottoms\/skirts.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Swim","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/bottoms\/swim.json","text_color":"#8A4E77","border_color":"#E8DCE4"}]},{"name":"Outerwear","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/outerwear.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Underwear","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/underwear.json","text_color":"#8A4E77","border_color":"#E8DCE4","children":[{"name":"Bras & Undies","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/underwear\/bras-undies.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Slips","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/underwear\/slips.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Bodysuits","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/underwear\/bodysuits.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Tights","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/underwear\/tights.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Socks","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/clothing\/underwear\/socks.json","text_color":"#8A4E77","border_color":"#E8DCE4"}]}]},{"name":"Shoes","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/shoes.json","text_color":"#8A4E77","border_color":"#E8DCE4","children":[{"name":"Sandals","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/shoes\/sandals.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Heels","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/shoes\/heels.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Flats","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/shoes\/flats.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Boots","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/shoes\/boots.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Sneakers","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/shoes\/sneakers.json","text_color":"#8A4E77","border_color":"#E8DCE4"}]},{"name":"Accessories","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories.json","text_color":"#8A4E77","border_color":"#E8DCE4","children":[{"name":"Bags","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories\/bags.json","text_color":"#8A4E77","border_color":"#E8DCE4","children":[{"name":"Purses","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories\/bags\/purses.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Wallets","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories\/bags\/wallets.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Clutches","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories\/bags\/clutches.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Totes","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories\/bags\/totes.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Backpacks","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories\/bags\/backpacks.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Luggage","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories\/bags\/luggage.json","text_color":"#8A4E77","border_color":"#E8DCE4"}]},{"name":"Watches","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories\/watches.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Belts","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories\/belts.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Jewelry","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories\/jewelry.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Hair","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories\/hair.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Hats","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories\/hats.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Scarves","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories\/scarves.json","text_color":"#8A4E77","border_color":"#E8DCE4"},{"name":"Glasses","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/accessories\/glasses.json","text_color":"#8A4E77","border_color":"#E8DCE4"}]},{"name":"Beauty","url":"https:\/\/api.svpply.com\/v1\/shop\/womens\/beauty.json","text_color":"#8A4E77","border_color":"#E8DCE4"}]},{"name":"Tech","url":"https:\/\/api.svpply.com\/v1\/shop\/tech.json","text_color":"#36779D","border_color":"#D7E4EB","children":[{"name":"Audio","url":"https:\/\/api.svpply.com\/v1\/shop\/tech\/audio.json","text_color":"#36779D","border_color":"#D7E4EB","children":[{"name":"Turntables","url":"https:\/\/api.svpply.com\/v1\/shop\/tech\/audio\/turntables.json","text_color":"#36779D","border_color":"#D7E4EB"},{"name":"Headphones","url":"https:\/\/api.svpply.com\/v1\/shop\/tech\/audio\/headphones.json","text_color":"#36779D","border_color":"#D7E4EB"},{"name":"Speakers","url":"https:\/\/api.svpply.com\/v1\/shop\/tech\/audio\/speakers.json","text_color":"#36779D","border_color":"#D7E4EB"},{"name":"Instruments","url":"https:\/\/api.svpply.com\/v1\/shop\/tech\/audio\/instruments.json","text_color":"#36779D","border_color":"#D7E4EB"}]},{"name":"Cameras","url":"https:\/\/api.svpply.com\/v1\/shop\/tech\/cameras.json","text_color":"#36779D","border_color":"#D7E4EB","children":[{"name":"Digital","url":"https:\/\/api.svpply.com\/v1\/shop\/tech\/cameras\/digital.json","text_color":"#36779D","border_color":"#D7E4EB"},{"name":"Analog","url":"https:\/\/api.svpply.com\/v1\/shop\/tech\/cameras\/analog.json","text_color":"#36779D","border_color":"#D7E4EB"},{"name":"Accessories","url":"https:\/\/api.svpply.com\/v1\/shop\/tech\/cameras\/accessories.json","text_color":"#36779D","border_color":"#D7E4EB"}]},{"name":"Accessories","url":"https:\/\/api.svpply.com\/v1\/shop\/tech\/accessories.json","text_color":"#36779D","border_color":"#D7E4EB","children":[{"name":"Laptop","url":"https:\/\/api.svpply.com\/v1\/shop\/tech\/accessories\/laptop.json","text_color":"#36779D","border_color":"#D7E4EB"},{"name":"Phone","url":"https:\/\/api.svpply.com\/v1\/shop\/tech\/accessories\/phone.json","text_color":"#36779D","border_color":"#D7E4EB"},{"name":"Other","url":"https:\/\/api.svpply.com\/v1\/shop\/tech\/accessories\/other.json","text_color":"#36779D","border_color":"#D7E4EB"}]}]},{"name":"Media","url":"https:\/\/api.svpply.com\/v1\/shop\/media.json","text_color":"#56B2BD","border_color":"#DDF0F2","children":[{"name":"Books & Music","url":"https:\/\/api.svpply.com\/v1\/shop\/media\/books-music.json","text_color":"#56B2BD","border_color":"#DDF0F2"},{"name":"Movies","url":"https:\/\/api.svpply.com\/v1\/shop\/media\/movies.json","text_color":"#56B2BD","border_color":"#DDF0F2"}]},{"name":"Home","url":"https:\/\/api.svpply.com\/v1\/shop\/home.json","text_color":"#6ABC8B","border_color":"#E1F2E8","children":[{"name":"Kitchen","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/kitchen.json","text_color":"#6ABC8B","border_color":"#E1F2E8","children":[{"name":"Cookware","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/kitchen\/cookware.json","text_color":"#6ABC8B","border_color":"#E1F2E8"},{"name":"Coffee & Tea","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/kitchen\/coffee-tea.json","text_color":"#6ABC8B","border_color":"#E1F2E8"},{"name":"Storage","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/kitchen\/storage.json","text_color":"#6ABC8B","border_color":"#E1F2E8"},{"name":"Cutlery","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/kitchen\/cutlery.json","text_color":"#6ABC8B","border_color":"#E1F2E8"},{"name":"Utensils","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/kitchen\/utensils.json","text_color":"#6ABC8B","border_color":"#E1F2E8"},{"name":"Appliances","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/kitchen\/appliances.json","text_color":"#6ABC8B","border_color":"#E1F2E8"},{"name":"Accessories","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/kitchen\/accessories.json","text_color":"#6ABC8B","border_color":"#E1F2E8"}]},{"name":"Bedding","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/bedding.json","text_color":"#6ABC8B","border_color":"#E1F2E8"},{"name":"Bath","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/bath.json","text_color":"#6ABC8B","border_color":"#E1F2E8"},{"name":"Furniture","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/furniture.json","text_color":"#6ABC8B","border_color":"#E1F2E8"},{"name":"D\u00e9cor","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/decor.json","text_color":"#6ABC8B","border_color":"#E1F2E8","children":[{"name":"Rugs","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/decor\/rugs.json","text_color":"#6ABC8B","border_color":"#E1F2E8"},{"name":"Lighting","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/decor\/lighting.json","text_color":"#6ABC8B","border_color":"#E1F2E8"},{"name":"Accessories","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/decor\/accessories.json","text_color":"#6ABC8B","border_color":"#E1F2E8"},{"name":"Pillows","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/decor\/pillows.json","text_color":"#6ABC8B","border_color":"#E1F2E8"},{"name":"Clocks","url":"https:\/\/api.svpply.com\/v1\/shop\/home\/decor\/clocks.json","text_color":"#6ABC8B","border_color":"#E1F2E8"}]}]},{"name":"Art","url":"https:\/\/api.svpply.com\/v1\/shop\/art.json","text_color":"#68DDAB","border_color":"#E1F8EE","children":[{"name":"3D","url":"https:\/\/api.svpply.com\/v1\/shop\/art\/3d.json","text_color":"#68DDAB","border_color":"#E1F8EE"},{"name":"Posters","url":"https:\/\/api.svpply.com\/v1\/shop\/art\/posters.json","text_color":"#68DDAB","border_color":"#E1F8EE"},{"name":"Photography","url":"https:\/\/api.svpply.com\/v1\/shop\/art\/photography.json","text_color":"#68DDAB","border_color":"#E1F8EE"},{"name":"Collage","url":"https:\/\/api.svpply.com\/v1\/shop\/art\/collage.json","text_color":"#68DDAB","border_color":"#E1F8EE"},{"name":"Supplies","url":"https:\/\/api.svpply.com\/v1\/shop\/art\/supplies.json","text_color":"#68DDAB","border_color":"#E1F8EE"}]},{"name":"Other","url":"https:\/\/api.svpply.com\/v1\/shop\/other.json","text_color":"#666F7E","border_color":"#E0E2E5","children":[{"name":"Booze","url":"https:\/\/api.svpply.com\/v1\/shop\/other\/booze.json","text_color":"#666F7E","border_color":"#E0E2E5"},{"name":"Cycling","url":"https:\/\/api.svpply.com\/v1\/shop\/other\/cycling.json","text_color":"#666F7E","border_color":"#E0E2E5"},{"name":"Toys","url":"https:\/\/api.svpply.com\/v1\/shop\/other\/toys.json","text_color":"#666F7E","border_color":"#E0E2E5"},{"name":"Games","url":"https:\/\/api.svpply.com\/v1\/shop\/other\/games.json","text_color":"#666F7E","border_color":"#E0E2E5"},{"name":"Antiques","url":"https:\/\/api.svpply.com\/v1\/shop\/other\/antiques.json","text_color":"#666F7E","border_color":"#E0E2E5"},{"name":"Pets","url":"https:\/\/api.svpply.com\/v1\/shop\/other\/pets.json","text_color":"#666F7E","border_color":"#E0E2E5"},{"name":"Camping","url":"https:\/\/api.svpply.com\/v1\/shop\/other\/camping.json","text_color":"#666F7E","border_color":"#E0E2E5"},{"name":"Tools","url":"https:\/\/api.svpply.com\/v1\/shop\/other\/tools.json","text_color":"#666F7E","border_color":"#E0E2E5"}]}]}]}} -------------------------------------------------------------------------------- /SvpplyTable/STAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // STAppDelegate.h 3 | // SvpplyTable 4 | // 5 | // Created by Anonymous on 13-8-13. 6 | // Copyright (c) 2013年 Minqian Liu. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "STTableViewController.h" 11 | 12 | @interface STAppDelegate : UIResponder 13 | { 14 | STTableViewController *viewController; 15 | } 16 | 17 | @property (nonatomic, strong) UIWindow *window; 18 | @property (nonatomic, strong) STTableViewController *viewController; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /SvpplyTable/STAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // STAppDelegate.m 3 | // SvpplyTable 4 | // 5 | // Created by Anonymous on 13-8-13. 6 | // Copyright (c) 2013年 Minqian Liu. All rights reserved. 7 | // 8 | 9 | #import "STAppDelegate.h" 10 | 11 | @implementation STAppDelegate 12 | 13 | @synthesize viewController; 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 18 | 19 | self.viewController = [[STTableViewController alloc] initWithNibName:nil bundle:nil]; 20 | self.window.rootViewController = self.viewController; 21 | 22 | // Override point for customization after application launch. 23 | self.window.backgroundColor = [UIColor whiteColor]; 24 | [self.window makeKeyAndVisible]; 25 | return YES; 26 | } 27 | 28 | - (void)applicationWillResignActive:(UIApplication *)application 29 | { 30 | // 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. 31 | // 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. 32 | } 33 | 34 | - (void)applicationDidEnterBackground:(UIApplication *)application 35 | { 36 | // 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. 37 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 38 | } 39 | 40 | - (void)applicationWillEnterForeground:(UIApplication *)application 41 | { 42 | // 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. 43 | } 44 | 45 | - (void)applicationDidBecomeActive:(UIApplication *)application 46 | { 47 | // 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. 48 | } 49 | 50 | - (void)applicationWillTerminate:(UIApplication *)application 51 | { 52 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /SvpplyTable/STCategory.h: -------------------------------------------------------------------------------- 1 | // 2 | // STCategory.h 3 | // SvpplyTable 4 | // 5 | // Created by Anonymous on 13-8-13. 6 | // Copyright (c) 2013年 Minqian Liu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface STCategory : NSObject 12 | { 13 | NSString* name; 14 | NSString* URLString; 15 | NSString* colorHex; 16 | NSString* borderColorHex; 17 | } 18 | 19 | @property(strong, nonatomic) NSString* borderColorHex; 20 | @property(strong, nonatomic) NSString* colorHex; 21 | @property(strong, nonatomic) NSString* URLString; 22 | @property(strong, nonatomic) NSString* name; 23 | 24 | -(id)initWithJSON:(id)json; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /SvpplyTable/STCategory.m: -------------------------------------------------------------------------------- 1 | // 2 | // STCategory.m 3 | // SvpplyTable 4 | // 5 | // Created by Anonymous on 13-8-13. 6 | // Copyright (c) 2013年 Minqian Liu. All rights reserved. 7 | // 8 | 9 | #import "STCategory.h" 10 | 11 | @implementation STCategory 12 | 13 | @synthesize name, URLString, colorHex, borderColorHex; 14 | 15 | -(id)initWithJSON:(id)json 16 | { 17 | NSDictionary *jsonDict = (NSDictionary *)json; 18 | self = [super init]; 19 | if (self) { 20 | self.name = [jsonDict objectForKey:@"name"]; 21 | self.URLString = [jsonDict objectForKey:@"url"]; 22 | self.colorHex = [jsonDict objectForKey:@"text_color"]; 23 | self.borderColorHex = [jsonDict objectForKey:@"border_color"]; 24 | } 25 | return self; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /SvpplyTable/STTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // STTableViewCell.h 3 | // SvpplyTable 4 | // 5 | // Created by Anonymous on 13-8-13. 6 | // Copyright (c) 2013年 Minqian Liu. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "STCategory.h" 11 | 12 | @interface STTableViewCell : UITableViewCell 13 | { 14 | UILabel *label; 15 | UIColor *color; 16 | STCategory *category; 17 | } 18 | 19 | @property (strong, nonatomic) STCategory *category; 20 | 21 | - (void) setContent:(STCategory *)content; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /SvpplyTable/STTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // STTableViewCell.m 3 | // SvpplyTable 4 | // 5 | // Created by Anonymous on 13-8-13. 6 | // Copyright (c) 2013年 Minqian Liu. All rights reserved. 7 | // 8 | 9 | #import "STTableViewCell.h" 10 | #import "UIColor+HexString.h" 11 | 12 | @implementation STTableViewCell 13 | 14 | @synthesize category; 15 | 16 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 17 | { 18 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 19 | if (self){} 20 | return self; 21 | } 22 | 23 | - (void) setContent:(STCategory *)content 24 | { 25 | self.category = content; 26 | 27 | [self.textLabel setTextAlignment:NSTextAlignmentCenter]; 28 | self.textLabel.textColor = [UIColor colorWithHexString:content.colorHex]; 29 | [self.textLabel setText:content.name]; 30 | [self.textLabel setFont:[UIFont boldSystemFontOfSize:20]]; 31 | [self.textLabel setBackgroundColor:[UIColor clearColor]]; 32 | [self.contentView setBackgroundColor:[UIColor blackColor]]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /SvpplyTable/STTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // STTableViewController.h 3 | // SvpplyTable 4 | // 5 | // Created by Anonymous on 13-8-13. 6 | // Copyright (c) 2013年 Minqian Liu. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "STCategory.h" 11 | 12 | @interface STTableViewController : UITableViewController 13 | < 14 | UITableViewDataSource, 15 | UITableViewDelegate 16 | > 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /SvpplyTable/STTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // STTableViewController.m 3 | // SvpplyTable 4 | // 5 | // Created by Anonymous on 13-8-13. 6 | // Copyright (c) 2013年 Minqian Liu. All rights reserved. 7 | // 8 | 9 | #import "STTableViewController.h" 10 | #import "STTableViewCell.h" 11 | #import "UIColor+HexString.h" 12 | 13 | #define InitSelectedIndex @"0" 14 | 15 | typedef enum 16 | { 17 | STTableViewRowInsert, 18 | STTableViewRowDelete 19 | }STTableViewRowAction; 20 | 21 | @interface STTableViewController () 22 | { 23 | NSInteger _selectedCategorySection; 24 | NSMutableArray *_categories; 25 | NSMutableDictionary *_structure; 26 | NSMutableArray* _displayedChildren; 27 | } 28 | @property (atomic, assign) NSInteger selectedCategorySection; 29 | 30 | @property (nonatomic, strong) NSMutableArray *categories; 31 | @property (nonatomic, strong) NSMutableDictionary *structure; 32 | @property (nonatomic, strong) NSMutableArray* displayedChildren; 33 | 34 | @end 35 | 36 | @implementation STTableViewController 37 | 38 | 39 | - (id)initWithStyle:(UITableViewStyle)style 40 | { 41 | self = [super initWithStyle:style]; 42 | if (self) { 43 | } 44 | return self; 45 | } 46 | 47 | - (void)viewDidLoad 48 | { 49 | [super viewDidLoad]; 50 | self.categories = [[NSMutableArray alloc] init]; 51 | self.structure = [[NSMutableDictionary alloc] init]; 52 | self.displayedChildren = [[NSMutableArray alloc] init]; 53 | 54 | self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds]; 55 | self.tableView.dataSource = self; 56 | self.tableView.delegate = self; 57 | [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; 58 | [self.tableView setBackgroundColor:[UIColor blackColor]]; 59 | 60 | [self loadDataFromLocalJSON]; 61 | _selectedCategorySection = -1; 62 | [self.displayedChildren addObjectsFromArray:[((NSDictionary *)[self.structure objectForKey:@"0"]) objectForKey:@"forwardIndex"]]; 63 | [self.tableView reloadData]; 64 | } 65 | 66 | - (void)didReceiveMemoryWarning 67 | { 68 | [super didReceiveMemoryWarning]; 69 | // Dispose of any resources that can be recreated. 70 | } 71 | 72 | #pragma mark - UITableView Delegate Methods 73 | 74 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 75 | { 76 | return self.displayedChildren.count; 77 | } 78 | 79 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 80 | { 81 | static NSString *CellIdentifier = @"Cell"; 82 | STTableViewCell *cell = (STTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 83 | 84 | if (cell == nil) 85 | { 86 | cell = [[STTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 87 | } 88 | 89 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 90 | 91 | NSInteger index = [self getCategoryIndexFrom:indexPath.row]; 92 | 93 | STCategory *category = ((STCategory *)[self.categories objectAtIndex:index]); 94 | 95 | cell = [self setCell:cell content:category indexRow:indexPath.row]; 96 | 97 | return cell; 98 | } 99 | 100 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 101 | { 102 | [self setArraysWithSelected:indexPath.row]; 103 | } 104 | 105 | #pragma mark - Animation Methods 106 | 107 | - (void)setArraysWithSelected:(NSInteger)index 108 | { 109 | NSMutableArray *indexPathInsert = [[NSMutableArray alloc] init]; 110 | 111 | NSInteger categoryIndex = [self getCategoryIndexFrom:index]; 112 | 113 | NSInteger currentIndex = -1, movedIndex = -1; 114 | 115 | [self.tableView beginUpdates]; 116 | 117 | if (index == 0 && categoryIndex == 0) 118 | { 119 | currentIndex = _selectedCategorySection; 120 | 121 | _selectedCategorySection = -1; 122 | 123 | [self tableViewBased:currentIndex from:UITableViewRowAnimationTop to:UITableViewRowAnimationFade action:STTableViewRowDelete]; 124 | 125 | 126 | NSInteger rootIndex = [self getCategoryIndexFrom:1]; 127 | 128 | [self.displayedChildren removeAllObjects]; 129 | [self.displayedChildren addObjectsFromArray:[((NSDictionary *)[self.structure objectForKey:@"0"]) objectForKey:@"forwardIndex"]]; 130 | 131 | movedIndex = [self.displayedChildren indexOfObject:[NSString stringWithFormat:@"%d", rootIndex]]; 132 | if (currentIndex != movedIndex) movedIndex = 0; 133 | 134 | [self tableViewBased:movedIndex from:UITableViewRowAnimationBottom to:UITableViewRowAnimationTop action:STTableViewRowInsert]; 135 | 136 | } 137 | else 138 | { 139 | if (_selectedCategorySection == index) 140 | { 141 | NSLog(@"%@", ((STCategory *)[self.categories objectAtIndex:[self getCategoryIndexFrom:_selectedCategorySection]]).name); 142 | [self.tableView endUpdates]; 143 | return; 144 | } 145 | else 146 | { 147 | NSDictionary *categoriesDict = [self.structure objectForKey:[NSString stringWithFormat:@"%d",categoryIndex]]; 148 | NSArray *forwardCategoryArray = [categoriesDict objectForKey:@"forwardIndex"]; 149 | 150 | if (_selectedCategorySection == -1) 151 | { 152 | _selectedCategorySection = 1; 153 | 154 | currentIndex = index; 155 | [self tableViewBased:currentIndex from:UITableViewRowAnimationBottom to:UITableViewRowAnimationFade action:STTableViewRowDelete]; 156 | 157 | [self.displayedChildren removeAllObjects]; 158 | [self.displayedChildren addObject:@"0"]; 159 | [self.displayedChildren addObject:[NSString stringWithFormat:@"%d", categoryIndex]]; 160 | 161 | if (forwardCategoryArray && forwardCategoryArray.count > 0) [self.displayedChildren addObjectsFromArray:forwardCategoryArray]; 162 | 163 | movedIndex = _selectedCategorySection; 164 | 165 | [self tableViewBased:movedIndex from:UITableViewRowAnimationFade to:UITableViewRowAnimationFade action:STTableViewRowInsert]; 166 | 167 | } 168 | else 169 | { 170 | NSRange range; 171 | currentIndex = _selectedCategorySection; 172 | if (index < _selectedCategorySection) 173 | { 174 | range = NSMakeRange(index, self.displayedChildren.count - index); 175 | _selectedCategorySection = index; 176 | } 177 | else 178 | { 179 | range = NSMakeRange(_selectedCategorySection + 1, self.displayedChildren.count - _selectedCategorySection - 1); 180 | [indexPathInsert addObject:[self getIndexPath:_selectedCategorySection]]; 181 | _selectedCategorySection += 1; 182 | } 183 | 184 | [self tableview:self.tableView baseIndexPath:[self getIndexPath:currentIndex] fromIndexPath:[self getIndexPath:range.location] animation:UITableViewRowAnimationNone toIndexPath:[self getIndexPath:range.location + range.length - 1] animation:UITableViewRowAnimationNone tableViewAction:STTableViewRowDelete]; 185 | 186 | [self.displayedChildren removeObjectsInRange:range]; 187 | 188 | [self.displayedChildren addObject:[NSString stringWithFormat:@"%d",categoryIndex]]; 189 | 190 | if (forwardCategoryArray && forwardCategoryArray.count > 0) 191 | { 192 | [indexPathInsert addObjectsFromArray:[self indexPathArray:self.displayedChildren.count end:self.displayedChildren.count + forwardCategoryArray.count -1]]; 193 | [self.displayedChildren addObjectsFromArray:forwardCategoryArray]; 194 | } 195 | movedIndex = _selectedCategorySection; 196 | [self.tableView insertRowsAtIndexPaths:indexPathInsert withRowAnimation:UITableViewRowAnimationFade]; 197 | } 198 | } 199 | } 200 | if (movedIndex > -1) 201 | { 202 | [self.tableView moveRowAtIndexPath:[self getIndexPath:currentIndex] toIndexPath:[self getIndexPath:movedIndex]]; 203 | STCategory *cate = ((STCategory *)[self.categories objectAtIndex:[self getCategoryIndexFrom:movedIndex]]); 204 | [self setCell:(STTableViewCell *)[self.tableView cellForRowAtIndexPath:[self getIndexPath:currentIndex]] content:cate indexRow:movedIndex]; 205 | } 206 | 207 | [self.tableView endUpdates]; 208 | 209 | } 210 | 211 | - (void)tableViewBased:(NSInteger)base from:(UITableViewRowAnimation)from to:(UITableViewRowAnimation)to action:(STTableViewRowAction)action 212 | { 213 | [self tableview:self.tableView baseIndexPath:[self getIndexPath:base] fromIndexPath:[self getIndexPath:0] animation:from toIndexPath:[self getIndexPath:self.displayedChildren.count - 1] animation:to tableViewAction:action]; 214 | } 215 | 216 | - (void)tableview:(UITableView *)tableView baseIndexPath:(NSIndexPath *)baseIndexPath fromIndexPath:(NSIndexPath *)fromIndexPath animation:(UITableViewRowAnimation)baseTofromAnimation toIndexPath:(NSIndexPath *)toIndexPath animation:(UITableViewRowAnimation)baseTotoAnimation tableViewAction:(STTableViewRowAction)action 217 | { 218 | NSMutableArray *array = [[NSMutableArray alloc]init]; 219 | array = [self indexPathArray:fromIndexPath.row end:baseIndexPath.row - 1]; 220 | [self tableView:tableView action:action indexPathArray:array animation:baseTofromAnimation]; 221 | array = [self indexPathArray:baseIndexPath.row + 1 end:toIndexPath.row]; 222 | [self tableView:tableView action:action indexPathArray:array animation:baseTotoAnimation]; 223 | } 224 | 225 | - (void)tableView:(UITableView *)tableView action:(STTableViewRowAction)action indexPathArray:(NSArray *)indexPathArray animation:(UITableViewRowAnimation)animation 226 | { 227 | if (STTableViewRowInsert == action ) 228 | { 229 | [tableView insertRowsAtIndexPaths:indexPathArray withRowAnimation:animation]; 230 | } 231 | else if (STTableViewRowDelete == action) 232 | { 233 | [tableView deleteRowsAtIndexPaths:indexPathArray withRowAnimation:animation]; 234 | } 235 | } 236 | 237 | #pragma mark - Private Methods 238 | 239 | - (STTableViewCell *)setCell:(STTableViewCell *)cell content:(STCategory *)category indexRow:(NSInteger)indexRow 240 | { 241 | [cell setContent:category]; 242 | 243 | if (_selectedCategorySection < 0 ) 244 | { 245 | cell.textLabel.textColor = [UIColor whiteColor]; 246 | [cell.contentView setBackgroundColor:[UIColor colorWithHexString:category.colorHex]]; 247 | } 248 | else 249 | { 250 | if (indexRow < _selectedCategorySection) 251 | { 252 | cell.textLabel.textColor = [UIColor grayColor]; 253 | } 254 | else if (indexRow == _selectedCategorySection) 255 | { 256 | cell.textLabel.textColor = [UIColor whiteColor]; 257 | [cell.contentView setBackgroundColor:[UIColor colorWithHexString:category.colorHex]]; 258 | } 259 | } 260 | return cell; 261 | } 262 | 263 | - (NSInteger) getCategoryIndexFrom:(NSInteger )index 264 | { 265 | if (self.displayedChildren && self.displayedChildren.count > 0 && index >=0 && index < self.displayedChildren.count) 266 | { 267 | return [((NSString *)[self.displayedChildren objectAtIndex:index]) integerValue]; 268 | } 269 | return 0; 270 | } 271 | 272 | - (NSMutableArray *)indexPathArray:(NSInteger)begin end:(NSInteger)end 273 | { 274 | NSMutableArray *indexPathArray = [[NSMutableArray alloc]init]; 275 | for (NSInteger i = begin; i <= end; i++) { 276 | [indexPathArray addObject:[self getIndexPath:i]]; 277 | } 278 | return indexPathArray; 279 | } 280 | 281 | - (NSIndexPath *)getIndexPath:(NSInteger)row 282 | { 283 | return [NSIndexPath indexPathForRow:row inSection:0]; 284 | } 285 | 286 | #pragma mark - Load Data Methods 287 | 288 | - (void) loadDataFromLocalJSON 289 | { 290 | NSString *jsonPath = [[NSBundle mainBundle] pathForResource:@"categories" ofType:@"json"]; 291 | NSData *jsonData = [[NSData alloc] initWithContentsOfFile:jsonPath]; 292 | NSError *error = nil; 293 | NSDictionary * jsonDict = [NSJSONSerialization JSONObjectWithData:jsonData options:kNilOptions error:&error]; 294 | [self parseJSON:[[[jsonDict objectForKey:@"response"] objectForKey:@"categories"] objectAtIndex:0] backIndex:-1]; 295 | } 296 | 297 | - (NSInteger)parseJSON:(NSDictionary*)jsonDict backIndex:(NSInteger)backIndex 298 | { 299 | 300 | NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; 301 | 302 | STCategory *category = [[STCategory alloc]initWithJSON:jsonDict]; 303 | 304 | NSInteger currentIndex = [self.categories count]; 305 | [self.categories addObject:category]; 306 | 307 | NSMutableArray *array = [[NSMutableArray alloc] init]; 308 | NSMutableArray *jsonArray = [jsonDict objectForKey:@"children"]; 309 | 310 | if (jsonArray && jsonArray.count > 0) { 311 | for (NSDictionary *jsonCategoryDict in jsonArray) { 312 | [array addObject: [NSString stringWithFormat:@"%d", [self parseJSON:jsonCategoryDict backIndex:currentIndex]]]; 313 | } 314 | } 315 | 316 | [dict setObject:[NSString stringWithFormat:@"%d", backIndex] forKey:@"backIndex"]; 317 | if (array && array.count > 0) { 318 | [dict setObject:array forKey:@"forwardIndex"]; 319 | } 320 | 321 | [self.structure setObject:dict forKey:[NSString stringWithFormat:@"%d",currentIndex]]; 322 | 323 | return currentIndex; 324 | } 325 | 326 | @end 327 | -------------------------------------------------------------------------------- /SvpplyTable/SvpplyTable-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.bluelion.${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 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /SvpplyTable/SvpplyTable-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_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /SvpplyTable/UIColor+HexString.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+HexString.h 3 | // SvpplyTable 4 | // 5 | // Created by Anonymous on 13-8-14. 6 | // Copyright (c) 2013年 Minqian Liu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (HexString) 12 | 13 | + (UIColor *) colorWithHexString: (NSString *) stringToConvert; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SvpplyTable/UIColor+HexString.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+HexString.m 3 | // SvpplyTable 4 | // 5 | // Created by Anonymous on 13-8-14. 6 | // Copyright (c) 2013年 Minqian Liu. All rights reserved. 7 | // 8 | 9 | #import "UIColor+HexString.h" 10 | 11 | @implementation UIColor (HexString) 12 | 13 | + (UIColor *) colorWithHexString: (NSString *) stringToConvert 14 | { 15 | NSString *cString = [[stringToConvert stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString]; //去掉前后空格换行符 16 | 17 | // String should be 6 or 8 characters 18 | if ([cString length] < 6) return [UIColor redColor]; 19 | 20 | // strip 0X if it appears 21 | if ([cString hasPrefix:@"0X"]) cString = [cString substringFromIndex:2]; 22 | if ([cString hasPrefix:@"#"]) cString = [cString substringFromIndex:1]; 23 | if ([cString length] != 6) return [UIColor redColor]; 24 | // Separate into r, g, b substrings 25 | NSRange range; 26 | range.location = 0; 27 | range.length = 2; 28 | NSString *rString = [cString substringWithRange:range]; 29 | 30 | range.location = 2; 31 | NSString *gString = [cString substringWithRange:range]; 32 | 33 | range.location = 4; 34 | NSString *bString = [cString substringWithRange:range]; 35 | 36 | // Scan values 37 | unsigned int r, g, b; 38 | [[NSScanner scannerWithString:rString] scanHexInt:&r]; //扫描16进制到int 39 | [[NSScanner scannerWithString:gString] scanHexInt:&g]; 40 | [[NSScanner scannerWithString:bString] scanHexInt:&b]; 41 | 42 | return [UIColor colorWithRed:((float) r / 255.0f) 43 | green:((float) g / 255.0f) 44 | blue:((float) b / 255.0f) 45 | alpha:1.0f]; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /SvpplyTable/Vendors/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/666lm/SvpplyTable/651819859650bff2b43c6ba66535b7d89f54f98a/SvpplyTable/Vendors/.DS_Store -------------------------------------------------------------------------------- /SvpplyTable/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /SvpplyTable/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SvpplyTable 4 | // 5 | // Created by Anonymous on 13-8-13. 6 | // Copyright (c) 2013年 Minqian Liu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "STAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([STAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SvpplyTableTests/SvpplyTableTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.bluelion.${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 | -------------------------------------------------------------------------------- /SvpplyTableTests/SvpplyTableTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SvpplyTableTests.m 3 | // SvpplyTableTests 4 | // 5 | // Created by Anonymous on 13-8-13. 6 | // Copyright (c) 2013年 Minqian Liu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SvpplyTableTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation SvpplyTableTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | 21 | // Set-up code here. 22 | } 23 | 24 | - (void)tearDown 25 | { 26 | // Tear-down code here. 27 | 28 | [super tearDown]; 29 | } 30 | 31 | - (void)testExample 32 | { 33 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /SvpplyTableTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | --------------------------------------------------------------------------------