Skip to content

Commit

Permalink
Bugfixes/0.1.1 (#19)
Browse files Browse the repository at this point in the history
* This fixes #16, fixes #18
  • Loading branch information
love4soul authored and chili-ios committed Mar 29, 2017
1 parent 4a7832e commit 6e56737
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHIPageControl.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'CHIPageControl'
s.version = '0.1'
s.version = '0.1.1'
s.summary = 'CHIPageControl is a set of cool animated page controls written in Swift to replace boring UIPageControl.'

s.ios.deployment_target = '8.0'
Expand Down
1 change: 1 addition & 0 deletions CHIPageControl/CHIPageControlAji.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ open class CHIPageControlAji: CHIBasePageControl {
}

override func updateNumberOfPages(_ count: Int) {
inactive.forEach { $0.removeFromSuperlayer() }
inactive = [CHILayer]()
inactive = (0..<count).map {_ in
let layer = CHILayer()
Expand Down
1 change: 1 addition & 0 deletions CHIPageControl/CHIPageControlAleppo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ open class CHIPageControlAleppo: CHIBasePageControl {
}

override func updateNumberOfPages(_ count: Int) {
inactive.forEach { $0.removeFromSuperlayer() }
inactive = [CHILayer]()
inactive = (0..<count).map {_ in
let layer = CHILayer()
Expand Down
1 change: 1 addition & 0 deletions CHIPageControl/CHIPageControlChimayo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ open class CHIPageControlChimayo: CHIBasePageControl {
}

override func updateNumberOfPages(_ count: Int) {
inactive.forEach { $0.removeFromSuperlayer() }
inactive = [CHILayer]()
inactive = (0..<count).map {_ in
let layer = CHILayer()
Expand Down
1 change: 1 addition & 0 deletions CHIPageControl/CHIPageControlFresno.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ open class CHIPageControlFresno: CHIBasePageControl {
}

override func updateNumberOfPages(_ count: Int) {
elements.forEach { $0.removeFromSuperlayer() }
elements = [CHILayer]()
elements = (0..<count).map {_ in
let layer = CHILayer()
Expand Down
1 change: 1 addition & 0 deletions CHIPageControl/CHIPageControlJalapeno.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ open class CHIPageControlJalapeno: CHIBasePageControl {
}

override func updateNumberOfPages(_ count: Int) {
inactive.forEach { $0.removeFromSuperlayer() }
inactive = [CHILayer]()
inactive = (0..<count).map {_ in
let layer = CHILayer()
Expand Down
1 change: 1 addition & 0 deletions CHIPageControl/CHIPageControlJaloro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ open class CHIPageControlJaloro: CHIBasePageControl {
}

override func updateNumberOfPages(_ count: Int) {
inactive.forEach { $0.removeFromSuperlayer() }
inactive = [CHILayer]()
inactive = (0..<count).map {_ in
let layer = CHILayer()
Expand Down
1 change: 1 addition & 0 deletions CHIPageControl/CHIPageControlPaprika.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ open class CHIPageControlPaprika: CHIBasePageControl {
}

override func updateNumberOfPages(_ count: Int) {
elements.forEach { $0.removeFromSuperlayer() }
elements.forEach() { $0.removeFromSuperlayer() }
elements = [CHILayer]()
elements = (0..<count).map {_ in
Expand Down
1 change: 1 addition & 0 deletions CHIPageControl/CHIPageControlPuya.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ open class CHIPageControlPuya: CHIBasePageControl {
}

override func updateNumberOfPages(_ count: Int) {
elements.forEach { $0.removeFromSuperlayer() }
elements = [CHILayer]()
elements = (0..<count).map {_ in
let layer = CHILayer()
Expand Down
10 changes: 7 additions & 3 deletions CHIPageControl/Core/CHIBasePageControl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,17 @@ import UIKit

required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)

self.displayLink = CADisplayLink(target: self, selector: #selector(updateFrame))
self.displayLink?.add(to: .current, forMode: .defaultRunLoopMode)
setupDisplayLink()
}

public override init(frame: CGRect) {
super.init(frame: frame)
setupDisplayLink()
}

internal func setupDisplayLink() {
self.displayLink = CADisplayLink(target: self, selector: #selector(updateFrame))
self.displayLink?.add(to: .current, forMode: .defaultRunLoopMode)
}

internal func updateFrame() {
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Just add the `CHIPageControl` folder to your project.

use [CocoaPods](https://cocoapods.org) with Podfile:
``` ruby
pod 'CHIPageControl', '~> 0.1'
pod 'CHIPageControl', '~> 0.1.1'

# individual page control
pod 'CHIPageControl/Aji'
Expand All @@ -41,7 +41,7 @@ pod 'CHIPageControl/Puya'

use [Carthage](https://github.com/Carthage/Carthage) with Cartfile
```ogdl
github "ChiliLabs/CHIPageControl" ~> 0.1
github "ChiliLabs/CHIPageControl" ~> 0.1.1
```


Expand All @@ -51,7 +51,7 @@ Just drop UIView and set its class to be one of CHIPageControls.
<img src="Images/ibdesignable.gif" width="800" height="564">
### 💻 Code
``` swift
let pageControl = CHIPageControlAji(frame: CGRect(x: 0, y:0, with: 100, height: 20))
let pageControl = CHIPageControlAji(frame: CGRect(x: 0, y:0, width: 100, height: 20))
pageControl.numberOfPages = 4
pageControl.radius = 4
pageControl.tintColor = .red
Expand Down

0 comments on commit 6e56737

Please sign in to comment.