Skip to content

Commit

Permalink
Fixes #24 (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
love4soul authored and chili-ios committed Apr 21, 2017
1 parent a8780e7 commit c431605
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 10 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.2'
s.version = '0.1.3'
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 @@ -84,6 +84,7 @@ open class CHIPageControlAji: CHIBasePageControl {
override func update(for progress: Double) {
guard let min = inactive.first?.frame,
let max = inactive.last?.frame,
numberOfPages > 1,
progress >= 0 && progress <= Double(numberOfPages - 1) else {
return
}
Expand Down
4 changes: 3 additions & 1 deletion CHIPageControl/CHIPageControlAleppo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ open class CHIPageControlAleppo: CHIBasePageControl {

override func update(for progress: Double) {
guard progress >= 0 && progress <= Double(numberOfPages - 1),
let firstFrame = self.inactive.first?.frame else { return }
let firstFrame = self.inactive.first?.frame,
numberOfPages > 1 else { return }

let normalized = progress * Double(diameter + padding)
let distance = abs(round(progress) - progress)
let mult = 1 + distance * 2
Expand Down
3 changes: 2 additions & 1 deletion CHIPageControl/CHIPageControlChimayo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ open class CHIPageControlChimayo: CHIBasePageControl {
}

override func update(for progress: Double) {
guard progress >= 0 && progress <= Double(numberOfPages - 1) else { return }
guard progress >= 0 && progress <= Double(numberOfPages - 1),
numberOfPages > 1 else { return }

let rect = CGRect(x: 0, y: 0, width: self.diameter, height: self.diameter).insetBy(dx: 1, dy: 1)

Expand Down
3 changes: 2 additions & 1 deletion CHIPageControl/CHIPageControlFresno.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ open class CHIPageControlFresno: CHIBasePageControl {
override func update(for progress: Double) {
guard let min = self.min,
let max = self.max,
progress >= 0 && progress <= Double(numberOfPages - 1) else {
progress >= 0 && progress <= Double(numberOfPages - 1),
numberOfPages > 1 else {
return
}

Expand Down
3 changes: 2 additions & 1 deletion CHIPageControl/CHIPageControlJalapeno.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ open class CHIPageControlJalapeno: CHIBasePageControl {

override func update(for progress: Double) {
guard progress >= 0 && progress <= Double(numberOfPages - 1),
let firstFrame = self.inactive.first?.frame else {
let firstFrame = self.inactive.first?.frame,
numberOfPages > 1 else {
return
}
let left = firstFrame.origin.x
Expand Down
3 changes: 2 additions & 1 deletion CHIPageControl/CHIPageControlJaloro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ open class CHIPageControlJaloro: CHIBasePageControl {
override func update(for progress: Double) {
guard let min = inactive.first?.frame,
let max = inactive.last?.frame,
progress >= 0 && progress <= Double(numberOfPages - 1) else {
progress >= 0 && progress <= Double(numberOfPages - 1),
numberOfPages > 1 else {
return
}

Expand Down
3 changes: 2 additions & 1 deletion CHIPageControl/CHIPageControlPaprika.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ open class CHIPageControlPaprika: CHIBasePageControl {

override func update(for progress: Double) {
guard let min = self.min,
let max = self.max else {
let max = self.max,
numberOfPages > 1 else {
return
}
var progress = progress
Expand Down
3 changes: 2 additions & 1 deletion CHIPageControl/CHIPageControlPuya.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ open class CHIPageControlPuya: CHIBasePageControl {
override func update(for progress: Double) {
guard let min = self.min,
let max = self.max,
progress >= 0 && progress <= Double(numberOfPages - 1) else {
progress >= 0 && progress <= Double(numberOfPages - 1),
numberOfPages > 1 else {
return
}

Expand Down
4 changes: 2 additions & 2 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.2'
pod 'CHIPageControl', '~> 0.1.3'

# 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.2
github "ChiliLabs/CHIPageControl" ~> 0.1.3
```


Expand Down

0 comments on commit c431605

Please sign in to comment.