Skip to content

Commit 6f50055

Browse files
committed
Added SPNavigationBarAppearance.
1 parent 2e3e155 commit 6f50055

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

Sources/SparrowKit/UIKit/Extensions/UINavigationBarExtension.swift

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import UIKit
2424

2525
public extension UINavigationBar {
26-
26+
2727
/**
2828
SparrowKit: Change font of title.
2929

@@ -56,7 +56,7 @@ public extension UINavigationBar {
5656
tintColor = textColor
5757
titleTextAttributes = [.foregroundColor: textColor]
5858
}
59-
59+
6060
/**
6161
SparrowKit: Make transparent of background of navigation.
6262
*/
@@ -82,16 +82,22 @@ public extension UINavigationBar {
8282
}
8383

8484
@available(iOS 13.0, *)
85-
func setAppearance(_ value: NavigationBarAppearance) {
85+
/**
86+
SparrowKit: Set appearance for navigation bar.
87+
*/
88+
func setAppearance(_ value: SPNavigationBarAppearance) {
8689
self.standardAppearance = value.standardAppearance
8790
self.scrollEdgeAppearance = value.scrollEdgeAppearance
8891
}
8992

9093
@available(iOS 13.0, *)
91-
enum NavigationBarAppearance {
94+
/**
95+
SparrowKit: Appearance cases.
96+
*/
97+
enum SPNavigationBarAppearance {
9298

9399
case transparentAlways
94-
case transparentStandardOpaqueScroll
100+
case transparentStandardOnly
95101
case opaqueAlways
96102

97103
var standardAppearance: UINavigationBarAppearance {
@@ -100,13 +106,13 @@ public extension UINavigationBar {
100106
let appearance = UINavigationBarAppearance()
101107
appearance.configureWithTransparentBackground()
102108
return appearance
103-
case .transparentStandardOpaqueScroll:
109+
case .transparentStandardOnly:
104110
let appearance = UINavigationBarAppearance()
105111
appearance.configureWithTransparentBackground()
106112
return appearance
107113
case .opaqueAlways:
108114
let appearance = UINavigationBarAppearance()
109-
appearance.configureWithOpaqueBackground()
115+
appearance.configureWithDefaultBackground()
110116
return appearance
111117
}
112118
}
@@ -117,13 +123,13 @@ public extension UINavigationBar {
117123
let appearance = UINavigationBarAppearance()
118124
appearance.configureWithTransparentBackground()
119125
return appearance
120-
case .transparentStandardOpaqueScroll:
126+
case .transparentStandardOnly:
121127
let appearance = UINavigationBarAppearance()
122-
appearance.configureWithTransparentBackground()
128+
appearance.configureWithDefaultBackground()
123129
return appearance
124130
case .opaqueAlways:
125131
let appearance = UINavigationBarAppearance()
126-
appearance.configureWithOpaqueBackground()
132+
appearance.configureWithDefaultBackground()
127133
return appearance
128134
}
129135
}

SparrowKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = 'SparrowKit'
4-
s.version = '3.3.2'
4+
s.version = '3.3.3'
55
s.summary = 'Collection of native Swift extensions to boost your development. Support tvOS and watchOS.'
66
s.homepage = 'https://github.com/ivanvorobei/SparrowKit'
77
s.source = { :git => 'https://github.com/ivanvorobei/SparrowKit.git', :tag => s.version }

0 commit comments

Comments
 (0)