├── .gitignore ├── LGSettingViewDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── ligo.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── ligo.xcuserdatad │ └── xcschemes │ ├── LGSettingViewDemo.xcscheme │ └── xcschememanagement.plist ├── LGSettingViewDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── me.imageset │ │ ├── Contents.json │ │ └── download.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── LGSettingView │ ├── Controller │ │ ├── LGSettingViewController.h │ │ └── LGSettingViewController.m │ └── Modal │ │ ├── LGSettingItem.h │ │ ├── LGSettingItem.m │ │ ├── LGSettingSection.h │ │ └── LGSettingSection.m └── main.m ├── LGSettingViewDemoTests ├── Info.plist └── LGSettingViewDemoTests.m ├── LGSettingViewDemoUITests ├── Info.plist └── LGSettingViewDemoUITests.m ├── LICENSE ├── README.md └── screenshots └── screenshots.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /LGSettingViewDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 15536ED21C4D1D3300047B43 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 15536ED11C4D1D3300047B43 /* main.m */; }; 11 | 15536ED51C4D1D3300047B43 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 15536ED41C4D1D3300047B43 /* AppDelegate.m */; }; 12 | 15536EDB1C4D1D3300047B43 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 15536ED91C4D1D3300047B43 /* Main.storyboard */; }; 13 | 15536EDD1C4D1D3300047B43 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 15536EDC1C4D1D3300047B43 /* Assets.xcassets */; }; 14 | 15536EE01C4D1D3300047B43 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 15536EDE1C4D1D3300047B43 /* LaunchScreen.storyboard */; }; 15 | 15536EEB1C4D1D3300047B43 /* LGSettingViewDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 15536EEA1C4D1D3300047B43 /* LGSettingViewDemoTests.m */; }; 16 | 15536EF61C4D1D3300047B43 /* LGSettingViewDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 15536EF51C4D1D3300047B43 /* LGSettingViewDemoUITests.m */; }; 17 | 15536F0C1C4D1D5600047B43 /* LGSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 15536F061C4D1D5600047B43 /* LGSettingViewController.m */; }; 18 | 15536F0D1C4D1D5600047B43 /* LGSettingItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 15536F091C4D1D5600047B43 /* LGSettingItem.m */; }; 19 | 15536F0E1C4D1D5600047B43 /* LGSettingSection.m in Sources */ = {isa = PBXBuildFile; fileRef = 15536F0B1C4D1D5600047B43 /* LGSettingSection.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | 15536EE71C4D1D3300047B43 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = 15536EC51C4D1D3300047B43 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = 15536ECC1C4D1D3300047B43; 28 | remoteInfo = LGSettingViewDemo; 29 | }; 30 | 15536EF21C4D1D3300047B43 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 15536EC51C4D1D3300047B43 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 15536ECC1C4D1D3300047B43; 35 | remoteInfo = LGSettingViewDemo; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 15536ECD1C4D1D3300047B43 /* LGSettingViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LGSettingViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 15536ED11C4D1D3300047B43 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 42 | 15536ED31C4D1D3300047B43 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 43 | 15536ED41C4D1D3300047B43 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 44 | 15536EDA1C4D1D3300047B43 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 15536EDC1C4D1D3300047B43 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | 15536EDF1C4D1D3300047B43 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | 15536EE11C4D1D3300047B43 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | 15536EE61C4D1D3300047B43 /* LGSettingViewDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LGSettingViewDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 15536EEA1C4D1D3300047B43 /* LGSettingViewDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LGSettingViewDemoTests.m; sourceTree = ""; }; 50 | 15536EEC1C4D1D3300047B43 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | 15536EF11C4D1D3300047B43 /* LGSettingViewDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LGSettingViewDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 15536EF51C4D1D3300047B43 /* LGSettingViewDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LGSettingViewDemoUITests.m; sourceTree = ""; }; 53 | 15536EF71C4D1D3300047B43 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | 15536F051C4D1D5600047B43 /* LGSettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LGSettingViewController.h; sourceTree = ""; }; 55 | 15536F061C4D1D5600047B43 /* LGSettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LGSettingViewController.m; sourceTree = ""; }; 56 | 15536F081C4D1D5600047B43 /* LGSettingItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LGSettingItem.h; sourceTree = ""; }; 57 | 15536F091C4D1D5600047B43 /* LGSettingItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LGSettingItem.m; sourceTree = ""; }; 58 | 15536F0A1C4D1D5600047B43 /* LGSettingSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LGSettingSection.h; sourceTree = ""; }; 59 | 15536F0B1C4D1D5600047B43 /* LGSettingSection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LGSettingSection.m; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | 15536ECA1C4D1D3300047B43 /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | 15536EE31C4D1D3300047B43 /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | 15536EEE1C4D1D3300047B43 /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | /* End PBXFrameworksBuildPhase section */ 85 | 86 | /* Begin PBXGroup section */ 87 | 15536EC41C4D1D3300047B43 = { 88 | isa = PBXGroup; 89 | children = ( 90 | 15536ECF1C4D1D3300047B43 /* LGSettingViewDemo */, 91 | 15536EE91C4D1D3300047B43 /* LGSettingViewDemoTests */, 92 | 15536EF41C4D1D3300047B43 /* LGSettingViewDemoUITests */, 93 | 15536ECE1C4D1D3300047B43 /* Products */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | 15536ECE1C4D1D3300047B43 /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 15536ECD1C4D1D3300047B43 /* LGSettingViewDemo.app */, 101 | 15536EE61C4D1D3300047B43 /* LGSettingViewDemoTests.xctest */, 102 | 15536EF11C4D1D3300047B43 /* LGSettingViewDemoUITests.xctest */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | 15536ECF1C4D1D3300047B43 /* LGSettingViewDemo */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 15536F031C4D1D5600047B43 /* LGSettingView */, 111 | 15536ED31C4D1D3300047B43 /* AppDelegate.h */, 112 | 15536ED41C4D1D3300047B43 /* AppDelegate.m */, 113 | 15536ED91C4D1D3300047B43 /* Main.storyboard */, 114 | 15536EDC1C4D1D3300047B43 /* Assets.xcassets */, 115 | 15536EDE1C4D1D3300047B43 /* LaunchScreen.storyboard */, 116 | 15536EE11C4D1D3300047B43 /* Info.plist */, 117 | 15536ED01C4D1D3300047B43 /* Supporting Files */, 118 | ); 119 | path = LGSettingViewDemo; 120 | sourceTree = ""; 121 | }; 122 | 15536ED01C4D1D3300047B43 /* Supporting Files */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 15536ED11C4D1D3300047B43 /* main.m */, 126 | ); 127 | name = "Supporting Files"; 128 | sourceTree = ""; 129 | }; 130 | 15536EE91C4D1D3300047B43 /* LGSettingViewDemoTests */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 15536EEA1C4D1D3300047B43 /* LGSettingViewDemoTests.m */, 134 | 15536EEC1C4D1D3300047B43 /* Info.plist */, 135 | ); 136 | path = LGSettingViewDemoTests; 137 | sourceTree = ""; 138 | }; 139 | 15536EF41C4D1D3300047B43 /* LGSettingViewDemoUITests */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | 15536EF51C4D1D3300047B43 /* LGSettingViewDemoUITests.m */, 143 | 15536EF71C4D1D3300047B43 /* Info.plist */, 144 | ); 145 | path = LGSettingViewDemoUITests; 146 | sourceTree = ""; 147 | }; 148 | 15536F031C4D1D5600047B43 /* LGSettingView */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 15536F041C4D1D5600047B43 /* Controller */, 152 | 15536F071C4D1D5600047B43 /* Modal */, 153 | ); 154 | path = LGSettingView; 155 | sourceTree = ""; 156 | }; 157 | 15536F041C4D1D5600047B43 /* Controller */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | 15536F051C4D1D5600047B43 /* LGSettingViewController.h */, 161 | 15536F061C4D1D5600047B43 /* LGSettingViewController.m */, 162 | ); 163 | path = Controller; 164 | sourceTree = ""; 165 | }; 166 | 15536F071C4D1D5600047B43 /* Modal */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | 15536F081C4D1D5600047B43 /* LGSettingItem.h */, 170 | 15536F091C4D1D5600047B43 /* LGSettingItem.m */, 171 | 15536F0A1C4D1D5600047B43 /* LGSettingSection.h */, 172 | 15536F0B1C4D1D5600047B43 /* LGSettingSection.m */, 173 | ); 174 | path = Modal; 175 | sourceTree = ""; 176 | }; 177 | /* End PBXGroup section */ 178 | 179 | /* Begin PBXNativeTarget section */ 180 | 15536ECC1C4D1D3300047B43 /* LGSettingViewDemo */ = { 181 | isa = PBXNativeTarget; 182 | buildConfigurationList = 15536EFA1C4D1D3300047B43 /* Build configuration list for PBXNativeTarget "LGSettingViewDemo" */; 183 | buildPhases = ( 184 | 15536EC91C4D1D3300047B43 /* Sources */, 185 | 15536ECA1C4D1D3300047B43 /* Frameworks */, 186 | 15536ECB1C4D1D3300047B43 /* Resources */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | ); 192 | name = LGSettingViewDemo; 193 | productName = LGSettingViewDemo; 194 | productReference = 15536ECD1C4D1D3300047B43 /* LGSettingViewDemo.app */; 195 | productType = "com.apple.product-type.application"; 196 | }; 197 | 15536EE51C4D1D3300047B43 /* LGSettingViewDemoTests */ = { 198 | isa = PBXNativeTarget; 199 | buildConfigurationList = 15536EFD1C4D1D3300047B43 /* Build configuration list for PBXNativeTarget "LGSettingViewDemoTests" */; 200 | buildPhases = ( 201 | 15536EE21C4D1D3300047B43 /* Sources */, 202 | 15536EE31C4D1D3300047B43 /* Frameworks */, 203 | 15536EE41C4D1D3300047B43 /* Resources */, 204 | ); 205 | buildRules = ( 206 | ); 207 | dependencies = ( 208 | 15536EE81C4D1D3300047B43 /* PBXTargetDependency */, 209 | ); 210 | name = LGSettingViewDemoTests; 211 | productName = LGSettingViewDemoTests; 212 | productReference = 15536EE61C4D1D3300047B43 /* LGSettingViewDemoTests.xctest */; 213 | productType = "com.apple.product-type.bundle.unit-test"; 214 | }; 215 | 15536EF01C4D1D3300047B43 /* LGSettingViewDemoUITests */ = { 216 | isa = PBXNativeTarget; 217 | buildConfigurationList = 15536F001C4D1D3300047B43 /* Build configuration list for PBXNativeTarget "LGSettingViewDemoUITests" */; 218 | buildPhases = ( 219 | 15536EED1C4D1D3300047B43 /* Sources */, 220 | 15536EEE1C4D1D3300047B43 /* Frameworks */, 221 | 15536EEF1C4D1D3300047B43 /* Resources */, 222 | ); 223 | buildRules = ( 224 | ); 225 | dependencies = ( 226 | 15536EF31C4D1D3300047B43 /* PBXTargetDependency */, 227 | ); 228 | name = LGSettingViewDemoUITests; 229 | productName = LGSettingViewDemoUITests; 230 | productReference = 15536EF11C4D1D3300047B43 /* LGSettingViewDemoUITests.xctest */; 231 | productType = "com.apple.product-type.bundle.ui-testing"; 232 | }; 233 | /* End PBXNativeTarget section */ 234 | 235 | /* Begin PBXProject section */ 236 | 15536EC51C4D1D3300047B43 /* Project object */ = { 237 | isa = PBXProject; 238 | attributes = { 239 | LastUpgradeCheck = 0720; 240 | ORGANIZATIONNAME = LiGo; 241 | TargetAttributes = { 242 | 15536ECC1C4D1D3300047B43 = { 243 | CreatedOnToolsVersion = 7.2; 244 | DevelopmentTeam = 85P5N4JNEC; 245 | }; 246 | 15536EE51C4D1D3300047B43 = { 247 | CreatedOnToolsVersion = 7.2; 248 | DevelopmentTeam = 85P5N4JNEC; 249 | TestTargetID = 15536ECC1C4D1D3300047B43; 250 | }; 251 | 15536EF01C4D1D3300047B43 = { 252 | CreatedOnToolsVersion = 7.2; 253 | DevelopmentTeam = 85P5N4JNEC; 254 | TestTargetID = 15536ECC1C4D1D3300047B43; 255 | }; 256 | }; 257 | }; 258 | buildConfigurationList = 15536EC81C4D1D3300047B43 /* Build configuration list for PBXProject "LGSettingViewDemo" */; 259 | compatibilityVersion = "Xcode 3.2"; 260 | developmentRegion = English; 261 | hasScannedForEncodings = 0; 262 | knownRegions = ( 263 | en, 264 | Base, 265 | ); 266 | mainGroup = 15536EC41C4D1D3300047B43; 267 | productRefGroup = 15536ECE1C4D1D3300047B43 /* Products */; 268 | projectDirPath = ""; 269 | projectRoot = ""; 270 | targets = ( 271 | 15536ECC1C4D1D3300047B43 /* LGSettingViewDemo */, 272 | 15536EE51C4D1D3300047B43 /* LGSettingViewDemoTests */, 273 | 15536EF01C4D1D3300047B43 /* LGSettingViewDemoUITests */, 274 | ); 275 | }; 276 | /* End PBXProject section */ 277 | 278 | /* Begin PBXResourcesBuildPhase section */ 279 | 15536ECB1C4D1D3300047B43 /* Resources */ = { 280 | isa = PBXResourcesBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | 15536EE01C4D1D3300047B43 /* LaunchScreen.storyboard in Resources */, 284 | 15536EDD1C4D1D3300047B43 /* Assets.xcassets in Resources */, 285 | 15536EDB1C4D1D3300047B43 /* Main.storyboard in Resources */, 286 | ); 287 | runOnlyForDeploymentPostprocessing = 0; 288 | }; 289 | 15536EE41C4D1D3300047B43 /* Resources */ = { 290 | isa = PBXResourcesBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | ); 294 | runOnlyForDeploymentPostprocessing = 0; 295 | }; 296 | 15536EEF1C4D1D3300047B43 /* Resources */ = { 297 | isa = PBXResourcesBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | ); 301 | runOnlyForDeploymentPostprocessing = 0; 302 | }; 303 | /* End PBXResourcesBuildPhase section */ 304 | 305 | /* Begin PBXSourcesBuildPhase section */ 306 | 15536EC91C4D1D3300047B43 /* Sources */ = { 307 | isa = PBXSourcesBuildPhase; 308 | buildActionMask = 2147483647; 309 | files = ( 310 | 15536F0C1C4D1D5600047B43 /* LGSettingViewController.m in Sources */, 311 | 15536ED51C4D1D3300047B43 /* AppDelegate.m in Sources */, 312 | 15536F0D1C4D1D5600047B43 /* LGSettingItem.m in Sources */, 313 | 15536ED21C4D1D3300047B43 /* main.m in Sources */, 314 | 15536F0E1C4D1D5600047B43 /* LGSettingSection.m in Sources */, 315 | ); 316 | runOnlyForDeploymentPostprocessing = 0; 317 | }; 318 | 15536EE21C4D1D3300047B43 /* Sources */ = { 319 | isa = PBXSourcesBuildPhase; 320 | buildActionMask = 2147483647; 321 | files = ( 322 | 15536EEB1C4D1D3300047B43 /* LGSettingViewDemoTests.m in Sources */, 323 | ); 324 | runOnlyForDeploymentPostprocessing = 0; 325 | }; 326 | 15536EED1C4D1D3300047B43 /* Sources */ = { 327 | isa = PBXSourcesBuildPhase; 328 | buildActionMask = 2147483647; 329 | files = ( 330 | 15536EF61C4D1D3300047B43 /* LGSettingViewDemoUITests.m in Sources */, 331 | ); 332 | runOnlyForDeploymentPostprocessing = 0; 333 | }; 334 | /* End PBXSourcesBuildPhase section */ 335 | 336 | /* Begin PBXTargetDependency section */ 337 | 15536EE81C4D1D3300047B43 /* PBXTargetDependency */ = { 338 | isa = PBXTargetDependency; 339 | target = 15536ECC1C4D1D3300047B43 /* LGSettingViewDemo */; 340 | targetProxy = 15536EE71C4D1D3300047B43 /* PBXContainerItemProxy */; 341 | }; 342 | 15536EF31C4D1D3300047B43 /* PBXTargetDependency */ = { 343 | isa = PBXTargetDependency; 344 | target = 15536ECC1C4D1D3300047B43 /* LGSettingViewDemo */; 345 | targetProxy = 15536EF21C4D1D3300047B43 /* PBXContainerItemProxy */; 346 | }; 347 | /* End PBXTargetDependency section */ 348 | 349 | /* Begin PBXVariantGroup section */ 350 | 15536ED91C4D1D3300047B43 /* Main.storyboard */ = { 351 | isa = PBXVariantGroup; 352 | children = ( 353 | 15536EDA1C4D1D3300047B43 /* Base */, 354 | ); 355 | name = Main.storyboard; 356 | sourceTree = ""; 357 | }; 358 | 15536EDE1C4D1D3300047B43 /* LaunchScreen.storyboard */ = { 359 | isa = PBXVariantGroup; 360 | children = ( 361 | 15536EDF1C4D1D3300047B43 /* Base */, 362 | ); 363 | name = LaunchScreen.storyboard; 364 | sourceTree = ""; 365 | }; 366 | /* End PBXVariantGroup section */ 367 | 368 | /* Begin XCBuildConfiguration section */ 369 | 15536EF81C4D1D3300047B43 /* Debug */ = { 370 | isa = XCBuildConfiguration; 371 | buildSettings = { 372 | ALWAYS_SEARCH_USER_PATHS = NO; 373 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 374 | CLANG_CXX_LIBRARY = "libc++"; 375 | CLANG_ENABLE_MODULES = YES; 376 | CLANG_ENABLE_OBJC_ARC = YES; 377 | CLANG_WARN_BOOL_CONVERSION = YES; 378 | CLANG_WARN_CONSTANT_CONVERSION = YES; 379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 380 | CLANG_WARN_EMPTY_BODY = YES; 381 | CLANG_WARN_ENUM_CONVERSION = YES; 382 | CLANG_WARN_INT_CONVERSION = YES; 383 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 384 | CLANG_WARN_UNREACHABLE_CODE = YES; 385 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 386 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 387 | COPY_PHASE_STRIP = NO; 388 | DEBUG_INFORMATION_FORMAT = dwarf; 389 | ENABLE_STRICT_OBJC_MSGSEND = YES; 390 | ENABLE_TESTABILITY = YES; 391 | GCC_C_LANGUAGE_STANDARD = gnu99; 392 | GCC_DYNAMIC_NO_PIC = NO; 393 | GCC_NO_COMMON_BLOCKS = YES; 394 | GCC_OPTIMIZATION_LEVEL = 0; 395 | GCC_PREPROCESSOR_DEFINITIONS = ( 396 | "DEBUG=1", 397 | "$(inherited)", 398 | ); 399 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 400 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 401 | GCC_WARN_UNDECLARED_SELECTOR = YES; 402 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 403 | GCC_WARN_UNUSED_FUNCTION = YES; 404 | GCC_WARN_UNUSED_VARIABLE = YES; 405 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 406 | MTL_ENABLE_DEBUG_INFO = YES; 407 | ONLY_ACTIVE_ARCH = YES; 408 | SDKROOT = iphoneos; 409 | }; 410 | name = Debug; 411 | }; 412 | 15536EF91C4D1D3300047B43 /* Release */ = { 413 | isa = XCBuildConfiguration; 414 | buildSettings = { 415 | ALWAYS_SEARCH_USER_PATHS = NO; 416 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 417 | CLANG_CXX_LIBRARY = "libc++"; 418 | CLANG_ENABLE_MODULES = YES; 419 | CLANG_ENABLE_OBJC_ARC = YES; 420 | CLANG_WARN_BOOL_CONVERSION = YES; 421 | CLANG_WARN_CONSTANT_CONVERSION = YES; 422 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 423 | CLANG_WARN_EMPTY_BODY = YES; 424 | CLANG_WARN_ENUM_CONVERSION = YES; 425 | CLANG_WARN_INT_CONVERSION = YES; 426 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 427 | CLANG_WARN_UNREACHABLE_CODE = YES; 428 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 429 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 430 | COPY_PHASE_STRIP = NO; 431 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 432 | ENABLE_NS_ASSERTIONS = NO; 433 | ENABLE_STRICT_OBJC_MSGSEND = YES; 434 | GCC_C_LANGUAGE_STANDARD = gnu99; 435 | GCC_NO_COMMON_BLOCKS = YES; 436 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 437 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 438 | GCC_WARN_UNDECLARED_SELECTOR = YES; 439 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 440 | GCC_WARN_UNUSED_FUNCTION = YES; 441 | GCC_WARN_UNUSED_VARIABLE = YES; 442 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 443 | MTL_ENABLE_DEBUG_INFO = NO; 444 | SDKROOT = iphoneos; 445 | VALIDATE_PRODUCT = YES; 446 | }; 447 | name = Release; 448 | }; 449 | 15536EFB1C4D1D3300047B43 /* Debug */ = { 450 | isa = XCBuildConfiguration; 451 | buildSettings = { 452 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 453 | INFOPLIST_FILE = LGSettingViewDemo/Info.plist; 454 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 455 | PRODUCT_BUNDLE_IDENTIFIER = ligo.LGSettingViewDemo; 456 | PRODUCT_NAME = "$(TARGET_NAME)"; 457 | }; 458 | name = Debug; 459 | }; 460 | 15536EFC1C4D1D3300047B43 /* Release */ = { 461 | isa = XCBuildConfiguration; 462 | buildSettings = { 463 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 464 | INFOPLIST_FILE = LGSettingViewDemo/Info.plist; 465 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 466 | PRODUCT_BUNDLE_IDENTIFIER = ligo.LGSettingViewDemo; 467 | PRODUCT_NAME = "$(TARGET_NAME)"; 468 | }; 469 | name = Release; 470 | }; 471 | 15536EFE1C4D1D3300047B43 /* Debug */ = { 472 | isa = XCBuildConfiguration; 473 | buildSettings = { 474 | BUNDLE_LOADER = "$(TEST_HOST)"; 475 | INFOPLIST_FILE = LGSettingViewDemoTests/Info.plist; 476 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 477 | PRODUCT_BUNDLE_IDENTIFIER = ligo.LGSettingViewDemoTests; 478 | PRODUCT_NAME = "$(TARGET_NAME)"; 479 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LGSettingViewDemo.app/LGSettingViewDemo"; 480 | }; 481 | name = Debug; 482 | }; 483 | 15536EFF1C4D1D3300047B43 /* Release */ = { 484 | isa = XCBuildConfiguration; 485 | buildSettings = { 486 | BUNDLE_LOADER = "$(TEST_HOST)"; 487 | INFOPLIST_FILE = LGSettingViewDemoTests/Info.plist; 488 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 489 | PRODUCT_BUNDLE_IDENTIFIER = ligo.LGSettingViewDemoTests; 490 | PRODUCT_NAME = "$(TARGET_NAME)"; 491 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LGSettingViewDemo.app/LGSettingViewDemo"; 492 | }; 493 | name = Release; 494 | }; 495 | 15536F011C4D1D3300047B43 /* Debug */ = { 496 | isa = XCBuildConfiguration; 497 | buildSettings = { 498 | INFOPLIST_FILE = LGSettingViewDemoUITests/Info.plist; 499 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 500 | PRODUCT_BUNDLE_IDENTIFIER = ligo.LGSettingViewDemoUITests; 501 | PRODUCT_NAME = "$(TARGET_NAME)"; 502 | TEST_TARGET_NAME = LGSettingViewDemo; 503 | USES_XCTRUNNER = YES; 504 | }; 505 | name = Debug; 506 | }; 507 | 15536F021C4D1D3300047B43 /* Release */ = { 508 | isa = XCBuildConfiguration; 509 | buildSettings = { 510 | INFOPLIST_FILE = LGSettingViewDemoUITests/Info.plist; 511 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 512 | PRODUCT_BUNDLE_IDENTIFIER = ligo.LGSettingViewDemoUITests; 513 | PRODUCT_NAME = "$(TARGET_NAME)"; 514 | TEST_TARGET_NAME = LGSettingViewDemo; 515 | USES_XCTRUNNER = YES; 516 | }; 517 | name = Release; 518 | }; 519 | /* End XCBuildConfiguration section */ 520 | 521 | /* Begin XCConfigurationList section */ 522 | 15536EC81C4D1D3300047B43 /* Build configuration list for PBXProject "LGSettingViewDemo" */ = { 523 | isa = XCConfigurationList; 524 | buildConfigurations = ( 525 | 15536EF81C4D1D3300047B43 /* Debug */, 526 | 15536EF91C4D1D3300047B43 /* Release */, 527 | ); 528 | defaultConfigurationIsVisible = 0; 529 | defaultConfigurationName = Release; 530 | }; 531 | 15536EFA1C4D1D3300047B43 /* Build configuration list for PBXNativeTarget "LGSettingViewDemo" */ = { 532 | isa = XCConfigurationList; 533 | buildConfigurations = ( 534 | 15536EFB1C4D1D3300047B43 /* Debug */, 535 | 15536EFC1C4D1D3300047B43 /* Release */, 536 | ); 537 | defaultConfigurationIsVisible = 0; 538 | }; 539 | 15536EFD1C4D1D3300047B43 /* Build configuration list for PBXNativeTarget "LGSettingViewDemoTests" */ = { 540 | isa = XCConfigurationList; 541 | buildConfigurations = ( 542 | 15536EFE1C4D1D3300047B43 /* Debug */, 543 | 15536EFF1C4D1D3300047B43 /* Release */, 544 | ); 545 | defaultConfigurationIsVisible = 0; 546 | }; 547 | 15536F001C4D1D3300047B43 /* Build configuration list for PBXNativeTarget "LGSettingViewDemoUITests" */ = { 548 | isa = XCConfigurationList; 549 | buildConfigurations = ( 550 | 15536F011C4D1D3300047B43 /* Debug */, 551 | 15536F021C4D1D3300047B43 /* Release */, 552 | ); 553 | defaultConfigurationIsVisible = 0; 554 | }; 555 | /* End XCConfigurationList section */ 556 | }; 557 | rootObject = 15536EC51C4D1D3300047B43 /* Project object */; 558 | } 559 | -------------------------------------------------------------------------------- /LGSettingViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LGSettingViewDemo.xcodeproj/project.xcworkspace/xcuserdata/ligo.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiGoEX/LGSettingView/7c4ca6a6a00f560b180b9523602bc669c33e1998/LGSettingViewDemo.xcodeproj/project.xcworkspace/xcuserdata/ligo.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /LGSettingViewDemo.xcodeproj/xcuserdata/ligo.xcuserdatad/xcschemes/LGSettingViewDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /LGSettingViewDemo.xcodeproj/xcuserdata/ligo.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LGSettingViewDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 15536ECC1C4D1D3300047B43 16 | 17 | primary 18 | 19 | 20 | 15536EE51C4D1D3300047B43 21 | 22 | primary 23 | 24 | 25 | 15536EF01C4D1D3300047B43 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /LGSettingViewDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LGSettingViewDemo 4 | // 5 | // Created by LiGo on 1/18/16. 6 | // Copyright © 2016 LiGo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /LGSettingViewDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // LGSettingViewDemo 4 | // 5 | // Created by LiGo on 1/18/16. 6 | // Copyright © 2016 LiGo. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "LGSettingViewController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | 22 | // 创建UIWindow 23 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 24 | self.window.backgroundColor = [UIColor whiteColor]; 25 | LGSettingViewController *new = [[LGSettingViewController alloc]init]; 26 | // 设置控制器为window的根控制器 27 | self.window.rootViewController = new; 28 | // 显示window 29 | [self.window makeKeyAndVisible]; 30 | return YES; 31 | } 32 | 33 | - (void)applicationWillResignActive:(UIApplication *)application { 34 | // 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. 35 | // 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. 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application { 39 | // 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. 40 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 41 | } 42 | 43 | - (void)applicationWillEnterForeground:(UIApplication *)application { 44 | // 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. 45 | } 46 | 47 | - (void)applicationDidBecomeActive:(UIApplication *)application { 48 | // 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. 49 | } 50 | 51 | - (void)applicationWillTerminate:(UIApplication *)application { 52 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /LGSettingViewDemo/Assets.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 | } -------------------------------------------------------------------------------- /LGSettingViewDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /LGSettingViewDemo/Assets.xcassets/me.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "download.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /LGSettingViewDemo/Assets.xcassets/me.imageset/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiGoEX/LGSettingView/7c4ca6a6a00f560b180b9523602bc669c33e1998/LGSettingViewDemo/Assets.xcassets/me.imageset/download.png -------------------------------------------------------------------------------- /LGSettingViewDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LGSettingViewDemo/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 | -------------------------------------------------------------------------------- /LGSettingViewDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /LGSettingViewDemo/LGSettingView/Controller/LGSettingViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LGSettingViewController.h 3 | // LGSettingViewDemo 4 | // 5 | // Created by LiGo on 11/16/15. 6 | // Copyright © 2015 LiGo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LGSettingViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LGSettingViewDemo/LGSettingView/Controller/LGSettingViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LGSettingViewController.m 3 | // LGSettingViewDemo 4 | // 5 | // Created by LiGo on 11/16/15. 6 | // Copyright © 2015 LiGo. All rights reserved. 7 | // 8 | // 9 | #import "LGSettingViewController.h" 10 | #import "LGSettingItem.h" 11 | #import "LGSettingSection.h" 12 | 13 | @interface LGSettingViewController () 14 | @property (strong, nonatomic) NSMutableArray * groups; 15 | @end 16 | 17 | @implementation LGSettingViewController 18 | 19 | /** 20 | 数组懒加载 21 | */ 22 | - (NSMutableArray *)groups 23 | { 24 | if (!_groups) { 25 | _groups = [NSMutableArray array]; 26 | } 27 | return _groups; 28 | } 29 | 30 | - (instancetype)init{ 31 | // 设置样式 32 | return [self initWithStyle:UITableViewStyleGrouped]; 33 | } 34 | 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | 38 | //添加第一组 39 | LGSettingSection *section1 = [LGSettingSection initWithHeaderTitle:@"LGSettingView Demo" footerTitle:nil]; 40 | //添加行 41 | LGSettingItem *item1 = [LGSettingItem initWithtitle:@"Sina:@LiGoEX"]; 42 | item1.image = [UIImage imageNamed:@"me"]; 43 | item1.height = 64; 44 | [section1 addItem:item1]; 45 | LGSettingItem *item2 = [LGSettingItem initWithtitle:@"Live with passion."]; 46 | item2.type = UITableViewCellAccessoryNone; 47 | [section1 addItem:item2]; 48 | //保存到groups数组 49 | [self.groups addObject:section1]; 50 | 51 | //添加第二组 52 | LGSettingSection *section2 = [LGSettingSection initWithHeaderTitle:@"" footerTitle:nil]; 53 | //添加行 54 | [section2 addItemWithTitle:@"相册"]; 55 | [section2 addItemWithTitle:@"相收藏"]; 56 | [section2 addItemWithTitle:@"赞过的"]; 57 | [section2 addItemWithTitle:@"回收站"]; 58 | //保存到groups数组 59 | [self.groups addObject:section2]; 60 | 61 | //添加第三组 62 | LGSettingSection *section3 = [LGSettingSection initWithHeaderTitle:@"" footerTitle:@"© 2016 LiGo"]; 63 | //添加行 64 | [section3 addItemWithTitle:@"关于我们"]; 65 | //保存到groups数组 66 | [self.groups addObject:section3]; 67 | 68 | } 69 | 70 | - (void)didReceiveMemoryWarning { 71 | [super didReceiveMemoryWarning]; 72 | // Dispose of any resources that can be recreated. 73 | } 74 | 75 | 76 | #pragma mark - Table view data source 77 | /** 78 | 设置组数 79 | */ 80 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 81 | return self.groups.count; 82 | } 83 | /** 84 | 设置行数 85 | */ 86 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 87 | LGSettingSection *group = self.groups[section]; 88 | return group.items.count; 89 | } 90 | 91 | /** 92 | 设置每行内容 93 | */ 94 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 95 | 96 | static NSString *ID = @"cell"; 97 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; 98 | if (cell == nil) { 99 | cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID]; 100 | } 101 | 102 | LGSettingSection *section = self.groups[indexPath.section]; 103 | LGSettingItem *item = section.items[indexPath.row]; 104 | // 设置Cell的标题 105 | cell.textLabel.text = item.title; 106 | // 设置Cell左边的图标 107 | cell.imageView.image = item.image; 108 | // 设置Cell右边的图标 109 | cell.accessoryType = item.type; 110 | 111 | 112 | return cell; 113 | } 114 | 115 | -(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 116 | LGSettingSection *group = self.groups[section]; 117 | return group.headerTitle; 118 | } 119 | 120 | -(NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section { 121 | LGSettingSection *group = self.groups[section]; 122 | return group.footerTitle; 123 | } 124 | 125 | -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ 126 | LGSettingSection *section = self.groups[indexPath.section]; 127 | LGSettingItem *item = section.items[indexPath.row]; 128 | return item.height; 129 | } 130 | 131 | #pragma mark 点击事件 132 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 133 | if (indexPath.section == 0 && indexPath.row == 1) { 134 | //添加点击事件 135 | } 136 | NSLog(@"点击了第%ld组,第%ld行",indexPath.section,indexPath.row); 137 | } 138 | 139 | /** 140 | 141 | */ 142 | 143 | @end 144 | -------------------------------------------------------------------------------- /LGSettingViewDemo/LGSettingView/Modal/LGSettingItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // LGSettingItem.h 3 | // LGSettingViewDemo 4 | // 5 | // Created by LiGo on 11/16/15. 6 | // Copyright © 2015 LiGo. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface LGSettingItem : NSObject 13 | 14 | 15 | /** 标题 */ 16 | @property (strong, nonatomic) NSString * title; 17 | /** 左图标 */ 18 | @property (strong, nonatomic) UIImage* image; 19 | /** 行高度 */ 20 | @property (nonatomic) CGFloat height; 21 | /** 右图标样式 */ 22 | @property (nonatomic) UITableViewCellAccessoryType type; 23 | 24 | /** 设置标题值 类方法 */ 25 | + (instancetype)initWithtitle:(NSString *)title; 26 | @end 27 | 28 | -------------------------------------------------------------------------------- /LGSettingViewDemo/LGSettingView/Modal/LGSettingItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // LGSettingItem.m 3 | // LGSettingViewDemo 4 | // 5 | // Created by LiGo on 11/16/15. 6 | // Copyright © 2015 LiGo. All rights reserved. 7 | // 8 | 9 | #import "LGSettingItem.h" 10 | #import "LGSettingSection.h" 11 | 12 | @implementation LGSettingItem 13 | 14 | + (instancetype)initWithtitle:(NSString *)title { 15 | 16 | LGSettingItem *item = [[LGSettingItem alloc]init]; 17 | item.title = title; 18 | item.height = 44; 19 | item.type = UITableViewCellAccessoryDisclosureIndicator; 20 | return item; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /LGSettingViewDemo/LGSettingView/Modal/LGSettingSection.h: -------------------------------------------------------------------------------- 1 | // 2 | // LGSettingSection.h 3 | // LGSettingViewDemo 4 | // 5 | // Created by LiGo on 11/16/15. 6 | // Copyright © 2015 LiGo. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LGSettingItem.h" 11 | 12 | @interface LGSettingSection : NSObject 13 | 14 | /** 头部标题 */ 15 | @property (strong, nonatomic) NSString * headerTitle; 16 | /** 尾部标题 */ 17 | @property (strong, nonatomic) NSString * footerTitle; 18 | /** 行数 */ 19 | @property (strong, nonatomic) NSMutableArray * items; 20 | /** 标题 */ 21 | @property (strong, nonatomic) NSString * title; 22 | 23 | + (instancetype)initWithHeaderTitle:(NSString *)headerTitle footerTitle:(NSString *)footerTitle; 24 | //添加Item 25 | -(void)addItem:(LGSettingItem*)item; 26 | //添加自定义标题的行 27 | -(void)addItemWithTitle:(NSString*)title; 28 | //添加带有左图标的行 29 | -(void)addItemWithTitle:(NSString*)title Image:(UIImage*)image; 30 | @end 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /LGSettingViewDemo/LGSettingView/Modal/LGSettingSection.m: -------------------------------------------------------------------------------- 1 | // 2 | // LGSettingSection.m 3 | // LGSettingViewDemo 4 | // 5 | // Created by LiGo on 11/16/15. 6 | // Copyright © 2015 LiGo. All rights reserved. 7 | // 8 | 9 | #import "LGSettingSection.h" 10 | 11 | 12 | @implementation LGSettingSection 13 | 14 | + (instancetype)initWithHeaderTitle:(NSString *)headerTitle footerTitle:(NSString *)footerTitle { 15 | 16 | LGSettingSection *section = [[LGSettingSection alloc]init]; 17 | section.headerTitle = headerTitle; 18 | section.footerTitle = footerTitle; 19 | return section; 20 | } 21 | -(void)addItem:(LGSettingItem*)item{ 22 | if (!_items) { 23 | _items = [NSMutableArray array]; 24 | } 25 | [_items addObject:item]; 26 | 27 | } 28 | 29 | -(void)addItemWithTitle:(NSString*)title { 30 | 31 | if (!_items) { 32 | _items = [NSMutableArray array]; 33 | 34 | } 35 | LGSettingItem *item = [LGSettingItem initWithtitle:title]; 36 | [_items addObject:item]; 37 | } 38 | 39 | -(void)addItemWithTitle:(NSString*)title Image:(UIImage*)image { 40 | if (!_items) { 41 | _items = [NSMutableArray array]; 42 | 43 | } 44 | LGSettingItem *item = [LGSettingItem initWithtitle:title]; 45 | item.image = image; 46 | [_items addObject:item]; 47 | } 48 | @end 49 | -------------------------------------------------------------------------------- /LGSettingViewDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LGSettingViewDemo 4 | // 5 | // Created by LiGo on 1/18/16. 6 | // Copyright © 2016 LiGo. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /LGSettingViewDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LGSettingViewDemoTests/LGSettingViewDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LGSettingViewDemoTests.m 3 | // LGSettingViewDemoTests 4 | // 5 | // Created by LiGo on 1/18/16. 6 | // Copyright © 2016 LiGo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LGSettingViewDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation LGSettingViewDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /LGSettingViewDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LGSettingViewDemoUITests/LGSettingViewDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LGSettingViewDemoUITests.m 3 | // LGSettingViewDemoUITests 4 | // 5 | // Created by LiGo on 1/18/16. 6 | // Copyright © 2016 LiGo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LGSettingViewDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation LGSettingViewDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 LiGo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # LGSettingView 3 | * 仅需三句代码即可快速集成设置界面,免去每次开发新应用都要重新布置设置界面的烦恼。 4 | * Build the Setting View on iOS APP by 3 lines of code. 5 | 6 | ## 测试环境 7 | * Xcode 7.1 8 | * iOS 8.4,9.1(真机测试通过) 9 | 10 | ## 如何使用LGSettingView 11 | * 1.将LGSettingView文件夹中的所有文件拽入项目中 12 | * 2.将导入的LGSettingViewController设为设置界面的VC 13 | * 3.在ViewDidLoad方法中添加组与行 14 | 15 | ``` 16 | - (void)viewDidLoad { 17 | 18 | 19 | //三行代码: 20 | LGSettingSection *section = [LGSettingSection initWithHeaderTitle:[NSString] footerTitle:[NSString]]; 21 | [section addItemWithTitle:[NSString]]; 22 | [self.sections addObject:section]; 23 | 24 | 25 | //或以下代码: 26 | //Set1:添加第一组 27 | LGSettingSection *section = [LGSettingSection initWithHeaderTitle:[NSString] footerTitle:[NSString]]; 28 | //Set2:添加行 29 | LGSettingItem *item = [LGSettingItem initWithtitle:[NSString]]; 30 | item.image = [UIImage]; 31 | item.type = [UITableViewCellAccessoryType]; 32 | [section addItem:item]; 33 | //Set3:保存到sections数组 34 | [self.sections addObject:section]; 35 | 36 | 37 | } 38 | 39 | 40 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 41 | if (indexPath.section == 0 && indexPath.row == 1) { 42 | //添加点击事件 43 | } 44 | 45 | ``` 46 | 47 | 48 | ##LGSettingSection.h 49 | ``` 50 | @interface LGSettingSection : NSObject 51 | 52 | /** 头部标题 */ 53 | @property (strong, nonatomic) NSString * headerTitle; 54 | /** 尾部标题 */ 55 | @property (strong, nonatomic) NSString * footerTitle; 56 | /** 行数 */ 57 | @property (strong, nonatomic) NSMutableArray * items; 58 | /** 标题 */ 59 | @property (strong, nonatomic) NSString * title; 60 | 61 | //类方法 设置headerTitle footerTitle 62 | + (instancetype)initWithHeaderTitle:(NSString *)headerTitle footerTitle:(NSString *)footerTitle; 63 | 64 | -(void)addItem:(LGSettingItem*)item; 65 | 66 | -(void)addItemWithTitle:(NSString*)title; 67 | //添加带有左图标的行 68 | -(void)addItemWithTitle:(NSString*)title Image:(UIImage*)image; 69 | @end 70 | ``` 71 | ##LGSettingItem.h 72 | ``` 73 | @interface LGSettingItem : NSObject 74 | 75 | /** 标题 */ 76 | @property (strong, nonatomic) NSString * title; 77 | /** 左图标 */ 78 | @property (strong, nonatomic) UIImage* image; 79 | /** 行高度 */ 80 | @property (nonatomic) CGFloat height; 81 | /** 右图标样式 */ 82 | @property (nonatomic) UITableViewCellAccessoryType type; 83 | 84 | /** 设置标题值 类方法 */ 85 | + (instancetype)initWithtitle:(NSString *)title; 86 | 87 | @end 88 | 89 | ``` 90 | ##参考 91 | 92 | * 文件夹下的LGSettingViewDemo工程 93 | 94 | ![image](https://github.com/LiGoEX/LGSettingView/blob/master/screenshots/screenshots.png) 95 | 96 | ##鸣谢 97 | * iOS_CYX 98 | * Kenshin Cui's Blog 99 | -------------------------------------------------------------------------------- /screenshots/screenshots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LiGoEX/LGSettingView/7c4ca6a6a00f560b180b9523602bc669c33e1998/screenshots/screenshots.png --------------------------------------------------------------------------------