Skip to content

Commit e9ac833

Browse files
author
谭家祥
committed
add open authority
1 parent cec7923 commit e9ac833

11 files changed

Lines changed: 25 additions & 21 deletions

Example/JXPageControl/Demo/JumpVC.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class JumpVC: UIViewController {
3131
override func viewDidLoad() {
3232
super.viewDidLoad()
3333

34+
self.automaticallyAdjustsScrollViewInsets = false
3435
scrollView.delegate = self
3536
}
3637

JXPageControl.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'JXPageControl'
11-
s.version = '0.1.2'
11+
s.version = '0.1.3'
1212
s.summary = 'Custom UIPageControl: supports multiple animations, layouts'
1313

1414
# This description is used to generate tags and improve search results.

JXPageControl/Classes/Common/JXPageControlBase.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@
88

99
import UIKit
1010

11-
@IBDesignable public class JXPageControlBase: UIView, JXPageControlType {
11+
@IBDesignable open class JXPageControlBase: UIView, JXPageControlType {
1212

1313
public override init(frame: CGRect) {
1414
super.init(frame: frame)
1515
setBase()
1616
}
1717

18-
internal required init?(coder aDecoder: NSCoder) {
18+
public required init?(coder aDecoder: NSCoder) {
1919
super.init(coder: aDecoder)
2020
setBase()
2121
}
2222

23-
func setBase() {
23+
open func setBase() {
2424
addSubview(contentView)
2525
}
2626

27-
public override var contentMode: UIViewContentMode {
27+
open override var contentMode: UIViewContentMode {
2828
didSet {
2929
switch contentMode {
3030

@@ -55,7 +55,7 @@ import UIKit
5555
}
5656
}
5757

58-
public override func layoutSubviews() {
58+
open override func layoutSubviews() {
5959
super.layoutSubviews()
6060
layoutContentView()
6161
}
@@ -196,6 +196,8 @@ import UIKit
196196
if hidesForSinglePage,
197197
numberOfPages == 1 {
198198
contentView.isHidden = true
199+
}else if numberOfPages == 0 {
200+
contentView.isHidden = true
199201
}else {
200202
contentView.isHidden = false
201203
}

JXPageControl/Classes/Jump/JXPageControlBoldLine.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
import UIKit
1010

11-
class JXPageControlBoldLine: JXPageControlJump {
11+
@IBDesignable open class JXPageControlBoldLine: JXPageControlJump {
1212

13-
override func setBase() {
13+
override open func setBase() {
1414
super.setBase()
1515
indicatorSize = CGSize(width: 15, height: 6)
1616
isAnimation = false

JXPageControl/Classes/Jump/JXPageControlEllipse.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ import UIKit
1111

1212
//private let kMinContentSize = CGSize(width: 2, height: 2)
1313

14-
@IBDesignable public class JXPageControlEllipse: JXPageControlJump {
14+
@IBDesignable open class JXPageControlEllipse: JXPageControlJump {
1515

16-
override func setBase() {
16+
override open func setBase() {
1717
super.setBase()
1818
inactiveSize = CGSize(width: 6, height: 6)
1919
activeSize = CGSize(width: 15, height: 6)
20-
columnSpacing = 5.0
20+
columnSpacing = 0
2121
isAnimation = false
2222
}
2323
}

JXPageControl/Classes/Jump/JXPageControlJump.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
import UIKit
99

10-
@IBDesignable public class JXPageControlJump: JXPageControlBase {
10+
@IBDesignable open class JXPageControlJump: JXPageControlBase {
1111

12-
override func setBase() {
12+
override open func setBase() {
1313
super.setBase()
1414
}
1515

@@ -31,10 +31,11 @@ import UIKit
3131
let marginyY = (maxIndicatorSize.height - activeSize.height) * 0.5
3232
let marginW = (maxIndicatorSize.width - minIndicatorSize.width) * 0.5
3333
let x = progress * (maxIndicatorSize.width + columnSpacing) + marginX
34+
3435
switch isAnimation {
3536
case true:
3637
let width = activeSize.width
37-
+ columnSpacing + marginW * (abs(round(progress) - progress) * 2)
38+
+ (columnSpacing + marginW) * (abs(round(progress) - progress) * 2)
3839
let newFrame = CGRect(x: x,
3940
y: marginyY,
4041
width: width,

JXPageControl/Classes/Jump/JXPageControlLine.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
import UIKit
1010

11-
@IBDesignable public class JXPageControlLine: JXPageControlJump {
11+
@IBDesignable open class JXPageControlLine: JXPageControlJump {
1212

13-
override func setBase() {
13+
override open func setBase() {
1414
super.setBase()
1515
indicatorSize = CGSize(width: 15, height: 2)
1616
isAnimation = false

JXPageControl/Classes/Transform/JXPageControlChameleon.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import UIKit
1010

11-
@IBDesignable public class JXPageControlChameleon: JXPageControlBase {
11+
@IBDesignable open class JXPageControlChameleon: JXPageControlBase {
1212

1313

1414
// MARK: - -------------------------- JXPageControlType --------------------------

JXPageControl/Classes/Transform/JXPageControlExchange.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import UIKit
1010

1111

12-
@IBDesignable public class JXPageControlExchange: JXPageControlBase {
12+
@IBDesignable open class JXPageControlExchange: JXPageControlBase {
1313

1414
// MARK: - -------------------------- Custom property list --------------------------
1515

JXPageControl/Classes/Transform/JXPageControlFill.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import UIKit
1010
import CoreGraphics
1111

12-
@IBDesignable public class JXPageControlFill: JXPageControlBase {
12+
@IBDesignable open class JXPageControlFill: JXPageControlBase {
1313

1414

1515
/// Please use the property "diameter"

0 commit comments

Comments
 (0)