├── 123.png ├── EllipsePageControl.podspec ├── EllipsePageControl.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ ├── cardlan_yuhuajun.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── j.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── cardlan_yuhuajun.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ ├── EllipsePageControl.xcscheme │ │ └── xcschememanagement.plist │ └── j.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── EllipsePageControl ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── bkimg.imageset │ │ ├── Contents.json │ │ ├── lunbochangtu@2x.png │ │ └── lunbochangtu@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── EllipsePageControl │ ├── EllipsePageControl.h │ └── EllipsePageControl.m ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── EllipsePageControlTests ├── EllipsePageControlTests.m └── Info.plist ├── EllipsePageControlUITests ├── EllipsePageControlUITests.m └── Info.plist ├── LICENSE └── README.md /123.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackxhj/EllipsePageControl/0cd9a84bc885874f8ce6bd2c12bee894157d0f0c/123.png -------------------------------------------------------------------------------- /EllipsePageControl.podspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | Pod::Spec.new do |s| 4 | 5 | 6 | 7 | s.name = "EllipsePageControl" 8 | s.version = "0.0.3" 9 | s.summary = "The elliptical rectangle of PageControl." 10 | 11 | s.homepage = "https://github.com/hackxhj/EllipsePageControl" 12 | 13 | 14 | s.license = "MIT" 15 | 16 | 17 | s.author = { "hackxhj" => "643087041@qq.com" } 18 | 19 | s.platform = :ios, "7.0" 20 | 21 | 22 | s.source = { :git => "https://github.com/hackxhj/EllipsePageControl.git", :tag => "0.0.3" } 23 | 24 | 25 | 26 | s.source_files = "EllipsePageControl/EllipsePageControl/**/*.{h,m}" 27 | 28 | 29 | 30 | s.framework = "UIKit" 31 | 32 | 33 | end 34 | -------------------------------------------------------------------------------- /EllipsePageControl.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3F42C3F91F28381A0096EEB1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F42C3F81F28381A0096EEB1 /* main.m */; }; 11 | 3F42C3FC1F28381B0096EEB1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F42C3FB1F28381B0096EEB1 /* AppDelegate.m */; }; 12 | 3F42C3FF1F28381B0096EEB1 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F42C3FE1F28381B0096EEB1 /* ViewController.m */; }; 13 | 3F42C4021F28381B0096EEB1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3F42C4001F28381B0096EEB1 /* Main.storyboard */; }; 14 | 3F42C4041F28381B0096EEB1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3F42C4031F28381B0096EEB1 /* Assets.xcassets */; }; 15 | 3F42C4071F28381B0096EEB1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3F42C4051F28381B0096EEB1 /* LaunchScreen.storyboard */; }; 16 | 3F42C4121F28381C0096EEB1 /* EllipsePageControlTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F42C4111F28381C0096EEB1 /* EllipsePageControlTests.m */; }; 17 | 3F42C41D1F28381D0096EEB1 /* EllipsePageControlUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F42C41C1F28381D0096EEB1 /* EllipsePageControlUITests.m */; }; 18 | 3F626E461F28863800F14E4C /* EllipsePageControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F626E451F28863800F14E4C /* EllipsePageControl.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 3F42C40E1F28381C0096EEB1 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 3F42C3EC1F28381A0096EEB1 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 3F42C3F31F28381A0096EEB1; 27 | remoteInfo = EllipsePageControl; 28 | }; 29 | 3F42C4191F28381C0096EEB1 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 3F42C3EC1F28381A0096EEB1 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 3F42C3F31F28381A0096EEB1; 34 | remoteInfo = EllipsePageControl; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 3F42C3F41F28381A0096EEB1 /* EllipsePageControl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EllipsePageControl.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 3F42C3F81F28381A0096EEB1 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 41 | 3F42C3FA1F28381A0096EEB1 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 42 | 3F42C3FB1F28381B0096EEB1 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 43 | 3F42C3FD1F28381B0096EEB1 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 44 | 3F42C3FE1F28381B0096EEB1 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 45 | 3F42C4011F28381B0096EEB1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 46 | 3F42C4031F28381B0096EEB1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | 3F42C4061F28381B0096EEB1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | 3F42C4081F28381C0096EEB1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 3F42C40D1F28381C0096EEB1 /* EllipsePageControlTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EllipsePageControlTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 3F42C4111F28381C0096EEB1 /* EllipsePageControlTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EllipsePageControlTests.m; sourceTree = ""; }; 51 | 3F42C4131F28381C0096EEB1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 3F42C4181F28381C0096EEB1 /* EllipsePageControlUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EllipsePageControlUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 3F42C41C1F28381D0096EEB1 /* EllipsePageControlUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EllipsePageControlUITests.m; sourceTree = ""; }; 54 | 3F42C41E1F28381D0096EEB1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 3F626E441F28863800F14E4C /* EllipsePageControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EllipsePageControl.h; sourceTree = ""; }; 56 | 3F626E451F28863800F14E4C /* EllipsePageControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EllipsePageControl.m; sourceTree = ""; }; 57 | /* End PBXFileReference section */ 58 | 59 | /* Begin PBXFrameworksBuildPhase section */ 60 | 3F42C3F11F28381A0096EEB1 /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | 3F42C40A1F28381C0096EEB1 /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | 3F42C4151F28381C0096EEB1 /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | /* End PBXFrameworksBuildPhase section */ 82 | 83 | /* Begin PBXGroup section */ 84 | 3F42C3EB1F28381A0096EEB1 = { 85 | isa = PBXGroup; 86 | children = ( 87 | 3F42C3F61F28381A0096EEB1 /* EllipsePageControl */, 88 | 3F42C4101F28381C0096EEB1 /* EllipsePageControlTests */, 89 | 3F42C41B1F28381D0096EEB1 /* EllipsePageControlUITests */, 90 | 3F42C3F51F28381A0096EEB1 /* Products */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 3F42C3F51F28381A0096EEB1 /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 3F42C3F41F28381A0096EEB1 /* EllipsePageControl.app */, 98 | 3F42C40D1F28381C0096EEB1 /* EllipsePageControlTests.xctest */, 99 | 3F42C4181F28381C0096EEB1 /* EllipsePageControlUITests.xctest */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | 3F42C3F61F28381A0096EEB1 /* EllipsePageControl */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 3F626E431F28863800F14E4C /* EllipsePageControl */, 108 | 3F42C3FA1F28381A0096EEB1 /* AppDelegate.h */, 109 | 3F42C3FB1F28381B0096EEB1 /* AppDelegate.m */, 110 | 3F42C3FD1F28381B0096EEB1 /* ViewController.h */, 111 | 3F42C3FE1F28381B0096EEB1 /* ViewController.m */, 112 | 3F42C4001F28381B0096EEB1 /* Main.storyboard */, 113 | 3F42C4031F28381B0096EEB1 /* Assets.xcassets */, 114 | 3F42C4051F28381B0096EEB1 /* LaunchScreen.storyboard */, 115 | 3F42C4081F28381C0096EEB1 /* Info.plist */, 116 | 3F42C3F71F28381A0096EEB1 /* Supporting Files */, 117 | ); 118 | path = EllipsePageControl; 119 | sourceTree = ""; 120 | }; 121 | 3F42C3F71F28381A0096EEB1 /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 3F42C3F81F28381A0096EEB1 /* main.m */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | 3F42C4101F28381C0096EEB1 /* EllipsePageControlTests */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 3F42C4111F28381C0096EEB1 /* EllipsePageControlTests.m */, 133 | 3F42C4131F28381C0096EEB1 /* Info.plist */, 134 | ); 135 | path = EllipsePageControlTests; 136 | sourceTree = ""; 137 | }; 138 | 3F42C41B1F28381D0096EEB1 /* EllipsePageControlUITests */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 3F42C41C1F28381D0096EEB1 /* EllipsePageControlUITests.m */, 142 | 3F42C41E1F28381D0096EEB1 /* Info.plist */, 143 | ); 144 | path = EllipsePageControlUITests; 145 | sourceTree = ""; 146 | }; 147 | 3F626E431F28863800F14E4C /* EllipsePageControl */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 3F626E441F28863800F14E4C /* EllipsePageControl.h */, 151 | 3F626E451F28863800F14E4C /* EllipsePageControl.m */, 152 | ); 153 | path = EllipsePageControl; 154 | sourceTree = ""; 155 | }; 156 | /* End PBXGroup section */ 157 | 158 | /* Begin PBXNativeTarget section */ 159 | 3F42C3F31F28381A0096EEB1 /* EllipsePageControl */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = 3F42C4211F28381D0096EEB1 /* Build configuration list for PBXNativeTarget "EllipsePageControl" */; 162 | buildPhases = ( 163 | 3F42C3F01F28381A0096EEB1 /* Sources */, 164 | 3F42C3F11F28381A0096EEB1 /* Frameworks */, 165 | 3F42C3F21F28381A0096EEB1 /* Resources */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | ); 171 | name = EllipsePageControl; 172 | productName = EllipsePageControl; 173 | productReference = 3F42C3F41F28381A0096EEB1 /* EllipsePageControl.app */; 174 | productType = "com.apple.product-type.application"; 175 | }; 176 | 3F42C40C1F28381C0096EEB1 /* EllipsePageControlTests */ = { 177 | isa = PBXNativeTarget; 178 | buildConfigurationList = 3F42C4241F28381D0096EEB1 /* Build configuration list for PBXNativeTarget "EllipsePageControlTests" */; 179 | buildPhases = ( 180 | 3F42C4091F28381C0096EEB1 /* Sources */, 181 | 3F42C40A1F28381C0096EEB1 /* Frameworks */, 182 | 3F42C40B1F28381C0096EEB1 /* Resources */, 183 | ); 184 | buildRules = ( 185 | ); 186 | dependencies = ( 187 | 3F42C40F1F28381C0096EEB1 /* PBXTargetDependency */, 188 | ); 189 | name = EllipsePageControlTests; 190 | productName = EllipsePageControlTests; 191 | productReference = 3F42C40D1F28381C0096EEB1 /* EllipsePageControlTests.xctest */; 192 | productType = "com.apple.product-type.bundle.unit-test"; 193 | }; 194 | 3F42C4171F28381C0096EEB1 /* EllipsePageControlUITests */ = { 195 | isa = PBXNativeTarget; 196 | buildConfigurationList = 3F42C4271F28381D0096EEB1 /* Build configuration list for PBXNativeTarget "EllipsePageControlUITests" */; 197 | buildPhases = ( 198 | 3F42C4141F28381C0096EEB1 /* Sources */, 199 | 3F42C4151F28381C0096EEB1 /* Frameworks */, 200 | 3F42C4161F28381C0096EEB1 /* Resources */, 201 | ); 202 | buildRules = ( 203 | ); 204 | dependencies = ( 205 | 3F42C41A1F28381C0096EEB1 /* PBXTargetDependency */, 206 | ); 207 | name = EllipsePageControlUITests; 208 | productName = EllipsePageControlUITests; 209 | productReference = 3F42C4181F28381C0096EEB1 /* EllipsePageControlUITests.xctest */; 210 | productType = "com.apple.product-type.bundle.ui-testing"; 211 | }; 212 | /* End PBXNativeTarget section */ 213 | 214 | /* Begin PBXProject section */ 215 | 3F42C3EC1F28381A0096EEB1 /* Project object */ = { 216 | isa = PBXProject; 217 | attributes = { 218 | LastUpgradeCheck = 0830; 219 | ORGANIZATIONNAME = cardlan; 220 | TargetAttributes = { 221 | 3F42C3F31F28381A0096EEB1 = { 222 | CreatedOnToolsVersion = 8.3.1; 223 | DevelopmentTeam = 9DV836NYMJ; 224 | ProvisioningStyle = Automatic; 225 | }; 226 | 3F42C40C1F28381C0096EEB1 = { 227 | CreatedOnToolsVersion = 8.3.1; 228 | ProvisioningStyle = Automatic; 229 | TestTargetID = 3F42C3F31F28381A0096EEB1; 230 | }; 231 | 3F42C4171F28381C0096EEB1 = { 232 | CreatedOnToolsVersion = 8.3.1; 233 | ProvisioningStyle = Automatic; 234 | TestTargetID = 3F42C3F31F28381A0096EEB1; 235 | }; 236 | }; 237 | }; 238 | buildConfigurationList = 3F42C3EF1F28381A0096EEB1 /* Build configuration list for PBXProject "EllipsePageControl" */; 239 | compatibilityVersion = "Xcode 3.2"; 240 | developmentRegion = English; 241 | hasScannedForEncodings = 0; 242 | knownRegions = ( 243 | en, 244 | Base, 245 | ); 246 | mainGroup = 3F42C3EB1F28381A0096EEB1; 247 | productRefGroup = 3F42C3F51F28381A0096EEB1 /* Products */; 248 | projectDirPath = ""; 249 | projectRoot = ""; 250 | targets = ( 251 | 3F42C3F31F28381A0096EEB1 /* EllipsePageControl */, 252 | 3F42C40C1F28381C0096EEB1 /* EllipsePageControlTests */, 253 | 3F42C4171F28381C0096EEB1 /* EllipsePageControlUITests */, 254 | ); 255 | }; 256 | /* End PBXProject section */ 257 | 258 | /* Begin PBXResourcesBuildPhase section */ 259 | 3F42C3F21F28381A0096EEB1 /* Resources */ = { 260 | isa = PBXResourcesBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | 3F42C4071F28381B0096EEB1 /* LaunchScreen.storyboard in Resources */, 264 | 3F42C4041F28381B0096EEB1 /* Assets.xcassets in Resources */, 265 | 3F42C4021F28381B0096EEB1 /* Main.storyboard in Resources */, 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | }; 269 | 3F42C40B1F28381C0096EEB1 /* Resources */ = { 270 | isa = PBXResourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | 3F42C4161F28381C0096EEB1 /* Resources */ = { 277 | isa = PBXResourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | /* End PBXResourcesBuildPhase section */ 284 | 285 | /* Begin PBXSourcesBuildPhase section */ 286 | 3F42C3F01F28381A0096EEB1 /* Sources */ = { 287 | isa = PBXSourcesBuildPhase; 288 | buildActionMask = 2147483647; 289 | files = ( 290 | 3F42C3FF1F28381B0096EEB1 /* ViewController.m in Sources */, 291 | 3F42C3FC1F28381B0096EEB1 /* AppDelegate.m in Sources */, 292 | 3F42C3F91F28381A0096EEB1 /* main.m in Sources */, 293 | 3F626E461F28863800F14E4C /* EllipsePageControl.m in Sources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | 3F42C4091F28381C0096EEB1 /* Sources */ = { 298 | isa = PBXSourcesBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | 3F42C4121F28381C0096EEB1 /* EllipsePageControlTests.m in Sources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | 3F42C4141F28381C0096EEB1 /* Sources */ = { 306 | isa = PBXSourcesBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | 3F42C41D1F28381D0096EEB1 /* EllipsePageControlUITests.m in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | /* End PBXSourcesBuildPhase section */ 314 | 315 | /* Begin PBXTargetDependency section */ 316 | 3F42C40F1F28381C0096EEB1 /* PBXTargetDependency */ = { 317 | isa = PBXTargetDependency; 318 | target = 3F42C3F31F28381A0096EEB1 /* EllipsePageControl */; 319 | targetProxy = 3F42C40E1F28381C0096EEB1 /* PBXContainerItemProxy */; 320 | }; 321 | 3F42C41A1F28381C0096EEB1 /* PBXTargetDependency */ = { 322 | isa = PBXTargetDependency; 323 | target = 3F42C3F31F28381A0096EEB1 /* EllipsePageControl */; 324 | targetProxy = 3F42C4191F28381C0096EEB1 /* PBXContainerItemProxy */; 325 | }; 326 | /* End PBXTargetDependency section */ 327 | 328 | /* Begin PBXVariantGroup section */ 329 | 3F42C4001F28381B0096EEB1 /* Main.storyboard */ = { 330 | isa = PBXVariantGroup; 331 | children = ( 332 | 3F42C4011F28381B0096EEB1 /* Base */, 333 | ); 334 | name = Main.storyboard; 335 | sourceTree = ""; 336 | }; 337 | 3F42C4051F28381B0096EEB1 /* LaunchScreen.storyboard */ = { 338 | isa = PBXVariantGroup; 339 | children = ( 340 | 3F42C4061F28381B0096EEB1 /* Base */, 341 | ); 342 | name = LaunchScreen.storyboard; 343 | sourceTree = ""; 344 | }; 345 | /* End PBXVariantGroup section */ 346 | 347 | /* Begin XCBuildConfiguration section */ 348 | 3F42C41F1F28381D0096EEB1 /* Debug */ = { 349 | isa = XCBuildConfiguration; 350 | buildSettings = { 351 | ALWAYS_SEARCH_USER_PATHS = NO; 352 | CLANG_ANALYZER_NONNULL = YES; 353 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 354 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 355 | CLANG_CXX_LIBRARY = "libc++"; 356 | CLANG_ENABLE_MODULES = YES; 357 | CLANG_ENABLE_OBJC_ARC = YES; 358 | CLANG_WARN_BOOL_CONVERSION = YES; 359 | CLANG_WARN_CONSTANT_CONVERSION = YES; 360 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 361 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 362 | CLANG_WARN_EMPTY_BODY = YES; 363 | CLANG_WARN_ENUM_CONVERSION = YES; 364 | CLANG_WARN_INFINITE_RECURSION = YES; 365 | CLANG_WARN_INT_CONVERSION = YES; 366 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 367 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 368 | CLANG_WARN_UNREACHABLE_CODE = YES; 369 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 370 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 371 | COPY_PHASE_STRIP = NO; 372 | DEBUG_INFORMATION_FORMAT = dwarf; 373 | ENABLE_STRICT_OBJC_MSGSEND = YES; 374 | ENABLE_TESTABILITY = YES; 375 | GCC_C_LANGUAGE_STANDARD = gnu99; 376 | GCC_DYNAMIC_NO_PIC = NO; 377 | GCC_NO_COMMON_BLOCKS = YES; 378 | GCC_OPTIMIZATION_LEVEL = 0; 379 | GCC_PREPROCESSOR_DEFINITIONS = ( 380 | "DEBUG=1", 381 | "$(inherited)", 382 | ); 383 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 384 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 385 | GCC_WARN_UNDECLARED_SELECTOR = YES; 386 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 387 | GCC_WARN_UNUSED_FUNCTION = YES; 388 | GCC_WARN_UNUSED_VARIABLE = YES; 389 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 390 | MTL_ENABLE_DEBUG_INFO = YES; 391 | ONLY_ACTIVE_ARCH = YES; 392 | SDKROOT = iphoneos; 393 | }; 394 | name = Debug; 395 | }; 396 | 3F42C4201F28381D0096EEB1 /* Release */ = { 397 | isa = XCBuildConfiguration; 398 | buildSettings = { 399 | ALWAYS_SEARCH_USER_PATHS = NO; 400 | CLANG_ANALYZER_NONNULL = YES; 401 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 402 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 403 | CLANG_CXX_LIBRARY = "libc++"; 404 | CLANG_ENABLE_MODULES = YES; 405 | CLANG_ENABLE_OBJC_ARC = YES; 406 | CLANG_WARN_BOOL_CONVERSION = YES; 407 | CLANG_WARN_CONSTANT_CONVERSION = YES; 408 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 409 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 410 | CLANG_WARN_EMPTY_BODY = YES; 411 | CLANG_WARN_ENUM_CONVERSION = YES; 412 | CLANG_WARN_INFINITE_RECURSION = YES; 413 | CLANG_WARN_INT_CONVERSION = YES; 414 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 415 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 416 | CLANG_WARN_UNREACHABLE_CODE = YES; 417 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 418 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 419 | COPY_PHASE_STRIP = NO; 420 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 421 | ENABLE_NS_ASSERTIONS = NO; 422 | ENABLE_STRICT_OBJC_MSGSEND = YES; 423 | GCC_C_LANGUAGE_STANDARD = gnu99; 424 | GCC_NO_COMMON_BLOCKS = YES; 425 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 426 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 427 | GCC_WARN_UNDECLARED_SELECTOR = YES; 428 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 429 | GCC_WARN_UNUSED_FUNCTION = YES; 430 | GCC_WARN_UNUSED_VARIABLE = YES; 431 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 432 | MTL_ENABLE_DEBUG_INFO = NO; 433 | SDKROOT = iphoneos; 434 | VALIDATE_PRODUCT = YES; 435 | }; 436 | name = Release; 437 | }; 438 | 3F42C4221F28381D0096EEB1 /* Debug */ = { 439 | isa = XCBuildConfiguration; 440 | buildSettings = { 441 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 442 | DEVELOPMENT_TEAM = 9DV836NYMJ; 443 | INFOPLIST_FILE = EllipsePageControl/Info.plist; 444 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 445 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 446 | PRODUCT_BUNDLE_IDENTIFIER = com.cardlan.EllipsePageControl; 447 | PRODUCT_NAME = "$(TARGET_NAME)"; 448 | }; 449 | name = Debug; 450 | }; 451 | 3F42C4231F28381D0096EEB1 /* Release */ = { 452 | isa = XCBuildConfiguration; 453 | buildSettings = { 454 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 455 | DEVELOPMENT_TEAM = 9DV836NYMJ; 456 | INFOPLIST_FILE = EllipsePageControl/Info.plist; 457 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 458 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 459 | PRODUCT_BUNDLE_IDENTIFIER = com.cardlan.EllipsePageControl; 460 | PRODUCT_NAME = "$(TARGET_NAME)"; 461 | }; 462 | name = Release; 463 | }; 464 | 3F42C4251F28381D0096EEB1 /* Debug */ = { 465 | isa = XCBuildConfiguration; 466 | buildSettings = { 467 | BUNDLE_LOADER = "$(TEST_HOST)"; 468 | INFOPLIST_FILE = EllipsePageControlTests/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 470 | PRODUCT_BUNDLE_IDENTIFIER = com.cardlan.EllipsePageControlTests; 471 | PRODUCT_NAME = "$(TARGET_NAME)"; 472 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EllipsePageControl.app/EllipsePageControl"; 473 | }; 474 | name = Debug; 475 | }; 476 | 3F42C4261F28381D0096EEB1 /* Release */ = { 477 | isa = XCBuildConfiguration; 478 | buildSettings = { 479 | BUNDLE_LOADER = "$(TEST_HOST)"; 480 | INFOPLIST_FILE = EllipsePageControlTests/Info.plist; 481 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 482 | PRODUCT_BUNDLE_IDENTIFIER = com.cardlan.EllipsePageControlTests; 483 | PRODUCT_NAME = "$(TARGET_NAME)"; 484 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EllipsePageControl.app/EllipsePageControl"; 485 | }; 486 | name = Release; 487 | }; 488 | 3F42C4281F28381D0096EEB1 /* Debug */ = { 489 | isa = XCBuildConfiguration; 490 | buildSettings = { 491 | INFOPLIST_FILE = EllipsePageControlUITests/Info.plist; 492 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 493 | PRODUCT_BUNDLE_IDENTIFIER = com.cardlan.EllipsePageControlUITests; 494 | PRODUCT_NAME = "$(TARGET_NAME)"; 495 | TEST_TARGET_NAME = EllipsePageControl; 496 | }; 497 | name = Debug; 498 | }; 499 | 3F42C4291F28381D0096EEB1 /* Release */ = { 500 | isa = XCBuildConfiguration; 501 | buildSettings = { 502 | INFOPLIST_FILE = EllipsePageControlUITests/Info.plist; 503 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 504 | PRODUCT_BUNDLE_IDENTIFIER = com.cardlan.EllipsePageControlUITests; 505 | PRODUCT_NAME = "$(TARGET_NAME)"; 506 | TEST_TARGET_NAME = EllipsePageControl; 507 | }; 508 | name = Release; 509 | }; 510 | /* End XCBuildConfiguration section */ 511 | 512 | /* Begin XCConfigurationList section */ 513 | 3F42C3EF1F28381A0096EEB1 /* Build configuration list for PBXProject "EllipsePageControl" */ = { 514 | isa = XCConfigurationList; 515 | buildConfigurations = ( 516 | 3F42C41F1F28381D0096EEB1 /* Debug */, 517 | 3F42C4201F28381D0096EEB1 /* Release */, 518 | ); 519 | defaultConfigurationIsVisible = 0; 520 | defaultConfigurationName = Release; 521 | }; 522 | 3F42C4211F28381D0096EEB1 /* Build configuration list for PBXNativeTarget "EllipsePageControl" */ = { 523 | isa = XCConfigurationList; 524 | buildConfigurations = ( 525 | 3F42C4221F28381D0096EEB1 /* Debug */, 526 | 3F42C4231F28381D0096EEB1 /* Release */, 527 | ); 528 | defaultConfigurationIsVisible = 0; 529 | defaultConfigurationName = Release; 530 | }; 531 | 3F42C4241F28381D0096EEB1 /* Build configuration list for PBXNativeTarget "EllipsePageControlTests" */ = { 532 | isa = XCConfigurationList; 533 | buildConfigurations = ( 534 | 3F42C4251F28381D0096EEB1 /* Debug */, 535 | 3F42C4261F28381D0096EEB1 /* Release */, 536 | ); 537 | defaultConfigurationIsVisible = 0; 538 | defaultConfigurationName = Release; 539 | }; 540 | 3F42C4271F28381D0096EEB1 /* Build configuration list for PBXNativeTarget "EllipsePageControlUITests" */ = { 541 | isa = XCConfigurationList; 542 | buildConfigurations = ( 543 | 3F42C4281F28381D0096EEB1 /* Debug */, 544 | 3F42C4291F28381D0096EEB1 /* Release */, 545 | ); 546 | defaultConfigurationIsVisible = 0; 547 | defaultConfigurationName = Release; 548 | }; 549 | /* End XCConfigurationList section */ 550 | }; 551 | rootObject = 3F42C3EC1F28381A0096EEB1 /* Project object */; 552 | } 553 | -------------------------------------------------------------------------------- /EllipsePageControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /EllipsePageControl.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /EllipsePageControl.xcodeproj/project.xcworkspace/xcuserdata/cardlan_yuhuajun.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackxhj/EllipsePageControl/0cd9a84bc885874f8ce6bd2c12bee894157d0f0c/EllipsePageControl.xcodeproj/project.xcworkspace/xcuserdata/cardlan_yuhuajun.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /EllipsePageControl.xcodeproj/project.xcworkspace/xcuserdata/j.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackxhj/EllipsePageControl/0cd9a84bc885874f8ce6bd2c12bee894157d0f0c/EllipsePageControl.xcodeproj/project.xcworkspace/xcuserdata/j.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /EllipsePageControl.xcodeproj/xcuserdata/cardlan_yuhuajun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /EllipsePageControl.xcodeproj/xcuserdata/cardlan_yuhuajun.xcuserdatad/xcschemes/EllipsePageControl.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 | -------------------------------------------------------------------------------- /EllipsePageControl.xcodeproj/xcuserdata/cardlan_yuhuajun.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | EllipsePageControl.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 3F42C3F31F28381A0096EEB1 16 | 17 | primary 18 | 19 | 20 | 3F42C40C1F28381C0096EEB1 21 | 22 | primary 23 | 24 | 25 | 3F42C4171F28381C0096EEB1 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /EllipsePageControl.xcodeproj/xcuserdata/j.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 21 | 22 | 23 | 25 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /EllipsePageControl.xcodeproj/xcuserdata/j.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | EllipsePageControl.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /EllipsePageControl/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // EllipsePageControl 4 | // 5 | // Created by cardlan_yuhuajun on 2017/7/26. 6 | // Copyright © 2017年 cardlan. 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 | -------------------------------------------------------------------------------- /EllipsePageControl/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // EllipsePageControl 4 | // 5 | // Created by cardlan_yuhuajun on 2017/7/26. 6 | // Copyright © 2017年 cardlan. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /EllipsePageControl/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /EllipsePageControl/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /EllipsePageControl/Assets.xcassets/bkimg.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "lunbochangtu@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "lunbochangtu@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /EllipsePageControl/Assets.xcassets/bkimg.imageset/lunbochangtu@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackxhj/EllipsePageControl/0cd9a84bc885874f8ce6bd2c12bee894157d0f0c/EllipsePageControl/Assets.xcassets/bkimg.imageset/lunbochangtu@2x.png -------------------------------------------------------------------------------- /EllipsePageControl/Assets.xcassets/bkimg.imageset/lunbochangtu@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackxhj/EllipsePageControl/0cd9a84bc885874f8ce6bd2c12bee894157d0f0c/EllipsePageControl/Assets.xcassets/bkimg.imageset/lunbochangtu@3x.png -------------------------------------------------------------------------------- /EllipsePageControl/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 | -------------------------------------------------------------------------------- /EllipsePageControl/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 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /EllipsePageControl/EllipsePageControl/EllipsePageControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // EllipsePageControl.h 3 | // EllipsePageControl 4 | // 5 | // Created by cardlan_yuhuajun on 2017/7/26. 6 | // Copyright © 2017年 cardlan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class EllipsePageControl; 12 | @protocol EllipsePageControlDelegate 13 | 14 | -(void)ellipsePageControlClick:(EllipsePageControl*)pageControl index:(NSInteger)clickIndex; 15 | 16 | @end 17 | @interface EllipsePageControl : UIControl 18 | 19 | /* 20 | 分页数量 21 | */ 22 | @property(nonatomic) NSInteger numberOfPages; 23 | /* 24 | 当前点所在下标 25 | */ 26 | @property(nonatomic) NSInteger currentPage; 27 | /* 28 | 未选中点的大小点的大小 29 | */ 30 | @property(nonatomic) CGSize otherControlSize; 31 | /* 32 | 选中的点的大小 33 | */ 34 | @property(nonatomic) CGSize currentControlSize; 35 | /* 36 | 点的间距 37 | */ 38 | @property(nonatomic) CGFloat controlSpacing; 39 | /* 40 | 其他未选中点颜色 41 | */ 42 | @property(nonatomic,strong) UIColor *otherColor; 43 | /* 44 | 当前点颜色 45 | */ 46 | @property(nonatomic,strong) UIColor *currentColor; 47 | /* 48 | 当前点背景图片 49 | */ 50 | @property(nonatomic,strong) UIImage *currentBkImg; 51 | @property(nonatomic,weak)id delegate; 52 | @end 53 | -------------------------------------------------------------------------------- /EllipsePageControl/EllipsePageControl/EllipsePageControl.m: -------------------------------------------------------------------------------- 1 | // 2 | // EllipsePageControl.m 3 | // EllipsePageControl 4 | // 5 | // Created by cardlan_yuhuajun on 2017/7/26. 6 | // Copyright © 2017年 cardlan. All rights reserved. 7 | // 8 | 9 | #import "EllipsePageControl.h" 10 | 11 | 12 | @interface EllipsePageControl () 13 | 14 | 15 | @end 16 | 17 | @implementation EllipsePageControl 18 | 19 | 20 | -(instancetype)init{ 21 | if(self=[super init]) { 22 | 23 | } 24 | return self; 25 | } 26 | 27 | -(instancetype)initWithFrame:(CGRect)frame{ 28 | if(self=[super initWithFrame:frame]){ 29 | [self initialize]; 30 | 31 | } 32 | return self; 33 | } 34 | 35 | 36 | 37 | -(void)layoutSubviews{ 38 | [super layoutSubviews]; 39 | 40 | } 41 | 42 | -(void)initialize{ 43 | self.backgroundColor=[UIColor clearColor]; 44 | _numberOfPages=0; 45 | _currentPage=0; 46 | _otherControlSize=CGSizeMake(6, 6); 47 | _currentControlSize = CGSizeMake(12, 6); 48 | _controlSpacing=8; 49 | _otherColor=[UIColor grayColor]; 50 | _currentColor=[UIColor orangeColor]; 51 | 52 | } 53 | 54 | -(void)setOtherColor:(UIColor *)otherColor{ 55 | 56 | if(![self isTheSameColor:otherColor anotherColor:_otherColor]){ 57 | 58 | _otherColor=otherColor; 59 | [self createPointView]; 60 | } 61 | } 62 | 63 | -(void)setCurrentColor:(UIColor *)currentColor{ 64 | if(![self isTheSameColor:currentColor anotherColor:_currentColor]){ 65 | _currentColor=currentColor; 66 | [self createPointView]; 67 | } 68 | } 69 | 70 | - (void)setCurrentControlSize:(CGSize)currentControlSize 71 | { 72 | if (!CGSizeEqualToSize(currentControlSize, _currentControlSize)) { 73 | _currentControlSize = currentControlSize; 74 | [self createPointView]; 75 | } 76 | } 77 | 78 | - (void)setOtherControlSize:(CGSize)otherControlSize 79 | { 80 | if (!CGSizeEqualToSize(otherControlSize, _otherControlSize)) { 81 | _otherControlSize = otherControlSize; 82 | [self createPointView]; 83 | } 84 | } 85 | 86 | -(void)setControlSpacing:(CGFloat)controlSpacing 87 | { 88 | if(_controlSpacing != controlSpacing){ 89 | 90 | _controlSpacing=controlSpacing; 91 | [self createPointView]; 92 | 93 | } 94 | } 95 | 96 | -(void)setCurrentBkImg:(UIImage *)currentBkImg{ 97 | if(_currentBkImg!=currentBkImg){ 98 | _currentBkImg=currentBkImg; 99 | [self createPointView]; 100 | } 101 | } 102 | 103 | 104 | -(void)setNumberOfPages:(NSInteger)page{ 105 | if(_numberOfPages==page) 106 | return; 107 | _numberOfPages=page; 108 | [self createPointView]; 109 | } 110 | 111 | -(void)setCurrentPage:(NSInteger)currentPage{ 112 | 113 | 114 | if([self.delegate respondsToSelector:@selector(ellipsePageControlClick:index:)]) 115 | { 116 | [self.delegate ellipsePageControlClick:self index:currentPage]; 117 | } 118 | 119 | if(_currentPage==currentPage) 120 | return; 121 | 122 | [self exchangeCurrentView:_currentPage new:currentPage]; 123 | _currentPage=currentPage; 124 | 125 | 126 | } 127 | 128 | - (void)setBounds:(CGRect)bounds 129 | { 130 | [super setBounds:bounds]; 131 | [self createPointView]; 132 | } 133 | 134 | -(void)clearView{ 135 | [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; 136 | } 137 | 138 | -(void)createPointView{ 139 | [self clearView]; 140 | if(_numberOfPages<=0) 141 | return; 142 | 143 | //居中控件 144 | CGFloat startX=0; 145 | CGFloat startY=0; 146 | CGFloat mainWidth=(_numberOfPages-1)*(_otherControlSize.width+_controlSpacing) + _currentControlSize.width; 147 | if(self.frame.size.widthold) 228 | mx-=(_currentControlSize.width - _otherControlSize.width); 229 | newSeltect.frame=CGRectMake(mx, newTemp.origin.y, _currentControlSize.width, _currentControlSize.height); 230 | 231 | // 左边的时候到右边 越过点击 232 | if(new-old>1) 233 | { 234 | for(NSInteger t=old+1;t 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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /EllipsePageControl/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // EllipsePageControl 4 | // 5 | // Created by cardlan_yuhuajun on 2017/7/26. 6 | // Copyright © 2017年 cardlan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /EllipsePageControl/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // EllipsePageControl 4 | // 5 | // Created by cardlan_yuhuajun on 2017/7/26. 6 | // Copyright © 2017年 cardlan. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "EllipsePageControl.h" 11 | 12 | @interface ViewController () 13 | @property(nonatomic,strong) UIPageControl *pageControl; 14 | @property(nonatomic,strong) EllipsePageControl *myPageControl1; 15 | @property(nonatomic,strong) EllipsePageControl *myPageControl2; 16 | @property(nonatomic,strong) EllipsePageControl *myPageControl3; 17 | 18 | @property(nonatomic,strong) UIScrollView *scrollView0; 19 | @property(nonatomic,strong) UIScrollView *scrollView1; 20 | @property(nonatomic,strong) UIScrollView *scrollView2; 21 | 22 | @end 23 | 24 | @implementation ViewController 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | _scrollView0=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 150)]; 36 | _scrollView0.contentSize=CGSizeMake([UIScreen mainScreen].bounds.size.width*6, 150); 37 | _scrollView0.delegate=self; 38 | _scrollView0.pagingEnabled = YES; 39 | _scrollView0.tag=1000; 40 | [self.view addSubview:_scrollView0]; 41 | 42 | _scrollView1=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 200, [UIScreen mainScreen].bounds.size.width, 150)]; 43 | _scrollView1.contentSize=CGSizeMake([UIScreen mainScreen].bounds.size.width*6, 150); 44 | _scrollView1.delegate=self; 45 | _scrollView1.pagingEnabled = YES; 46 | _scrollView1.tag=1001; 47 | [self.view addSubview:_scrollView1]; 48 | 49 | _scrollView2=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 400, [UIScreen mainScreen].bounds.size.width, 150)]; 50 | _scrollView2.contentSize=CGSizeMake([UIScreen mainScreen].bounds.size.width*6, 150); 51 | _scrollView2.delegate=self; 52 | _scrollView2.pagingEnabled = YES; 53 | _scrollView2.tag=1002; 54 | [self.view addSubview:_scrollView2]; 55 | 56 | 57 | _myPageControl1 = [[EllipsePageControl alloc] init]; 58 | _myPageControl1.frame=CGRectMake(0, 80,[UIScreen mainScreen].bounds.size.width, 30); 59 | _myPageControl1.numberOfPages = 6; 60 | _myPageControl1.delegate=self; 61 | _myPageControl1.tag=7777; 62 | [self.view addSubview:_myPageControl1]; 63 | 64 | 65 | _myPageControl2 = [[EllipsePageControl alloc] initWithFrame:CGRectMake(0, 280,[UIScreen mainScreen].bounds.size.width, 30)]; 66 | _myPageControl2.numberOfPages = 6; 67 | _myPageControl2.otherColor=[UIColor grayColor]; 68 | _myPageControl2.currentColor=[UIColor orangeColor]; 69 | _myPageControl2.delegate=self; 70 | _myPageControl2.currentControlSize=CGSizeMake(30, 6); 71 | _myPageControl2.tag=8888; 72 | [self.view addSubview:_myPageControl2]; 73 | 74 | 75 | 76 | _myPageControl3 = [[EllipsePageControl alloc] initWithFrame:CGRectMake(0, 480,[UIScreen mainScreen].bounds.size.width, 30)]; 77 | _myPageControl3.numberOfPages = 6; 78 | _myPageControl3.currentControlSize=CGSizeMake(30, 6); 79 | _myPageControl3.controlSpacing=15; 80 | // _myPageControl3.currentBkImg=[UIImage imageNamed:@"bkimg"]; 81 | _myPageControl3.delegate=self; 82 | _myPageControl3.tag=9999; 83 | [self.view addSubview:_myPageControl3]; 84 | 85 | 86 | } 87 | - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset { 88 | NSInteger currentPage = targetContentOffset->x / [UIScreen mainScreen].bounds.size.width; 89 | 90 | if(scrollView.tag==1000){ 91 | self.myPageControl1.currentPage = currentPage; 92 | }else if(scrollView.tag==1001){ 93 | self.myPageControl2.currentPage = currentPage; 94 | 95 | }else{ 96 | self.myPageControl3.currentPage = currentPage; 97 | 98 | } 99 | } 100 | 101 | #pragma mark EllipsePageControlDelegate。监听用户点击 102 | -(void)ellipsePageControlClick:(EllipsePageControl *)pageControl index:(NSInteger)clickIndex{ 103 | 104 | NSLog(@"%ld",clickIndex); 105 | if(pageControl.tag==1000) 106 | { 107 | 108 | CGPoint position = CGPointMake([UIScreen mainScreen].bounds.size.width * clickIndex, 150); 109 | [_scrollView0 setContentOffset:position animated:YES]; 110 | 111 | }else if(pageControl.tag==1001){ 112 | CGPoint position = CGPointMake([UIScreen mainScreen].bounds.size.width * clickIndex, 150); 113 | [_scrollView1 setContentOffset:position animated:YES]; 114 | }else{ 115 | CGPoint position = CGPointMake([UIScreen mainScreen].bounds.size.width * clickIndex, 150); 116 | [_scrollView2 setContentOffset:position animated:YES]; 117 | 118 | } 119 | } 120 | 121 | - (IBAction)go:(id)sender { 122 | 123 | 124 | 125 | } 126 | 127 | - (void)didReceiveMemoryWarning { 128 | [super didReceiveMemoryWarning]; 129 | // Dispose of any resources that can be recreated. 130 | } 131 | 132 | 133 | @end 134 | -------------------------------------------------------------------------------- /EllipsePageControl/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // EllipsePageControl 4 | // 5 | // Created by cardlan_yuhuajun on 2017/7/26. 6 | // Copyright © 2017年 cardlan. 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 | -------------------------------------------------------------------------------- /EllipsePageControlTests/EllipsePageControlTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // EllipsePageControlTests.m 3 | // EllipsePageControlTests 4 | // 5 | // Created by cardlan_yuhuajun on 2017/7/26. 6 | // Copyright © 2017年 cardlan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface EllipsePageControlTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation EllipsePageControlTests 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 | -------------------------------------------------------------------------------- /EllipsePageControlTests/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 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /EllipsePageControlUITests/EllipsePageControlUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // EllipsePageControlUITests.m 3 | // EllipsePageControlUITests 4 | // 5 | // Created by cardlan_yuhuajun on 2017/7/26. 6 | // Copyright © 2017年 cardlan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface EllipsePageControlUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation EllipsePageControlUITests 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 | -------------------------------------------------------------------------------- /EllipsePageControlUITests/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 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 hackxhj <643087041@qq.com> 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 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 椭圆 长方形的 PageControl 自定义 2 | 3 | ```objc 4 | @property(nonatomic) NSInteger numberOfPages; // 多少分页点 5 | 6 | @property(nonatomic) NSInteger currentPage; // 当前点位置 7 | 8 | @property(nonatomic) NSInteger controlSize; // 点大小 9 | 10 | @property(nonatomic) NSInteger controlSpacing; // 点的间距 11 | 12 | @property(nonatomic,strong) UIColor *otherColor; // 其他点颜色 13 | 14 | @property(nonatomic,strong) UIColor *currentColor; // 当前点颜色 15 | 16 | @property(nonatomic,strong) UIImage *currentBkImg; // 当前点背景颜色 17 | ``` 18 | 19 | 使用例子: 20 | ### 支持pod导入 21 | ```ruby 22 | pod 'EllipsePageControl','~> 0.0.4' 23 | ``` 24 | 25 | 26 | ### 头文件引入 27 | 28 | #import "EllipsePageControl.h" 29 | 30 | ### 定义 31 | ```objc 32 | @property(nonatomic,strong) EllipsePageControl *myPageControl1; 33 | ``` 34 | ### 使用 35 | 36 | ```objc 37 | _myPageControl1 = [[EllipsePageControl alloc] init]; 38 | 39 | _myPageControl1.frame=CGRectMake(0, 80,[UIScreen mainScreen].bounds.size.width, 30); 40 | 41 | _myPageControl1.numberOfPages = 6; 42 | 43 | _myPageControl1.delegate=self; 44 | 45 | [self.view addSubview:_myPageControl1]; 46 | 47 | 48 | 49 | 50 | ### #pragma mark EllipsePageControlDelegate。监听用户点击 51 | 52 | -(void)ellipsePageControlClick:(EllipsePageControl *)pageControl index:(NSInteger)clickIndex{ 53 | 54 | } 55 | ``` 56 | ###  看效果图  demo 详细使用 57 | 58 | show 59 | --------------------------------------------------------------------------------