Skip to content

Commit 509e162

Browse files
committed
Change access modifier
1 parent 461f9ca commit 509e162

File tree

10 files changed

+186
-185
lines changed

10 files changed

+186
-185
lines changed

Diff for: Example/BadgeHub.xcodeproj/project.pbxproj

+1-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4545
607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; };
4646
6BA978FDD0134429CACE8071 /* Pods-BadgeHub_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BadgeHub_Example.debug.xcconfig"; path = "Target Support Files/Pods-BadgeHub_Example/Pods-BadgeHub_Example.debug.xcconfig"; sourceTree = "<group>"; };
47-
8C6093D0F2D2C1CC2CAC3CF8 /* BadgeHub.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = BadgeHub.podspec; path = ../BadgeHub.podspec; sourceTree = "<group>"; };
47+
8C6093D0F2D2C1CC2CAC3CF8 /* BadgeHub.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = BadgeHub.podspec; path = ../BadgeHub.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
4848
989B2D641A9A7D73E7AD6F13 /* Pods-BadgeHub_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BadgeHub_Tests.release.xcconfig"; path = "Target Support Files/Pods-BadgeHub_Tests/Pods-BadgeHub_Tests.release.xcconfig"; sourceTree = "<group>"; };
4949
B4B146157EB2EAC3AB61F5D9 /* Pods-BadgeHub_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BadgeHub_Example.release.xcconfig"; path = "Target Support Files/Pods-BadgeHub_Example/Pods-BadgeHub_Example.release.xcconfig"; sourceTree = "<group>"; };
5050
C2E79FE58B30BFE220846F82 /* Pods_BadgeHub_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_BadgeHub_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -321,15 +321,11 @@
321321
buildActionMask = 2147483647;
322322
files = (
323323
);
324-
inputFileListPaths = (
325-
);
326324
inputPaths = (
327325
"${PODS_ROOT}/Target Support Files/Pods-BadgeHub_Example/Pods-BadgeHub_Example-frameworks.sh",
328326
"${BUILT_PRODUCTS_DIR}/BadgeHub/BadgeHub.framework",
329327
);
330328
name = "[CP] Embed Pods Frameworks";
331-
outputFileListPaths = (
332-
);
333329
outputPaths = (
334330
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BadgeHub.framework",
335331
);

Diff for: Example/BadgeHub/BadgeHub.swift

+22-24
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class BadgeHub: NSObject {
6060
private var isIndeterminateMode = false
6161

6262
// MARK: - SETUP
63-
init(view: UIView) {
63+
public init(view: UIView) {
6464
super.init()
6565

6666
maxCount = 100000
@@ -76,7 +76,7 @@ public class BadgeHub: NSObject {
7676
// }
7777

7878
// Adjustment methods
79-
func setView(_ view: UIView?, andCount startCount: Int) {
79+
public func setView(_ view: UIView?, andCount startCount: Int) {
8080
curOrderMagnitude = 0
8181

8282
let frame: CGRect? = view?.frame
@@ -106,7 +106,7 @@ public class BadgeHub: NSObject {
106106
}
107107

108108
// Set the frame of the notification circle relative to the button
109-
func setCircleAtFrame(_ frame: CGRect) {
109+
public func setCircleAtFrame(_ frame: CGRect) {
110110
redCircle.frame = frame
111111
initialCenter = CGPoint(x: frame.origin.x + frame.size.width / 2, y: frame.origin.y + frame.size.height / 2)
112112
baseFrame = frame
@@ -118,29 +118,28 @@ public class BadgeHub: NSObject {
118118
}
119119

120120
// Change the color of the notification circle
121-
func setCircleColor(_ circleColor: UIColor?, label labelColor: UIColor?) {
121+
public func setCircleColor(_ circleColor: UIColor?, label labelColor: UIColor?) {
122122
redCircle.isUserChangingBackgroundColor = true
123123
redCircle.backgroundColor = circleColor
124124
if let labelColor = labelColor {
125125
countLabel?.textColor = labelColor
126126
}
127127
}
128128

129-
func setCircleBorderColor(_ color: UIColor?, borderWidth width: CGFloat) {
129+
public func setCircleBorderColor(_ color: UIColor?, borderWidth width: CGFloat) {
130130
redCircle.layer.borderColor = color?.cgColor
131131
redCircle.layer.borderWidth = width
132132
}
133133

134-
135-
func moveCircleBy(x: CGFloat, y: CGFloat) {
134+
public func moveCircleBy(x: CGFloat, y: CGFloat) {
136135
var frame: CGRect = redCircle.frame
137136
frame.origin.x += x
138137
frame.origin.y += y
139138
self.setCircleAtFrame(frame)
140139
}
141140

142141
// Changes the size of the circle. setting a scale of 1 has no effect
143-
func scaleCircleSize(by scale: CGFloat) {
142+
public func scaleCircleSize(by scale: CGFloat) {
144143
let fr: CGRect = initialFrame
145144
let width: CGFloat = fr.size.width * scale
146145
let height: CGFloat = fr.size.height * scale
@@ -152,41 +151,41 @@ public class BadgeHub: NSObject {
152151
}
153152

154153
// Increases count by 1
155-
func increment() {
154+
public func increment() {
156155
increment(by: 1)
157156
}
158157

159158
// Increases count by amount
160-
func increment(by amount: Int) {
159+
public func increment(by amount: Int) {
161160
count += amount
162161
}
163162

164163
// Decreases count
165-
func decrement() {
164+
public func decrement() {
166165
decrement(by: 1)
167166
}
168167

169168
// Decreases count by amount
170-
func decrement(by amount: Int) {
169+
public func decrement(by amount: Int) {
171170
if amount >= count {
172171
count = 0
173172
return
174173
}
175174
count -= amount
176175
}
177176

178-
func hideCount() {
177+
public func hideCount() {
179178
countLabel?.isHidden = true
180179
isIndeterminateMode = true
181180
}
182181

183-
func showCount() {
182+
public func showCount() {
184183
isIndeterminateMode = false
185184
checkZero()
186185
}
187186

188187
// Animations
189-
func pop() {
188+
public func pop() {
190189
let height = baseFrame.size.height
191190
let width = baseFrame.size.width
192191
let popStartHeight: Float = Float(height * popStartRatio)
@@ -273,7 +272,7 @@ public class BadgeHub: NSObject {
273272
}
274273
}
275274

276-
func blink() {
275+
public func blink() {
277276
self.setAlpha(alpha: Float(blinkAlpha))
278277

279278
UIView.animate(withDuration: TimeInterval(blinkDuration), animations: {
@@ -290,7 +289,7 @@ public class BadgeHub: NSObject {
290289
}
291290

292291
// Animation that jumps similar to OSX dock icons
293-
func bump() {
292+
public func bump() {
294293
if !initialCenter.equalTo(redCircle.center) {
295294
// canel previous animation
296295
}
@@ -313,9 +312,8 @@ public class BadgeHub: NSObject {
313312
}
314313
}
315314

316-
317315
// Set the count yourself
318-
func setCount(_ newCount: Int) {
316+
public func setCount(_ newCount: Int) {
319317
count = newCount
320318

321319
var labelText = "\(NSNumber(value: count))"
@@ -330,28 +328,28 @@ public class BadgeHub: NSObject {
330328
}
331329

332330
// Set the font of the label
333-
func setCountLabel(_ font: UIFont?) {
331+
public func setCountLabel(_ font: UIFont?) {
334332
countLabel?.font = font
335333
}
336334

337-
func countLabelFont() -> UIFont? {
335+
public func countLabelFont() -> UIFont? {
338336
return countLabel?.font
339337
}
340338

341339

342-
func bumpCenterY(yVal: Float) {
340+
public func bumpCenterY(yVal: Float) {
343341
var center: CGPoint = redCircle.center
344342
center.y = initialCenter.y - CGFloat(yVal)
345343
redCircle.center = center
346344
countLabel?.center = center
347345
}
348346

349-
func setAlpha(alpha: Float) {
347+
public func setAlpha(alpha: Float) {
350348
redCircle.alpha = CGFloat(alpha)
351349
countLabel?.alpha = CGFloat(alpha)
352350
}
353351

354-
func checkZero() {
352+
public func checkZero() {
355353
if count <= 0 {
356354
redCircle.isHidden = true
357355
countLabel?.isHidden = true

Diff for: Example/Podfile.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- BadgeHub (0.1.0)
2+
- BadgeHub (0.1.1)
33

44
DEPENDENCIES:
55
- BadgeHub (from `../`)
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
99
:path: "../"
1010

1111
SPEC CHECKSUMS:
12-
BadgeHub: b513b8526ec71d5baddfacfc763f967d8ed8ff45
12+
BadgeHub: 8632dc9ab9cfb1bee903ebd40f9de77d29323dc7
1313

1414
PODFILE CHECKSUM: c0e9ea82a511c7b3c636576ece9097ef9cc2e1ab
1515

16-
COCOAPODS: 1.6.1
16+
COCOAPODS: 1.7.1

Diff for: Example/Pods/Local Podspecs/BadgeHub.podspec.json

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Example/Pods/Manifest.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)