Skip to content

Commit e612128

Browse files
committed
Fixed diffable compability.
1 parent 8c4b4fd commit e612128

8 files changed

Lines changed: 13 additions & 13 deletions

Sources/NativeUIKit/Controllers/Scroll/NativeHeaderController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ open class NativeHeaderController: SPScrollController {
4444

4545
open override func viewDidLoad() {
4646
super.viewDidLoad()
47+
scrollView.contentInset.bottom = NativeLayout.Spaces.Scroll.bottom_inset_reach_end
4748
scrollView.addSubview(headerView)
4849
}
4950

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ open class NativeHeaderTableController: SPDiffableTableController {
5656
cachedHeaderHeight = headerContainerView.frame.height
5757
DispatchQueue.main.async { [weak self] in
5858
guard let self = self else { return }
59-
guard let snapshot = self.diffableDataSource?.snapshot() else { return }
60-
self.diffableDataSource?.apply(snapshot)
59+
self.diffableDataSource?.updateLayout(animated: true, completion: nil)
6160
}
6261
}
6362
}

Sources/NativeUIKit/Labels/NativeModalHeaderView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ open class NativeModalHeaderView: SPView {
3333

3434
public let iconImageView = SPImageView().do {
3535
$0.contentMode = .scaleAspectFit
36-
$0.tintColor = UIColor.tintColor
36+
$0.tintColor = UIColor.tint
3737
}
3838

3939
public let titleLabel = SPLabel().do {

Sources/NativeUIKit/Table/Button/NativeLeftButtonTableViewCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ open class NativeLeftButtonTableViewCell: SPTableViewCell {
4141

4242
open override func sizeThatFits(_ size: CGSize) -> CGSize {
4343
let superSize = super.sizeThatFits(size)
44-
return .init(width: superSize.width, height: superSize.height + 4)
44+
return .init(width: superSize.width, height: superSize.height + 6)
4545
}
4646
}
4747
#endif

Sources/NativeUIKit/Table/Button/SPDiffableTableCellProvider+Button.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import UIKit
2424
import SPDiffable
2525

2626
@available(iOS 13.0, *)
27-
extension SPDiffableTableCellProvider {
27+
extension SPDiffableTableDataSource.CellProvider {
2828

29-
public static var button: SPDiffableTableCellProvider {
30-
return SPDiffableTableCellProvider() { (tableView, indexPath, item) -> UITableViewCell? in
29+
public static var button: SPDiffableTableDataSource.CellProvider {
30+
return SPDiffableTableDataSource.CellProvider() { (tableView, indexPath, item) -> UITableViewCell? in
3131
guard let item = item as? NativeDiffableLeftButton else { return nil }
3232
let cell = tableView.dequeueReusableCell(withClass: NativeLeftButtonTableViewCell.self, for: indexPath)
3333
cell.textLabel?.text = item.text

Sources/NativeUIKit/Table/Empty/SPDiffableTableCellProvider+Empty.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import UIKit
2424
import SPDiffable
2525

2626
@available(iOS 13.0, *)
27-
extension SPDiffableTableCellProvider {
27+
extension SPDiffableTableDataSource.CellProvider {
2828

29-
public static var empty: SPDiffableTableCellProvider {
30-
return SPDiffableTableCellProvider() { (tableView, indexPath, item) -> UITableViewCell? in
29+
public static var empty: SPDiffableTableDataSource.CellProvider {
30+
return SPDiffableTableDataSource.CellProvider() { (tableView, indexPath, item) -> UITableViewCell? in
3131
guard let item = item as? NativeEmptyRowItem else { return nil }
3232
let cell = tableView.dequeueReusableCell(withClass: NativeEmptyTableViewCell.self, for: indexPath)
3333
cell.placeholderView.headerLabel.text = item.text

Sources/NativeUIKit/Table/LargeHeader/SPDiffableTableCellProvider+LargeHeader.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import UIKit
2424
import SPDiffable
2525

2626
@available(iOS 13.0, *)
27-
extension SPDiffableTableHeaderFooterProvider {
27+
extension SPDiffableTableDataSource.HeaderFooterProvider {
2828

29-
public static var largeHeader: SPDiffableTableHeaderFooterProvider {
30-
return SPDiffableTableHeaderFooterProvider() { (tableView, indexPath, item) -> UIView? in
29+
public static var largeHeader: SPDiffableTableDataSource.HeaderFooterProvider {
30+
return SPDiffableTableDataSource.HeaderFooterProvider() { (tableView, indexPath, item) -> UIView? in
3131
guard let header = item as? NativeLargeHeader else { return nil }
3232
let view = NativeLargeHeaderView()
3333
view.titleLabel.text = header.title

Sources/NativeUIKit/Table/LargeHeader/NativeLargeHeaderView.swift renamed to Sources/NativeUIKit/Views/NativeLargeHeaderView.swift

File renamed without changes.

0 commit comments

Comments
 (0)