Skip to content

Commit d77d267

Browse files
committed
[UPD]: Access control
1 parent ba34964 commit d77d267

File tree

7 files changed

+31
-31
lines changed

7 files changed

+31
-31
lines changed

Classes/MAAnimatedMultiGearView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import UIKit
1212

1313
/// This class is used to draw and animate multiple gears
1414

15-
class MAAnimatedMultiGearView: MAMultiGearView {
15+
public class MAAnimatedMultiGearView: MAMultiGearView {
1616

1717
//MARK: Instance properties
1818

@@ -38,7 +38,7 @@ class MAAnimatedMultiGearView: MAMultiGearView {
3838
//MARK: Various methods
3939

4040
/// Override of the `addLinkedGear` method in order to update the array of rotational angle when a gear is added
41-
override func addLinkedGear(_ gearLinked: Int, nbTeeth:UInt, color:UIColor, angleInDegree:Double) -> Bool {
41+
override public func addLinkedGear(_ gearLinked: Int, nbTeeth:UInt, color:UIColor, angleInDegree:Double) -> Bool {
4242

4343
if !super.addLinkedGear(gearLinked, nbTeeth: nbTeeth, color: color, angleInDegree: angleInDegree) {
4444
return false
@@ -97,14 +97,14 @@ class MAAnimatedMultiGearView: MAMultiGearView {
9797
}
9898

9999
/// Public method to start rotating
100-
func startRotating() {
100+
public func startRotating() {
101101
stopRotation = false
102102
rotate()
103103
}
104104

105105

106106
/// Public method to start rotating
107-
func stopRotating() {
107+
public func stopRotating() {
108108
stopRotation = true
109109
}
110110
}

Classes/MAGear.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import UIKit
1111
//MARK: - MAGear Class
1212

1313
/// This class represents a gear in the most abstract way, without any graphical code related.
14-
internal class MAGear {
14+
public class MAGear {
1515

1616
//MARK: Instance properties
1717

@@ -37,7 +37,7 @@ internal class MAGear {
3737
///
3838
/// - parameter radius: of the gear
3939
/// - parameter nbTeeth: Number of teeth of the gear. Must be greater than 2.
40-
init (radius:CGFloat, nbTeeth:UInt) {
40+
public init (radius:CGFloat, nbTeeth:UInt) {
4141

4242
assert(nbTeeth > 2)
4343

Classes/MAGearRefreshControl.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import UIKit
1212

1313

1414
/// Protocol between the MAGearRefreshControl and its delegate (mostly UITableViewController).
15-
@objc protocol MAGearRefreshDelegate {
16-
15+
@objc public protocol MAGearRefreshDelegate {
16+
1717
/// Method called when the pull to refresh move was triggered.
1818
///
1919
/// - parameter view: The MAGearRefreshControl object.
@@ -33,12 +33,12 @@ import UIKit
3333
//MARK: - MAGearRefreshControl Class
3434

3535
/// This class is used to draw an animated group of gears and offers the same interactions as an UIRefreshControl
36-
class MAGearRefreshControl: MAAnimatedMultiGearView {
36+
public class MAGearRefreshControl: MAAnimatedMultiGearView {
3737

3838
//MARK: Instance properties
3939

4040
/// Enum representing the different state of the refresh control
41-
enum MAGearRefreshState: UInt8 {
41+
public enum MAGearRefreshState: UInt8 {
4242
case normal // The user is pulling but hasn't reach the activation threshold yet
4343
case pulling // The user is still pulling and has passed the activation threshold
4444
case loading // The refresh control is animating
@@ -48,7 +48,7 @@ class MAGearRefreshControl: MAAnimatedMultiGearView {
4848
fileprivate var state = MAGearRefreshState.normal
4949

5050
/// Delegate conforming to the MAGearRefreshDelegate protocol. Most of time it's an UITableViewController
51-
var delegate:MAGearRefreshDelegate?
51+
public var delegate:MAGearRefreshDelegate?
5252

5353
/// Content offset of the tableview
5454
fileprivate var contentOffset:CGFloat = 0
@@ -96,7 +96,7 @@ class MAGearRefreshControl: MAAnimatedMultiGearView {
9696
/// Method to call when the scrollview was scrolled.
9797
///
9898
/// - parameter scrollView: The scrollview.
99-
func MAGearRefreshScrollViewDidScroll(_ scrollView:UIScrollView) {
99+
public func MAGearRefreshScrollViewDidScroll(_ scrollView:UIScrollView) {
100100

101101
configureWithContentOffsetY(-scrollView.contentOffset.y)
102102

@@ -137,7 +137,7 @@ class MAGearRefreshControl: MAAnimatedMultiGearView {
137137
/// Method to call when the scrollview ended dragging
138138
///
139139
/// - parameter scrollView: The scrollview.
140-
func MAGearRefreshScrollViewDidEndDragging(_ scrollView:UIScrollView) {
140+
public func MAGearRefreshScrollViewDidEndDragging(_ scrollView:UIScrollView) {
141141

142142
NSLog("MAGearRefreshScrollViewDidEndDragging")
143143
/*if state == .Loading {
@@ -186,7 +186,7 @@ class MAGearRefreshControl: MAAnimatedMultiGearView {
186186
/// Method to call when the datasource finished loading
187187
///
188188
/// - parameter scrollView: The scrollview.
189-
func MAGearRefreshScrollViewDataSourceDidFinishedLoading(_ scrollView:UIScrollView) {
189+
public func MAGearRefreshScrollViewDataSourceDidFinishedLoading(_ scrollView:UIScrollView) {
190190

191191
NSLog("MAGearRefreshScrollViewDataSourceDidFinishedLoading")
192192

@@ -279,12 +279,12 @@ class MAGearRefreshControl: MAAnimatedMultiGearView {
279279
//MARK: Public methods override
280280

281281
/// Override of startRotating in order to disable this portion of code (must be triggered from the tableview)
282-
override func startRotating() {
282+
override public func startRotating() {
283283

284284
}
285285

286286
/// Override of stopRotating in order to disable this portion of code (must be triggered from delegate)
287-
override func stopRotating()
287+
override public func stopRotating()
288288
{
289289
}
290290
}

Classes/MAMultiGearView.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import UIKit
1111
//MARK: - MAMultiGearView Class
1212

1313
/// This class is used to draw multiples gears in a UIView.
14-
class MAMultiGearView : UIView {
14+
public class MAMultiGearView : UIView {
1515

1616
//MARK: Instance properties
1717

@@ -61,7 +61,7 @@ class MAMultiGearView : UIView {
6161
//MARK: Init methods
6262

6363
/// Default initializer
64-
override init(frame: CGRect) {
64+
override public init(frame: CGRect) {
6565
super.init(frame: frame)
6666

6767
clipsToBounds = true
@@ -78,7 +78,7 @@ class MAMultiGearView : UIView {
7878
}
7979

8080
/// Required initializer
81-
required init(coder aDecoder: NSCoder) {
81+
required public init(coder aDecoder: NSCoder) {
8282
fatalError("init(coder:) has not been implemented")
8383
}
8484

@@ -92,7 +92,7 @@ class MAMultiGearView : UIView {
9292
/// - parameter radius: Radius in pixel of the gear
9393
///
9494
/// - returns: true if the gear was succesfully created, false otherwise (if at least one gear exists).
95-
func addInitialGear(nbTeeth:UInt, color: UIColor, radius:CGFloat) -> Bool {
95+
public func addInitialGear(nbTeeth:UInt, color: UIColor, radius:CGFloat) -> Bool {
9696

9797
if arrayViews.count > 0 {
9898
return false
@@ -120,7 +120,7 @@ class MAMultiGearView : UIView {
120120
/// - parameter angleInDegree: Angle (in degree) between the gear to create and the previous gear, according to the unit circle.
121121
///
122122
/// - returns: true if the gear was succesfully created, false otherwise (if the gearLinked index is incorrect).
123-
func addLinkedGear(_ gearLinked: Int, nbTeeth:UInt, color:UIColor, angleInDegree:Double) -> Bool {
123+
public func addLinkedGear(_ gearLinked: Int, nbTeeth:UInt, color:UIColor, angleInDegree:Double) -> Bool {
124124

125125
if gearLinked >= arrayViews.count || gearLinked < 0 {
126126
return false
@@ -172,7 +172,7 @@ class MAMultiGearView : UIView {
172172
/// Set the phase for the first gear and calculate it for all the linked gears
173173
///
174174
/// - parameter phase: Phase between 0 and 1 for the first gear.
175-
func setMainGearPhase(_ phase:Double) {
175+
public func setMainGearPhase(_ phase:Double) {
176176
if arrayViews.count == 0 {
177177
return
178178
}
@@ -269,7 +269,7 @@ class MAMultiGearView : UIView {
269269

270270
//MARK: Override setFrame
271271

272-
override var frame:CGRect {
272+
override public var frame:CGRect {
273273
didSet {
274274
configureView()
275275
}

Classes/MASingleGearView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,28 @@ import UIKit
1212
//MARK: - MASingleGearView Class
1313

1414
/// This class is used to draw a gear in a UIView.
15-
class MASingleGearView : UIView {
15+
public class MASingleGearView : UIView {
1616

1717
//MARK: Instance properties
1818

1919
/// Gear linked to this view.
2020
internal var gear:MAGear!
2121

2222
/// Color of the gear.
23-
var gearColor = UIColor.black
23+
public var gearColor = UIColor.black
2424

2525
/// Phase of the gear. Varies between 0 and 1.
2626
/// A phase of 0 represents a gear with the rightmost tooth fully horizontal, while a phase of 0.5 represents a gear with a hole in the rightmost point.
2727
/// A phase of 1 thus is graphically equivalent to a phase of 0
28-
var phase:Double = 0
28+
public var phase:Double = 0
2929

3030
//MARK: Init methods
3131

3232
/// Custom init method
3333
///
3434
/// - parameter gear: Gear linked to this view
3535
/// - parameter gearColor: Color of the gear
36-
init(gear:MAGear, gearColor:UIColor) {
36+
public init(gear:MAGear, gearColor:UIColor) {
3737

3838
var width = Int(gear.outsideDiameter + 1)
3939
if width%2 == 1 {
@@ -48,14 +48,14 @@ class MASingleGearView : UIView {
4848
}
4949

5050
/// Required initializer
51-
required init(coder aDecoder: NSCoder) {
51+
required public init(coder aDecoder: NSCoder) {
5252
fatalError("init(coder:) has not been implemented")
5353
}
5454

5555
//MARK: Drawing methods
5656

5757
/// Override of drawing method
58-
override func draw(_ rect: CGRect) {
58+
override public func draw(_ rect: CGRect) {
5959
_ = CGColorSpaceCreateDeviceRGB()
6060
let currentContext = UIGraphicsGetCurrentContext()
6161
currentContext?.clear(rect)

MAGearRefreshControl.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "MAGearRefreshControl"
3-
s.version = "0.2"
3+
s.version = "0.3"
44
s.summary = "Refresh control with gear animation."
55

66
s.description = <<-DESC
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
1313
s.social_media_url = "https://twitter.com/micazeve"
1414
s.platforms = { :ios => "8.0" }
1515

16-
s.source = { :git => "https://github.com/micazeve/MAGearRefreshControl.git", :branch => "master", :tag => '0.2'}
16+
s.source = { :git => "https://github.com/micazeve/MAGearRefreshControl.git", :branch => "master", :tag => '0.3'}
1717
s.source_files = "Classes/**/*.swift"
1818

1919
s.ios.deployment_target = '8.0'

0 commit comments

Comments
 (0)