File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed
Sources/NativeUIKit/Views Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 1
1
Pod ::Spec . new do |s |
2
2
3
3
s . name = 'NativeUIKit'
4
- s . version = '1.3.8 '
4
+ s . version = '1.3.9 '
5
5
s . summary = 'Mimicrated views and controls to native Apple appearance.'
6
6
s . homepage = 'https://github.com/ivanvorobei/NativeUIKit'
7
7
s . source = { :git => 'https://github.com/ivanvorobei/NativeUIKit.git' , :tag => s . version }
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ open class NativeAvatarView: SPView {
89
89
}
90
90
}
91
91
92
- open var placeholderImage = UIImage . system ( " person.crop.circle.fill " , font : . systemFont ( ofSize : 80 , weight : . medium) ) {
92
+ open var placeholderImage = generatePlaceholderImage ( fontSize : 80 , fontWeight : . medium) {
93
93
didSet {
94
94
placeholderButton. setImage ( placeholderImage)
95
95
}
@@ -164,10 +164,23 @@ open class NativeAvatarView: SPView {
164
164
placeholderButton. sizeToFit ( )
165
165
frame. setWidth ( placeholderButton. frame. width + layoutMargins. left + layoutMargins. right)
166
166
layoutSubviews ( )
167
- return . init(
168
- width: max ( placeholderButton. frame. maxX, indicatorButton. frame. maxX) + layoutMargins. bottom,
169
- height: max ( placeholderButton. frame. maxY, indicatorButton. frame. maxY) + layoutMargins. bottom
170
- )
167
+ if isEditable {
168
+ return . init(
169
+ width: max ( placeholderButton. frame. maxX, indicatorButton. frame. maxX) + layoutMargins. bottom,
170
+ height: max ( placeholderButton. frame. maxY, indicatorButton. frame. maxY) + layoutMargins. bottom
171
+ )
172
+ } else {
173
+ return . init(
174
+ width: placeholderButton. frame. maxX + layoutMargins. bottom,
175
+ height: placeholderButton. frame. maxY + layoutMargins. bottom
176
+ )
177
+ }
178
+ }
179
+
180
+ // MARK: - Public
181
+
182
+ static public func generatePlaceholderImage( fontSize: CGFloat , fontWeight: UIFont . Weight ) -> UIImage {
183
+ return UIImage . system ( " person.crop.circle.fill " , font: . systemFont( ofSize: fontSize, weight: fontWeight) )
171
184
}
172
185
173
186
// MARK: - Internal
You can’t perform that action at this time.
0 commit comments