Skip to content

Commit b9f9c29

Browse files
committed
Updated avatar view appearance.
1 parent 63ebe9b commit b9f9c29

File tree

6 files changed

+39
-19
lines changed

6 files changed

+39
-19
lines changed

NativeUIKit.podspec

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

33
s.name = 'NativeUIKit'
4-
s.version = '1.3.7'
4+
s.version = '1.3.8'
55
s.summary = 'Mimicrated views and controls to native Apple appearance.'
66
s.homepage = 'https://github.com/ivanvorobei/NativeUIKit'
77
s.source = { :git => 'https://github.com/ivanvorobei/NativeUIKit.git', :tag => s.version }

Package.swift

+3-12
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,9 @@ let package = Package(
1515
)
1616
],
1717
dependencies: [
18-
.package(
19-
name: "SparrowKit",
20-
url: "https://github.com/ivanvorobei/SparrowKit", .upToNextMajor(from: "3.5.6")
21-
),
22-
.package(
23-
name: "SPPerspective",
24-
url: "https://github.com/ivanvorobei/SPPerspective", .upToNextMajor(from: "1.4.1")
25-
),
26-
.package(
27-
name: "SPDiffable",
28-
url: "https://github.com/ivanvorobei/SPDiffable", .upToNextMajor(from: "4.0.6")
29-
)
18+
.package(url: "https://github.com/ivanvorobei/SparrowKit", .upToNextMajor(from: "3.5.6")),
19+
.package(url: "https://github.com/ivanvorobei/SPPerspective", .upToNextMajor(from: "1.4.1")),
20+
.package(url: "https://github.com/ivanvorobei/SPDiffable", .upToNextMajor(from: "4.0.6"))
3021
],
3122
targets: [
3223
.target(

Sources/NativeUIKit/Views/NativeAvatarView.swift

+35-6
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,41 @@ open class NativeAvatarView: SPView {
8989
}
9090
}
9191

92-
open var placeholderImage = UIImage.system("person.crop.circle.fill", font: .systemFont(ofSize: 80, weight: .medium))
93-
open var placeholderColorise = SPDimmedButton.Colorise.init(content: .init(light: .systemGray3, dark: .systemGray2), background: .clear)
94-
open var indicatorAddImage = UIImage.system("plus", font: .preferredFont(forTextStyle: .title3, weight: .bold))
95-
open var indicatorAddColorise = SPDimmedButton.Colorise.init(content: .white, background: .systemGreen)
96-
open var indicatorEditImage = UIImage.system("pencil", font: .preferredFont(forTextStyle: .title3, weight: .bold))
97-
open var indicatorEditColorise = SPDimmedButton.Colorise.init(content: .white, background: .systemBlue)
92+
open var placeholderImage = UIImage.system("person.crop.circle.fill", font: .systemFont(ofSize: 80, weight: .medium)) {
93+
didSet {
94+
placeholderButton.setImage(placeholderImage)
95+
}
96+
}
97+
98+
open var placeholderColorise = SPDimmedButton.Colorise.init(content: .init(light: .systemGray3, dark: .systemGray2), background: .clear) {
99+
didSet {
100+
placeholderButton.applyDefaultAppearance(with: placeholderColorise)
101+
}
102+
}
103+
104+
open var indicatorAddImage = UIImage.system("plus", font: .preferredFont(forTextStyle: .title3, weight: .bold)) {
105+
didSet {
106+
updateEditAppearance()
107+
}
108+
}
109+
110+
open var indicatorAddColorise = SPDimmedButton.Colorise.init(content: .white, background: .systemGreen) {
111+
didSet {
112+
updateEditAppearance()
113+
}
114+
}
115+
116+
open var indicatorEditImage = UIImage.system("pencil", font: .preferredFont(forTextStyle: .title3, weight: .bold)) {
117+
didSet {
118+
updateEditAppearance()
119+
}
120+
}
121+
122+
open var indicatorEditColorise = SPDimmedButton.Colorise.init(content: .white, background: .systemBlue) {
123+
didSet {
124+
updateEditAppearance()
125+
}
126+
}
98127

99128
// MARK: - Init
100129

0 commit comments

Comments
 (0)