├── .gitignore ├── EnumTableViewTest.xcodeproj └── project.pbxproj ├── EnumTableViewTest ├── AppDelegate.swift ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Components │ └── TableViewCells │ │ ├── PickerTableViewCell.swift │ │ ├── PickerTableViewCell.xib │ │ ├── SliderTableViewCell.swift │ │ ├── SliderTableViewCell.xib │ │ ├── SwitchTableViewCell.swift │ │ ├── SwitchTableViewCell.xib │ │ ├── TableHeaderView.swift │ │ └── TableHeaderView.xib ├── Constants │ └── Constants.swift ├── Extensions │ └── ViewIndexPathExtension.swift ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── Localizable.strings ├── ViewController.swift └── ViewControllers │ └── MainViewController.swift ├── EnumTableViewTestTests ├── EnumTableViewTestTests.swift └── Info.plist └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.moved-aside 14 | DerivedData 15 | .idea/ 16 | *.hmap 17 | *.xccheckout 18 | 19 | #CocoaPods 20 | Pods 21 | Podfile.lock 22 | *.xcworkspace 23 | -------------------------------------------------------------------------------- /EnumTableViewTest.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 597D32291B7A4E010021CD41 /* ViewIndexPathExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 597D32281B7A4E010021CD41 /* ViewIndexPathExtension.swift */; }; 11 | 597D700A1B71EFC70054CE32 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 597D70091B71EFC70054CE32 /* AppDelegate.swift */; }; 12 | 597D700F1B71EFC70054CE32 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 597D700D1B71EFC70054CE32 /* Main.storyboard */; }; 13 | 597D70111B71EFC70054CE32 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 597D70101B71EFC70054CE32 /* Images.xcassets */; }; 14 | 597D70141B71EFC70054CE32 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 597D70121B71EFC70054CE32 /* LaunchScreen.xib */; }; 15 | 597D70201B71EFC70054CE32 /* EnumTableViewTestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 597D701F1B71EFC70054CE32 /* EnumTableViewTestTests.swift */; }; 16 | 597D702D1B71F0160054CE32 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 597D702C1B71F0160054CE32 /* MainViewController.swift */; }; 17 | 597D70301B71F0A70054CE32 /* PickerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 597D702E1B71F0A70054CE32 /* PickerTableViewCell.swift */; }; 18 | 597D70311B71F0A70054CE32 /* PickerTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 597D702F1B71F0A70054CE32 /* PickerTableViewCell.xib */; }; 19 | 597D70341B71F0CC0054CE32 /* SliderTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 597D70321B71F0CC0054CE32 /* SliderTableViewCell.swift */; }; 20 | 597D70351B71F0CC0054CE32 /* SliderTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 597D70331B71F0CC0054CE32 /* SliderTableViewCell.xib */; }; 21 | 597D703C1B71F2FE0054CE32 /* SwitchTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 597D703A1B71F2FE0054CE32 /* SwitchTableViewCell.swift */; }; 22 | 597D703D1B71F2FE0054CE32 /* SwitchTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 597D703B1B71F2FE0054CE32 /* SwitchTableViewCell.xib */; }; 23 | 597D70401B71F42A0054CE32 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 597D703F1B71F42A0054CE32 /* Constants.swift */; }; 24 | 597D70481B724D460054CE32 /* TableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 597D70471B724D460054CE32 /* TableHeaderView.swift */; }; 25 | 597D704A1B724D560054CE32 /* TableHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 597D70491B724D560054CE32 /* TableHeaderView.xib */; }; 26 | 597D704C1B7251190054CE32 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 597D704B1B7251190054CE32 /* Localizable.strings */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 597D701A1B71EFC70054CE32 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 597D6FFC1B71EFC70054CE32 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 597D70031B71EFC70054CE32; 35 | remoteInfo = EnumTableViewTest; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 597D32281B7A4E010021CD41 /* ViewIndexPathExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewIndexPathExtension.swift; sourceTree = ""; }; 41 | 597D70041B71EFC70054CE32 /* EnumTableViewTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EnumTableViewTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 597D70081B71EFC70054CE32 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | 597D70091B71EFC70054CE32 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 44 | 597D700E1B71EFC70054CE32 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 597D70101B71EFC70054CE32 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 46 | 597D70131B71EFC70054CE32 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 47 | 597D70191B71EFC70054CE32 /* EnumTableViewTestTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EnumTableViewTestTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 597D701E1B71EFC70054CE32 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 597D701F1B71EFC70054CE32 /* EnumTableViewTestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumTableViewTestTests.swift; sourceTree = ""; }; 50 | 597D702C1B71F0160054CE32 /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; }; 51 | 597D702E1B71F0A70054CE32 /* PickerTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PickerTableViewCell.swift; sourceTree = ""; }; 52 | 597D702F1B71F0A70054CE32 /* PickerTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PickerTableViewCell.xib; sourceTree = ""; }; 53 | 597D70321B71F0CC0054CE32 /* SliderTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderTableViewCell.swift; sourceTree = ""; }; 54 | 597D70331B71F0CC0054CE32 /* SliderTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SliderTableViewCell.xib; sourceTree = ""; }; 55 | 597D703A1B71F2FE0054CE32 /* SwitchTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwitchTableViewCell.swift; sourceTree = ""; }; 56 | 597D703B1B71F2FE0054CE32 /* SwitchTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SwitchTableViewCell.xib; sourceTree = ""; }; 57 | 597D703F1B71F42A0054CE32 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; 58 | 597D70471B724D460054CE32 /* TableHeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableHeaderView.swift; sourceTree = ""; }; 59 | 597D70491B724D560054CE32 /* TableHeaderView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TableHeaderView.xib; sourceTree = ""; }; 60 | 597D704B1B7251190054CE32 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = ""; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 597D70011B71EFC70054CE32 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | 597D70161B71EFC70054CE32 /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | /* End PBXFrameworksBuildPhase section */ 79 | 80 | /* Begin PBXGroup section */ 81 | 597D32251B7A49520021CD41 /* Extensions */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 597D32281B7A4E010021CD41 /* ViewIndexPathExtension.swift */, 85 | ); 86 | path = Extensions; 87 | sourceTree = ""; 88 | }; 89 | 597D6FFB1B71EFC70054CE32 = { 90 | isa = PBXGroup; 91 | children = ( 92 | 597D70061B71EFC70054CE32 /* EnumTableViewTest */, 93 | 597D701C1B71EFC70054CE32 /* EnumTableViewTestTests */, 94 | 597D70051B71EFC70054CE32 /* Products */, 95 | ); 96 | sourceTree = ""; 97 | }; 98 | 597D70051B71EFC70054CE32 /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 597D70041B71EFC70054CE32 /* EnumTableViewTest.app */, 102 | 597D70191B71EFC70054CE32 /* EnumTableViewTestTests.xctest */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | 597D70061B71EFC70054CE32 /* EnumTableViewTest */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 597D32251B7A49520021CD41 /* Extensions */, 111 | 597D703E1B71F41E0054CE32 /* Constants */, 112 | 597D70291B71EFFC0054CE32 /* ViewControllers */, 113 | 597D702A1B71EFFC0054CE32 /* Components */, 114 | 597D70091B71EFC70054CE32 /* AppDelegate.swift */, 115 | 597D700D1B71EFC70054CE32 /* Main.storyboard */, 116 | 597D70101B71EFC70054CE32 /* Images.xcassets */, 117 | 597D70121B71EFC70054CE32 /* LaunchScreen.xib */, 118 | 597D70071B71EFC70054CE32 /* Supporting Files */, 119 | ); 120 | path = EnumTableViewTest; 121 | sourceTree = ""; 122 | }; 123 | 597D70071B71EFC70054CE32 /* Supporting Files */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 597D70081B71EFC70054CE32 /* Info.plist */, 127 | 597D704B1B7251190054CE32 /* Localizable.strings */, 128 | ); 129 | name = "Supporting Files"; 130 | sourceTree = ""; 131 | }; 132 | 597D701C1B71EFC70054CE32 /* EnumTableViewTestTests */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 597D701F1B71EFC70054CE32 /* EnumTableViewTestTests.swift */, 136 | 597D701D1B71EFC70054CE32 /* Supporting Files */, 137 | ); 138 | path = EnumTableViewTestTests; 139 | sourceTree = ""; 140 | }; 141 | 597D701D1B71EFC70054CE32 /* Supporting Files */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 597D701E1B71EFC70054CE32 /* Info.plist */, 145 | ); 146 | name = "Supporting Files"; 147 | sourceTree = ""; 148 | }; 149 | 597D70291B71EFFC0054CE32 /* ViewControllers */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 597D702C1B71F0160054CE32 /* MainViewController.swift */, 153 | ); 154 | path = ViewControllers; 155 | sourceTree = ""; 156 | }; 157 | 597D702A1B71EFFC0054CE32 /* Components */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | 597D702B1B71EFFC0054CE32 /* TableViewCells */, 161 | ); 162 | path = Components; 163 | sourceTree = ""; 164 | }; 165 | 597D702B1B71EFFC0054CE32 /* TableViewCells */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | 597D702E1B71F0A70054CE32 /* PickerTableViewCell.swift */, 169 | 597D702F1B71F0A70054CE32 /* PickerTableViewCell.xib */, 170 | 597D70321B71F0CC0054CE32 /* SliderTableViewCell.swift */, 171 | 597D70331B71F0CC0054CE32 /* SliderTableViewCell.xib */, 172 | 597D703A1B71F2FE0054CE32 /* SwitchTableViewCell.swift */, 173 | 597D703B1B71F2FE0054CE32 /* SwitchTableViewCell.xib */, 174 | 597D70471B724D460054CE32 /* TableHeaderView.swift */, 175 | 597D70491B724D560054CE32 /* TableHeaderView.xib */, 176 | ); 177 | path = TableViewCells; 178 | sourceTree = ""; 179 | }; 180 | 597D703E1B71F41E0054CE32 /* Constants */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | 597D703F1B71F42A0054CE32 /* Constants.swift */, 184 | ); 185 | path = Constants; 186 | sourceTree = ""; 187 | }; 188 | /* End PBXGroup section */ 189 | 190 | /* Begin PBXNativeTarget section */ 191 | 597D70031B71EFC70054CE32 /* EnumTableViewTest */ = { 192 | isa = PBXNativeTarget; 193 | buildConfigurationList = 597D70231B71EFC70054CE32 /* Build configuration list for PBXNativeTarget "EnumTableViewTest" */; 194 | buildPhases = ( 195 | 597D70001B71EFC70054CE32 /* Sources */, 196 | 597D70011B71EFC70054CE32 /* Frameworks */, 197 | 597D70021B71EFC70054CE32 /* Resources */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | ); 203 | name = EnumTableViewTest; 204 | productName = EnumTableViewTest; 205 | productReference = 597D70041B71EFC70054CE32 /* EnumTableViewTest.app */; 206 | productType = "com.apple.product-type.application"; 207 | }; 208 | 597D70181B71EFC70054CE32 /* EnumTableViewTestTests */ = { 209 | isa = PBXNativeTarget; 210 | buildConfigurationList = 597D70261B71EFC70054CE32 /* Build configuration list for PBXNativeTarget "EnumTableViewTestTests" */; 211 | buildPhases = ( 212 | 597D70151B71EFC70054CE32 /* Sources */, 213 | 597D70161B71EFC70054CE32 /* Frameworks */, 214 | 597D70171B71EFC70054CE32 /* Resources */, 215 | ); 216 | buildRules = ( 217 | ); 218 | dependencies = ( 219 | 597D701B1B71EFC70054CE32 /* PBXTargetDependency */, 220 | ); 221 | name = EnumTableViewTestTests; 222 | productName = EnumTableViewTestTests; 223 | productReference = 597D70191B71EFC70054CE32 /* EnumTableViewTestTests.xctest */; 224 | productType = "com.apple.product-type.bundle.unit-test"; 225 | }; 226 | /* End PBXNativeTarget section */ 227 | 228 | /* Begin PBXProject section */ 229 | 597D6FFC1B71EFC70054CE32 /* Project object */ = { 230 | isa = PBXProject; 231 | attributes = { 232 | LastUpgradeCheck = 0630; 233 | ORGANIZATIONNAME = "47 Degrees"; 234 | TargetAttributes = { 235 | 597D70031B71EFC70054CE32 = { 236 | CreatedOnToolsVersion = 6.3.2; 237 | }; 238 | 597D70181B71EFC70054CE32 = { 239 | CreatedOnToolsVersion = 6.3.2; 240 | TestTargetID = 597D70031B71EFC70054CE32; 241 | }; 242 | }; 243 | }; 244 | buildConfigurationList = 597D6FFF1B71EFC70054CE32 /* Build configuration list for PBXProject "EnumTableViewTest" */; 245 | compatibilityVersion = "Xcode 3.2"; 246 | developmentRegion = English; 247 | hasScannedForEncodings = 0; 248 | knownRegions = ( 249 | en, 250 | Base, 251 | ); 252 | mainGroup = 597D6FFB1B71EFC70054CE32; 253 | productRefGroup = 597D70051B71EFC70054CE32 /* Products */; 254 | projectDirPath = ""; 255 | projectRoot = ""; 256 | targets = ( 257 | 597D70031B71EFC70054CE32 /* EnumTableViewTest */, 258 | 597D70181B71EFC70054CE32 /* EnumTableViewTestTests */, 259 | ); 260 | }; 261 | /* End PBXProject section */ 262 | 263 | /* Begin PBXResourcesBuildPhase section */ 264 | 597D70021B71EFC70054CE32 /* Resources */ = { 265 | isa = PBXResourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | 597D704A1B724D560054CE32 /* TableHeaderView.xib in Resources */, 269 | 597D700F1B71EFC70054CE32 /* Main.storyboard in Resources */, 270 | 597D70351B71F0CC0054CE32 /* SliderTableViewCell.xib in Resources */, 271 | 597D704C1B7251190054CE32 /* Localizable.strings in Resources */, 272 | 597D70311B71F0A70054CE32 /* PickerTableViewCell.xib in Resources */, 273 | 597D703D1B71F2FE0054CE32 /* SwitchTableViewCell.xib in Resources */, 274 | 597D70141B71EFC70054CE32 /* LaunchScreen.xib in Resources */, 275 | 597D70111B71EFC70054CE32 /* Images.xcassets in Resources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | 597D70171B71EFC70054CE32 /* Resources */ = { 280 | isa = PBXResourcesBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | /* End PBXResourcesBuildPhase section */ 287 | 288 | /* Begin PBXSourcesBuildPhase section */ 289 | 597D70001B71EFC70054CE32 /* Sources */ = { 290 | isa = PBXSourcesBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | 597D702D1B71F0160054CE32 /* MainViewController.swift in Sources */, 294 | 597D70301B71F0A70054CE32 /* PickerTableViewCell.swift in Sources */, 295 | 597D32291B7A4E010021CD41 /* ViewIndexPathExtension.swift in Sources */, 296 | 597D703C1B71F2FE0054CE32 /* SwitchTableViewCell.swift in Sources */, 297 | 597D70481B724D460054CE32 /* TableHeaderView.swift in Sources */, 298 | 597D70341B71F0CC0054CE32 /* SliderTableViewCell.swift in Sources */, 299 | 597D700A1B71EFC70054CE32 /* AppDelegate.swift in Sources */, 300 | 597D70401B71F42A0054CE32 /* Constants.swift in Sources */, 301 | ); 302 | runOnlyForDeploymentPostprocessing = 0; 303 | }; 304 | 597D70151B71EFC70054CE32 /* Sources */ = { 305 | isa = PBXSourcesBuildPhase; 306 | buildActionMask = 2147483647; 307 | files = ( 308 | 597D70201B71EFC70054CE32 /* EnumTableViewTestTests.swift in Sources */, 309 | ); 310 | runOnlyForDeploymentPostprocessing = 0; 311 | }; 312 | /* End PBXSourcesBuildPhase section */ 313 | 314 | /* Begin PBXTargetDependency section */ 315 | 597D701B1B71EFC70054CE32 /* PBXTargetDependency */ = { 316 | isa = PBXTargetDependency; 317 | target = 597D70031B71EFC70054CE32 /* EnumTableViewTest */; 318 | targetProxy = 597D701A1B71EFC70054CE32 /* PBXContainerItemProxy */; 319 | }; 320 | /* End PBXTargetDependency section */ 321 | 322 | /* Begin PBXVariantGroup section */ 323 | 597D700D1B71EFC70054CE32 /* Main.storyboard */ = { 324 | isa = PBXVariantGroup; 325 | children = ( 326 | 597D700E1B71EFC70054CE32 /* Base */, 327 | ); 328 | name = Main.storyboard; 329 | sourceTree = ""; 330 | }; 331 | 597D70121B71EFC70054CE32 /* LaunchScreen.xib */ = { 332 | isa = PBXVariantGroup; 333 | children = ( 334 | 597D70131B71EFC70054CE32 /* Base */, 335 | ); 336 | name = LaunchScreen.xib; 337 | sourceTree = ""; 338 | }; 339 | /* End PBXVariantGroup section */ 340 | 341 | /* Begin XCBuildConfiguration section */ 342 | 597D70211B71EFC70054CE32 /* Debug */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ALWAYS_SEARCH_USER_PATHS = NO; 346 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 347 | CLANG_CXX_LIBRARY = "libc++"; 348 | CLANG_ENABLE_MODULES = YES; 349 | CLANG_ENABLE_OBJC_ARC = YES; 350 | CLANG_WARN_BOOL_CONVERSION = YES; 351 | CLANG_WARN_CONSTANT_CONVERSION = YES; 352 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 353 | CLANG_WARN_EMPTY_BODY = YES; 354 | CLANG_WARN_ENUM_CONVERSION = YES; 355 | CLANG_WARN_INT_CONVERSION = YES; 356 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 357 | CLANG_WARN_UNREACHABLE_CODE = YES; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 360 | COPY_PHASE_STRIP = NO; 361 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 362 | ENABLE_STRICT_OBJC_MSGSEND = YES; 363 | GCC_C_LANGUAGE_STANDARD = gnu99; 364 | GCC_DYNAMIC_NO_PIC = NO; 365 | GCC_NO_COMMON_BLOCKS = YES; 366 | GCC_OPTIMIZATION_LEVEL = 0; 367 | GCC_PREPROCESSOR_DEFINITIONS = ( 368 | "DEBUG=1", 369 | "$(inherited)", 370 | ); 371 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 379 | MTL_ENABLE_DEBUG_INFO = YES; 380 | ONLY_ACTIVE_ARCH = YES; 381 | SDKROOT = iphoneos; 382 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 383 | }; 384 | name = Debug; 385 | }; 386 | 597D70221B71EFC70054CE32 /* Release */ = { 387 | isa = XCBuildConfiguration; 388 | buildSettings = { 389 | ALWAYS_SEARCH_USER_PATHS = NO; 390 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 391 | CLANG_CXX_LIBRARY = "libc++"; 392 | CLANG_ENABLE_MODULES = YES; 393 | CLANG_ENABLE_OBJC_ARC = YES; 394 | CLANG_WARN_BOOL_CONVERSION = YES; 395 | CLANG_WARN_CONSTANT_CONVERSION = YES; 396 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 397 | CLANG_WARN_EMPTY_BODY = YES; 398 | CLANG_WARN_ENUM_CONVERSION = YES; 399 | CLANG_WARN_INT_CONVERSION = YES; 400 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 401 | CLANG_WARN_UNREACHABLE_CODE = YES; 402 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 403 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 404 | COPY_PHASE_STRIP = NO; 405 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 406 | ENABLE_NS_ASSERTIONS = NO; 407 | ENABLE_STRICT_OBJC_MSGSEND = YES; 408 | GCC_C_LANGUAGE_STANDARD = gnu99; 409 | GCC_NO_COMMON_BLOCKS = YES; 410 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 411 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 412 | GCC_WARN_UNDECLARED_SELECTOR = YES; 413 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 414 | GCC_WARN_UNUSED_FUNCTION = YES; 415 | GCC_WARN_UNUSED_VARIABLE = YES; 416 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 417 | MTL_ENABLE_DEBUG_INFO = NO; 418 | SDKROOT = iphoneos; 419 | VALIDATE_PRODUCT = YES; 420 | }; 421 | name = Release; 422 | }; 423 | 597D70241B71EFC70054CE32 /* Debug */ = { 424 | isa = XCBuildConfiguration; 425 | buildSettings = { 426 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 427 | INFOPLIST_FILE = EnumTableViewTest/Info.plist; 428 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 429 | PRODUCT_NAME = "$(TARGET_NAME)"; 430 | }; 431 | name = Debug; 432 | }; 433 | 597D70251B71EFC70054CE32 /* Release */ = { 434 | isa = XCBuildConfiguration; 435 | buildSettings = { 436 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 437 | INFOPLIST_FILE = EnumTableViewTest/Info.plist; 438 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 439 | PRODUCT_NAME = "$(TARGET_NAME)"; 440 | }; 441 | name = Release; 442 | }; 443 | 597D70271B71EFC70054CE32 /* Debug */ = { 444 | isa = XCBuildConfiguration; 445 | buildSettings = { 446 | BUNDLE_LOADER = "$(TEST_HOST)"; 447 | FRAMEWORK_SEARCH_PATHS = ( 448 | "$(SDKROOT)/Developer/Library/Frameworks", 449 | "$(inherited)", 450 | ); 451 | GCC_PREPROCESSOR_DEFINITIONS = ( 452 | "DEBUG=1", 453 | "$(inherited)", 454 | ); 455 | INFOPLIST_FILE = EnumTableViewTestTests/Info.plist; 456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 457 | PRODUCT_NAME = "$(TARGET_NAME)"; 458 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EnumTableViewTest.app/EnumTableViewTest"; 459 | }; 460 | name = Debug; 461 | }; 462 | 597D70281B71EFC70054CE32 /* Release */ = { 463 | isa = XCBuildConfiguration; 464 | buildSettings = { 465 | BUNDLE_LOADER = "$(TEST_HOST)"; 466 | FRAMEWORK_SEARCH_PATHS = ( 467 | "$(SDKROOT)/Developer/Library/Frameworks", 468 | "$(inherited)", 469 | ); 470 | INFOPLIST_FILE = EnumTableViewTestTests/Info.plist; 471 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 472 | PRODUCT_NAME = "$(TARGET_NAME)"; 473 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EnumTableViewTest.app/EnumTableViewTest"; 474 | }; 475 | name = Release; 476 | }; 477 | /* End XCBuildConfiguration section */ 478 | 479 | /* Begin XCConfigurationList section */ 480 | 597D6FFF1B71EFC70054CE32 /* Build configuration list for PBXProject "EnumTableViewTest" */ = { 481 | isa = XCConfigurationList; 482 | buildConfigurations = ( 483 | 597D70211B71EFC70054CE32 /* Debug */, 484 | 597D70221B71EFC70054CE32 /* Release */, 485 | ); 486 | defaultConfigurationIsVisible = 0; 487 | defaultConfigurationName = Release; 488 | }; 489 | 597D70231B71EFC70054CE32 /* Build configuration list for PBXNativeTarget "EnumTableViewTest" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | 597D70241B71EFC70054CE32 /* Debug */, 493 | 597D70251B71EFC70054CE32 /* Release */, 494 | ); 495 | defaultConfigurationIsVisible = 0; 496 | defaultConfigurationName = Release; 497 | }; 498 | 597D70261B71EFC70054CE32 /* Build configuration list for PBXNativeTarget "EnumTableViewTestTests" */ = { 499 | isa = XCConfigurationList; 500 | buildConfigurations = ( 501 | 597D70271B71EFC70054CE32 /* Debug */, 502 | 597D70281B71EFC70054CE32 /* Release */, 503 | ); 504 | defaultConfigurationIsVisible = 0; 505 | defaultConfigurationName = Release; 506 | }; 507 | /* End XCConfigurationList section */ 508 | }; 509 | rootObject = 597D6FFC1B71EFC70054CE32 /* Project object */; 510 | } 511 | -------------------------------------------------------------------------------- /EnumTableViewTest/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 47 Degrees, LLC http://47deg.com hello@47deg.com 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import UIKit 18 | 19 | @UIApplicationMain 20 | class AppDelegate: UIResponder, UIApplicationDelegate { 21 | 22 | var window: UIWindow? 23 | 24 | 25 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 26 | // Override point for customization after application launch. 27 | return true 28 | } 29 | 30 | func applicationWillResignActive(application: UIApplication) { 31 | // 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. 32 | // 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. 33 | } 34 | 35 | func applicationDidEnterBackground(application: UIApplication) { 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 | func applicationWillEnterForeground(application: UIApplication) { 41 | // 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. 42 | } 43 | 44 | func applicationDidBecomeActive(application: UIApplication) { 45 | // 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. 46 | } 47 | 48 | func applicationWillTerminate(application: UIApplication) { 49 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 50 | } 51 | 52 | 53 | } 54 | 55 | -------------------------------------------------------------------------------- /EnumTableViewTest/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /EnumTableViewTest/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /EnumTableViewTest/Components/TableViewCells/PickerTableViewCell.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 47 Degrees, LLC http://47deg.com hello@47deg.com 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import UIKit 18 | 19 | class PickerTableViewCell: UITableViewCell { 20 | 21 | @IBOutlet weak var pickerView: UIPickerView! 22 | 23 | } 24 | -------------------------------------------------------------------------------- /EnumTableViewTest/Components/TableViewCells/PickerTableViewCell.xib: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /EnumTableViewTest/Components/TableViewCells/SliderTableViewCell.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 47 Degrees, LLC http://47deg.com hello@47deg.com 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import UIKit 18 | 19 | class SliderTableViewCell: UITableViewCell { 20 | 21 | @IBOutlet weak var lblTitle: UILabel! 22 | @IBOutlet weak var lblValue: UILabel! 23 | @IBOutlet weak var slider: UISlider! 24 | 25 | } 26 | -------------------------------------------------------------------------------- /EnumTableViewTest/Components/TableViewCells/SliderTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 23 | 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 | -------------------------------------------------------------------------------- /EnumTableViewTest/Components/TableViewCells/SwitchTableViewCell.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 47 Degrees, LLC http://47deg.com hello@47deg.com 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import UIKit 18 | 19 | class SwitchTableViewCell: UITableViewCell { 20 | 21 | @IBOutlet weak var lblTitle: UILabel! 22 | @IBOutlet weak var switchBtn: UISwitch! 23 | 24 | } 25 | -------------------------------------------------------------------------------- /EnumTableViewTest/Components/TableViewCells/SwitchTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /EnumTableViewTest/Components/TableViewCells/TableHeaderView.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 47 Degrees, LLC http://47deg.com hello@47deg.com 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import UIKit 18 | 19 | class TableHeaderView: UITableViewHeaderFooterView { 20 | 21 | @IBOutlet weak var lblTitle: UILabel! 22 | 23 | } 24 | -------------------------------------------------------------------------------- /EnumTableViewTest/Components/TableViewCells/TableHeaderView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /EnumTableViewTest/Constants/Constants.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 47 Degrees, LLC http://47deg.com hello@47deg.com 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import Foundation 18 | 19 | let kTableCellIdentifierPicker = "PickerTableViewCell" 20 | let kTableCellIdentifierSlider = "SliderTableViewCell" 21 | let kTableCellIdentifierSwitch = "SwitchTableViewCell" 22 | let kTableHeaderIdentifier = "TableViewHeader" 23 | let kTableCellHeightPicker = 162.0 24 | let kTableCellHeightRegular = 44.0 25 | let kTableNumberOfSections = 3 26 | 27 | let kThicknessValueForThin : Float = 0.0 28 | let kThicknessValueForRegular : Float = 0.1 29 | let kThicknessValueForThick : Float = 0.2 30 | 31 | let kComponentsInSaucePickerView = 1 -------------------------------------------------------------------------------- /EnumTableViewTest/Extensions/ViewIndexPathExtension.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 47 Degrees, LLC http://47deg.com hello@47deg.com 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import UIKit 18 | 19 | let kSectionTag = 1000 20 | 21 | func indexPathFromTag(tag: Int) -> NSIndexPath? { 22 | if tag > 0 { 23 | let section = ((tag / kSectionTag) - 1) 24 | let row = tag % kSectionTag 25 | return NSIndexPath(forRow: row, inSection: section) 26 | } 27 | return nil 28 | } 29 | 30 | func tagFromIndexPath(indexPath: NSIndexPath?) -> Int { 31 | if let _indexPath = indexPath { 32 | return ((_indexPath.section + 1) * kSectionTag) + _indexPath.row 33 | } else { 34 | return 0 35 | } 36 | } 37 | 38 | extension UIView { 39 | var indexPath : NSIndexPath? { 40 | get { 41 | return indexPathFromTag(self.tag) 42 | } 43 | set { 44 | self.tag = tagFromIndexPath(newValue) 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /EnumTableViewTest/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /EnumTableViewTest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIViewControllerBasedStatusBarAppearance 6 | 7 | UIStatusBarHidden 8 | 9 | CFBundleDevelopmentRegion 10 | en 11 | CFBundleExecutable 12 | $(EXECUTABLE_NAME) 13 | CFBundleIdentifier 14 | com.47deg.$(PRODUCT_NAME:rfc1034identifier) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | $(PRODUCT_NAME) 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1 27 | LSRequiresIPhoneOS 28 | 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIMainStoryboardFile 32 | Main 33 | UIRequiredDeviceCapabilities 34 | 35 | armv7 36 | 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationLandscapeLeft 41 | UIInterfaceOrientationLandscapeRight 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /EnumTableViewTest/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 47 Degrees, LLC http://47deg.com hello@47deg.com 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | "section_title_dough" = "Dough styles"; 18 | "section_title_ingredients" = "Available ingredients"; 19 | 20 | "row_dough_thickness_title" = "Thickness"; 21 | "row_dough_cheese_border_title" = "Cheese Border"; 22 | 23 | "row_ingredients_sauce_title" = ""; 24 | "row_ingredients_olives_title" = "Olives"; 25 | "row_ingredients_beef_title" = "Beef"; 26 | "row_ingredients_bacon_title" = "Bacon"; 27 | "row_ingredients_anchovies_title" = "Anchovies"; 28 | 29 | "picker_sauce_tomato_title" = "Tomato"; 30 | "picker_sauce_bbq_title" = "BBQ"; 31 | "picker_sauce_spicy_title" = "Spicy"; 32 | "picker_sauce_carbonara_title" = "Carbonara"; 33 | 34 | "slider_thickness_thin" = "Thin"; 35 | "slider_thickness_regular" = "Regular"; 36 | "slider_thickness_thick" = "Thick"; 37 | 38 | "order_border_cheese" = "cheese border"; 39 | "order_border_no_cheese" = "border"; 40 | "order_no_ingredients" = "no ingredients whatsoever"; 41 | "order_ingredients_prefix" = "the following ingredients: "; -------------------------------------------------------------------------------- /EnumTableViewTest/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // EnumTableViewTest 4 | // 5 | // Created by Javier de Silóniz Sandino on 5/8/15. 6 | // Copyright (c) 2015 47 Degrees. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /EnumTableViewTest/ViewControllers/MainViewController.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 47 Degrees, LLC http://47deg.com hello@47deg.com 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | * not use this file except in compliance with the License. You may obtain 6 | * a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import UIKit 18 | 19 | protocol Row { 20 | /** 21 | Returns the title of this row. 22 | */ 23 | func title() -> String 24 | 25 | /** 26 | Returns a tuple containing the function that configures the cell corresponding to this row, and its cell identifier. 27 | */ 28 | func configurationFunctionAndIdentifier(owner: MainViewController) -> (((UITableViewCell, NSIndexPath) -> UITableViewCell), String) 29 | 30 | /** 31 | Returns the height of this row. 32 | */ 33 | func rowHeight() -> CGFloat 34 | 35 | /** 36 | Returns the current value corresponding to this row. 37 | 38 | :param: owner The owner of the data model for the table view. 39 | 40 | :returns: current value for this row if any. 41 | */ 42 | func currentValue(owner: MainViewController) -> Any? 43 | 44 | /** 45 | Assigns a new value to the model corresponding to this row. Usually called after an user interaction with its cell. 46 | 47 | :param: owner The owner of the data model for the table view. 48 | :param: value The new value, if any. 49 | */ 50 | func assignValue(owner: MainViewController, value: Any?) 51 | } 52 | 53 | class MainViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UIPickerViewDelegate { 54 | 55 | // MARK: - Enums representing our table data and organization 56 | /// Section | An enum representing the set of tableView sections. 57 | enum Section : Int { 58 | case Dough = 0 59 | case Ingredients = 1 60 | 61 | /** 62 | Returns an array containing all our enum cases, useful to access their count. 63 | */ 64 | static let allValues = [Section.Dough, Section.Ingredients] 65 | 66 | /** 67 | Returns the title of this section. 68 | */ 69 | func title() -> String? { 70 | switch self { 71 | case .Dough: return NSLocalizedString("section_title_dough", comment: "") 72 | case .Ingredients: return NSLocalizedString("section_title_ingredients", comment: "") 73 | } 74 | } 75 | 76 | /** 77 | Returns the corresponding enum case for an specific row inside in this section. 78 | */ 79 | func caseForRow(row: Int) -> Row? { 80 | switch self { 81 | case .Dough: return SectionDoughRows(rawValue: row) 82 | case .Ingredients: return SectionIngredientsRows(rawValue: row) 83 | } 84 | } 85 | 86 | /** 87 | Returns the height of the header area of this section. 88 | */ 89 | func headerHeight() -> CGFloat { 90 | return CGFloat(kTableCellHeightRegular) 91 | } 92 | 93 | /** 94 | Returns the header view of this section. 95 | */ 96 | func headerView(tableView: UITableView) -> UIView? { 97 | let header = tableView.dequeueReusableHeaderFooterViewWithIdentifier(kTableHeaderIdentifier) as! TableHeaderView 98 | if let sectionName = self.title() { 99 | header.lblTitle.text = sectionName 100 | } 101 | return header 102 | } 103 | } 104 | 105 | /// SectionDoughRows | An enum representing the set of rows of the section depicting a pizza's dough. 106 | enum SectionDoughRows : Int, Row { 107 | case Thickness = 0 108 | case CheeseBorder = 1 109 | 110 | static let allValues = [SectionDoughRows.Thickness, SectionDoughRows.CheeseBorder] 111 | 112 | func title() -> String { 113 | switch self { 114 | case .Thickness: return NSLocalizedString("row_dough_thickness_title", comment: "") 115 | case .CheeseBorder: return NSLocalizedString("row_dough_cheese_border_title", comment: "") 116 | } 117 | } 118 | 119 | func configurationFunctionAndIdentifier(owner: MainViewController) -> (((UITableViewCell, NSIndexPath) -> UITableViewCell), String) { 120 | switch self { 121 | case .Thickness: return (owner.configureSliderCell, kTableCellIdentifierSlider) 122 | case .CheeseBorder: return (owner.configureSwitchCell, kTableCellIdentifierSwitch) 123 | } 124 | } 125 | 126 | func rowHeight() -> CGFloat { 127 | return CGFloat(kTableCellHeightRegular) 128 | } 129 | 130 | func currentValue(owner: MainViewController) -> Any? { 131 | switch self { 132 | case .Thickness: return owner.doughThickness 133 | case .CheeseBorder: return owner.shouldHaveCheeseBorder 134 | } 135 | } 136 | 137 | func assignValue(owner: MainViewController, value: Any?) { 138 | switch self { 139 | case .Thickness: 140 | if let thickness = value as? Float { 141 | owner.doughThickness = DoughThickness.thicknessFromSliderValue(thickness) 142 | } 143 | case .CheeseBorder: 144 | if let shouldHaveCheeseBorder = value as? Bool { 145 | owner.shouldHaveCheeseBorder = shouldHaveCheeseBorder 146 | } 147 | } 148 | } 149 | } 150 | 151 | enum SectionIngredientsRows : Int, Row { 152 | case Sauce = 0 153 | case Olives = 1 154 | case Beef = 2 155 | case Bacon = 3 156 | case Anchovies = 4 157 | 158 | static let allValues = [SectionIngredientsRows.Sauce, SectionIngredientsRows.Olives, SectionIngredientsRows.Beef, SectionIngredientsRows.Bacon, SectionIngredientsRows.Anchovies] 159 | 160 | func title() -> String { 161 | switch self { 162 | case .Sauce: return NSLocalizedString("row_ingredients_sauce_title", comment: "") 163 | case .Olives: return NSLocalizedString("row_ingredients_olives_title", comment: "") 164 | case .Beef: return NSLocalizedString("row_ingredients_beef_title", comment: "") 165 | case .Bacon: return NSLocalizedString("row_ingredients_bacon_title", comment: "") 166 | case .Anchovies: return NSLocalizedString("row_ingredients_anchovies_title", comment: "") 167 | } 168 | } 169 | 170 | func configurationFunctionAndIdentifier(owner: MainViewController) -> (((UITableViewCell, NSIndexPath) -> UITableViewCell), String) { 171 | switch self { 172 | case .Sauce: return (owner.configurePickerCell, kTableCellIdentifierPicker) 173 | case .Olives, .Beef, .Bacon, .Anchovies: return (owner.configureSwitchCell, kTableCellIdentifierSwitch) 174 | } 175 | } 176 | 177 | func rowHeight() -> CGFloat { 178 | switch self { 179 | case .Sauce: return CGFloat(kTableCellHeightPicker) 180 | case .Olives, .Beef, .Bacon, .Anchovies: return CGFloat(kTableCellHeightRegular) 181 | } 182 | } 183 | 184 | func currentValue(owner: MainViewController) -> Any? { 185 | switch self { 186 | case .Sauce: return owner.sauceType 187 | case .Olives: return owner.shouldHaveOlives 188 | case .Beef: return owner.shouldHaveBeef 189 | case .Bacon: return owner.shouldHaveBacon 190 | case .Anchovies: return owner.shouldHaveAnchovies 191 | } 192 | } 193 | 194 | func assignValue(owner: MainViewController, value: Any?) { 195 | switch self { 196 | case .Sauce: 197 | if let sauceType = value as? MainViewController.Sauce { 198 | owner.sauceType = sauceType 199 | } 200 | case .Olives: 201 | if let shouldHaveOlives = value as? Bool { 202 | owner.shouldHaveOlives = shouldHaveOlives 203 | } 204 | case .Beef: 205 | if let shouldHaveBeef = value as? Bool { 206 | owner.shouldHaveBeef = shouldHaveBeef 207 | } 208 | case .Bacon: 209 | if let shouldHaveBacon = value as? Bool { 210 | owner.shouldHaveBacon = shouldHaveBacon 211 | } 212 | case .Anchovies: 213 | if let shouldHaveAnchovies = value as? Bool { 214 | owner.shouldHaveAnchovies = shouldHaveAnchovies 215 | } 216 | } 217 | } 218 | } 219 | 220 | // MARK: - Enums representing other data 221 | enum DoughThickness { 222 | case Thin 223 | case Regular 224 | case Thick 225 | 226 | static func thicknessFromSliderValue(value: Float) -> DoughThickness { 227 | switch value { 228 | case _ where value <= kThicknessValueForThin: return DoughThickness.Thin 229 | case _ where value > kThicknessValueForThin && value <= kThicknessValueForRegular: return DoughThickness.Regular 230 | case _ where value > kThicknessValueForRegular && value <= kThicknessValueForThick: return DoughThickness.Thick 231 | default: return DoughThickness.Thick 232 | } 233 | } 234 | 235 | func title() -> String { 236 | switch self { 237 | case .Thin: return NSLocalizedString("slider_thickness_thin", comment: "") 238 | case .Regular: return NSLocalizedString("slider_thickness_regular", comment: "") 239 | case .Thick: return NSLocalizedString("slider_thickness_thick", comment: "") 240 | } 241 | } 242 | 243 | func floatValue() -> Float { 244 | switch self { 245 | case .Thin: return kThicknessValueForThin 246 | case .Regular: return kThicknessValueForRegular 247 | case .Thick: return kThicknessValueForThick 248 | } 249 | } 250 | } 251 | 252 | enum Sauce { 253 | case Tomato 254 | case BBQ 255 | case Spicy 256 | case Carbonara 257 | 258 | static func allValues() -> [Sauce] { 259 | return [Sauce.Tomato, Sauce.BBQ, Sauce.Spicy, Sauce.Carbonara] 260 | } 261 | 262 | func title() -> String { 263 | switch self { 264 | case .Tomato: return NSLocalizedString("picker_sauce_tomato_title", comment: "") 265 | case .BBQ: return NSLocalizedString("picker_sauce_bbq_title", comment: "") 266 | case .Spicy: return NSLocalizedString("picker_sauce_spicy_title", comment: "") 267 | case .Carbonara: return NSLocalizedString("picker_sauce_carbonara_title", comment: "") 268 | } 269 | } 270 | } 271 | 272 | // MARK: - View Controller's properties and life cycle 273 | 274 | @IBOutlet weak var tblMain: UITableView! 275 | var doughThickness : DoughThickness = DoughThickness.Thin 276 | var shouldHaveCheeseBorder : Bool = false 277 | var sauceType : Sauce = Sauce.Tomato 278 | var shouldHaveOlives : Bool = false 279 | var shouldHaveBeef : Bool = false 280 | var shouldHaveBacon : Bool = true 281 | var shouldHaveAnchovies : Bool = false 282 | 283 | override func viewDidLoad() { 284 | super.viewDidLoad() 285 | 286 | tblMain.registerNib(UINib(nibName: "PickerTableViewCell", bundle: nil), forCellReuseIdentifier: kTableCellIdentifierPicker) 287 | tblMain.registerNib(UINib(nibName: "SliderTableViewCell", bundle: nil), forCellReuseIdentifier: kTableCellIdentifierSlider) 288 | tblMain.registerNib(UINib(nibName: "SwitchTableViewCell", bundle: nil), forCellReuseIdentifier: kTableCellIdentifierSwitch) 289 | tblMain.registerNib(UINib(nibName: "TableHeaderView", bundle: nil), forHeaderFooterViewReuseIdentifier: kTableHeaderIdentifier) 290 | } 291 | 292 | // MARK: - UITableView delegate, datasource and config methods 293 | // MARK: UITableViewDataSource protocol methods 294 | 295 | func numberOfSectionsInTableView(tableView: UITableView) -> Int { 296 | return Section.allValues.count 297 | } 298 | 299 | func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 300 | let sectionCase = Section.allValues[section] 301 | switch sectionCase { 302 | case .Dough: return SectionDoughRows.allValues.count 303 | case .Ingredients: return SectionIngredientsRows.allValues.count 304 | } 305 | } 306 | 307 | func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 308 | let sectionCase = Section.allValues[indexPath.section] 309 | if let rowCase = sectionCase.caseForRow(indexPath.row) { 310 | let (configFunction, identifier) = rowCase.configurationFunctionAndIdentifier(self) 311 | return configureCellForIdentifier(tableView, cellIdentifier: identifier, indexPath: indexPath, configurationFunction: configFunction) 312 | } 313 | return UITableViewCell(style: .Default, reuseIdentifier: nil) 314 | } 315 | 316 | // MARK: Cell configuration functions 317 | 318 | func configureCellForIdentifier(tableView: UITableView, cellIdentifier: String, indexPath: NSIndexPath, configurationFunction: (UITableViewCell, NSIndexPath) -> UITableViewCell) -> UITableViewCell { 319 | let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! UITableViewCell 320 | return configurationFunction(cell, indexPath) 321 | } 322 | 323 | func configurePickerCell(cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 324 | if let pickerCell = cell as? PickerTableViewCell { 325 | pickerCell.pickerView.delegate = self 326 | pickerCell.pickerView.indexPath = indexPath 327 | if let index = find(Sauce.allValues(), sauceType) { 328 | pickerCell.pickerView.selectRow(index, inComponent: 0, animated: false) 329 | } 330 | return pickerCell 331 | } 332 | return cell 333 | } 334 | 335 | func configureSliderCell(cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 336 | let sectionCase = Section.allValues[indexPath.section] 337 | if let sliderCell = cell as? SliderTableViewCell, 338 | let rowCase = sectionCase.caseForRow(indexPath.row) { 339 | sliderCell.slider.addTarget(self, action: "didChangeSliderValue:", forControlEvents: .ValueChanged) 340 | sliderCell.lblTitle.text = rowCase.title() 341 | sliderCell.slider.indexPath = indexPath 342 | 343 | if let value = rowCase.currentValue(self) as? DoughThickness { 344 | sliderCell.lblValue.text = "\(value.title())" 345 | sliderCell.slider.value = value.floatValue() 346 | } 347 | return sliderCell 348 | } 349 | return cell 350 | } 351 | 352 | func configureSwitchCell(cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 353 | let sectionCase = Section.allValues[indexPath.section] 354 | if let switchCell = cell as? SwitchTableViewCell, 355 | let rowCase = sectionCase.caseForRow(indexPath.row) { 356 | switchCell.switchBtn.addTarget(self, action: "didPressSwitch:", forControlEvents: UIControlEvents.TouchUpInside) 357 | switchCell.lblTitle.text = rowCase.title() 358 | switchCell.switchBtn.indexPath = indexPath 359 | if let value = rowCase.currentValue(self) as? Bool { 360 | switchCell.switchBtn.on = value 361 | } 362 | return switchCell 363 | } 364 | return cell 365 | } 366 | 367 | // MARK: UITableViewDelegate protocol methods 368 | 369 | func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 370 | tableView.deselectRowAtIndexPath(indexPath, animated: true) 371 | } 372 | 373 | func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { 374 | if let sectionCase = Section(rawValue: indexPath.section), 375 | let rowCase = sectionCase.caseForRow(indexPath.row) { 376 | return rowCase.rowHeight() 377 | } 378 | return 0 379 | } 380 | 381 | func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { 382 | return CGFloat(kTableCellHeightRegular) 383 | } 384 | 385 | func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { 386 | return Section(rawValue: section)?.headerView(tableView) 387 | } 388 | 389 | // MARK: - Value assign generalization 390 | 391 | func assignValueForRowAtIndexPath(someIndexPath: NSIndexPath?, value: Any?) { 392 | if let indexPath = someIndexPath, 393 | let sectionCase = Section(rawValue: indexPath.section), 394 | let rowCase = sectionCase.caseForRow(indexPath.row) { 395 | rowCase.assignValue(self, value: value) 396 | tblMain.reloadRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.None) 397 | } 398 | } 399 | 400 | // MARK: - UIPickerViewDelegate and UIPickerViewDataSource protocols methods 401 | 402 | func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { 403 | return Sauce.allValues().count 404 | } 405 | 406 | func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int { 407 | return kComponentsInSaucePickerView 408 | } 409 | 410 | func pickerView(pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusingView view: UIView!) -> UIView { 411 | let pickerLabel = UILabel() 412 | pickerLabel.textAlignment = .Center 413 | 414 | let attributes = [NSFontAttributeName : UIFont(name: "HelveticaNeue-Medium", size: 18.0)!] 415 | let title = Sauce.allValues()[row].title() 416 | pickerLabel.attributedText = NSAttributedString(string: title, attributes: attributes) 417 | 418 | return pickerLabel 419 | } 420 | 421 | func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { 422 | sauceType = Sauce.allValues()[row] 423 | assignValueForRowAtIndexPath(pickerView.indexPath, value: sauceType) 424 | } 425 | 426 | // MARK: - Slider actions 427 | 428 | func didChangeSliderValue(slider: UISlider) { 429 | assignValueForRowAtIndexPath(slider.indexPath, value: slider.value) 430 | } 431 | 432 | func didPressSwitch(switchBtn: UISwitch) { 433 | assignValueForRowAtIndexPath(switchBtn.indexPath, value: switchBtn.on) 434 | } 435 | 436 | // MARK: - Button logic 437 | 438 | @IBAction func didPressOrderButton(sender: AnyObject) { 439 | let alertController = UIAlertController(title: nil, message: self.orderString(), preferredStyle: .Alert) 440 | alertController.addAction(UIAlertAction(title: "OK", style: .Default, handler: { (alertAction) -> Void in 441 | // Do stuff with the order 442 | })) 443 | alertController.addAction(UIAlertAction(title: "Cancel", style: .Cancel, handler: nil)) 444 | self.presentViewController(alertController, animated: true, completion: nil) 445 | } 446 | 447 | func orderString() -> String { 448 | let borderCheese = shouldHaveCheeseBorder ? NSLocalizedString("order_border_cheese", comment: "") : NSLocalizedString("order_border_no_cheese", comment: "") 449 | 450 | let listOfIngredientsSettings = reduce([(NSLocalizedString("row_ingredients_olives_title", comment: ""), shouldHaveOlives), 451 | (NSLocalizedString("row_ingredients_beef_title", comment: ""), shouldHaveBeef), 452 | (NSLocalizedString("row_ingredients_bacon_title", comment: ""), shouldHaveBacon), 453 | (NSLocalizedString("row_ingredients_anchovies_title", comment: ""), shouldHaveAnchovies)], ""){ (list : String, ingredientSetting: (String, Bool)) -> String in 454 | if ingredientSetting.1 { 455 | if list != "" { 456 | return "\(list), \(ingredientSetting.0.lowercaseString)" 457 | } else { 458 | return ingredientSetting.0.lowercaseString 459 | } 460 | } 461 | return list 462 | } 463 | 464 | let ingredientsPrefix = NSLocalizedString("order_ingredients_prefix", comment: "") 465 | let ingredients = listOfIngredientsSettings != "" ? "\(ingredientsPrefix)\(listOfIngredientsSettings)" : NSLocalizedString("order_no_ingredients", comment: "") 466 | return "Are you sure you want a \(doughThickness.title().lowercaseString) \(borderCheese) pizza with \(sauceType.title()) sauce and \(ingredients)?" 467 | } 468 | } 469 | -------------------------------------------------------------------------------- /EnumTableViewTestTests/EnumTableViewTestTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EnumTableViewTestTests.swift 3 | // EnumTableViewTestTests 4 | // 5 | // Created by Javier de Silóniz Sandino on 5/8/15. 6 | // Copyright (c) 2015 47 Degrees. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class EnumTableViewTestTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /EnumTableViewTestTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.47deg.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ##A different approach to UITableView delegate methods: a cool use of Swift's enums 2 | 3 | ###Description 4 | 5 | This is a sample code showing how Swift's enums can be used to better organize code for UITableView delegate and data source protocol methods. An explanation of this approach is described in [this post](http://www.47deg.com) from the 47 Degrees blog. 6 | --------------------------------------------------------------------------------