Skip to content

Commit 982cbaa

Browse files
committed
Updated to 1.2.1
1 parent 111193d commit 982cbaa

File tree

8 files changed

+23
-24
lines changed

8 files changed

+23
-24
lines changed

Example App/NativeUIKit.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,8 +776,8 @@
776776
isa = XCRemoteSwiftPackageReference;
777777
repositoryURL = "https://github.com/ivanvorobei/SparrowKit";
778778
requirement = {
779-
branch = main;
780-
kind = branch;
779+
kind = upToNextMajorVersion;
780+
minimumVersion = 3.4.6;
781781
};
782782
};
783783
/* End XCRemoteSwiftPackageReference section */

Example App/NativeUIKit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

NativeUIKit.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 = 'NativeUIKit'
4-
s.version = '1.1.9'
4+
s.version = '1.2.1'
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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ let package = Package(
1313
)
1414
],
1515
dependencies: [
16-
.package(name: "SparrowKit", url: "https://github.com/ivanvorobei/SparrowKit", .upToNextMajor(from: "3.3.6")),
17-
.package(name: "SPPerspective", url: "https://github.com/ivanvorobei/SPPerspective", .upToNextMajor(from: "1.4.0")),
18-
.package(name: "SPDiffable", url: "https://github.com/ivanvorobei/SPDiffable", .upToNextMajor(from: "2.0.0"))
16+
.package(name: "SparrowKit", url: "https://github.com/ivanvorobei/SparrowKit", .exact("3.4.8")),
17+
.package(name: "SPPerspective", url: "https://github.com/ivanvorobei/SPPerspective", .exact("1.4.1")),
18+
.package(name: "SPDiffable", url: "https://github.com/ivanvorobei/SPDiffable", .exactItem("2.2.0"))
1919
],
2020
targets: [
2121
.target(

Sources/NativeUIKit/Controllers/Table/Header/NativeHeaderTableController.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ open class NativeHeaderTableController: SPDiffableTableController {
3636
public init(style: UITableView.Style, headerView: UIView) {
3737
self.headerContainerView = HeaderContainerView(contentView: headerView)
3838
super.init(style: style)
39+
headerContainerView.setWidthAndFit(width: view.frame.width)
3940
tableView.tableHeaderView = headerContainerView
41+
4042
}
4143

4244
public required init?(coder: NSCoder) {
@@ -47,15 +49,13 @@ open class NativeHeaderTableController: SPDiffableTableController {
4749

4850
open override func viewDidLayoutSubviews() {
4951
super.viewDidLayoutSubviews()
50-
if let headerView = tableView.tableHeaderView as? HeaderContainerView {
51-
headerView.setWidthAndFit(width: view.frame.width)
52-
if cachedHeaderHeight != headerView.frame.height {
53-
cachedHeaderHeight = headerView.frame.height
54-
DispatchQueue.main.async { [weak self] in
55-
guard let self = self else { return }
56-
guard let snapshot = self.diffableDataSource?.snapshot() else { return }
57-
self.diffableDataSource?.apply(snapshot)
58-
}
52+
headerContainerView.setWidthAndFit(width: view.frame.width)
53+
if cachedHeaderHeight != headerContainerView.frame.height {
54+
cachedHeaderHeight = headerContainerView.frame.height
55+
DispatchQueue.main.async { [weak self] in
56+
guard let self = self else { return }
57+
guard let snapshot = self.diffableDataSource?.snapshot() else { return }
58+
self.diffableDataSource?.apply(snapshot)
5959
}
6060
}
6161
}

Sources/NativeUIKit/Controls/NativeSmallActionButton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ open class NativeSmallActionButton: SPDimmedButton {
7070

7171
open override func layoutSubviews() {
7272
super.layoutSubviews()
73-
roundCorners()
73+
roundMinimumSide()
7474
}
7575

7676
open override func sizeThatFits(_ size: CGSize) -> CGSize {

Sources/NativeUIKit/Views/NativeAvatarView.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,9 @@ open class NativeAvatarView: SPView {
119119
let avatarSideSize = min(placeholderButton.frame.width, placeholderButton.frame.height) * 0.93
120120
avatarButton.frame = .init(side: avatarSideSize)
121121
avatarButton.center = placeholderButton.center
122-
avatarButton.roundCorners()
123-
122+
avatarButton.roundMinimumSide()
124123
indicatorButton.sizeToFit()
125-
indicatorButton.roundCorners()
124+
indicatorButton.roundMinimumSide()
126125
let sqrt2 = CGFloat(sqrt(2))
127126
let indicatorCenter = ((avatarButton.frame.width * (sqrt2 + 1)) / (2 * sqrt2)) * 1.02
128127
indicatorButton.center = .init(x: indicatorCenter, y: indicatorCenter)

0 commit comments

Comments
 (0)