Skip to content

Commit f8060c4

Browse files
committed
chore: erase 统一为 Wrapper
1 parent f29205f commit f8060c4

File tree

4 files changed

+23
-34
lines changed

4 files changed

+23
-34
lines changed

Sources/SectionKit/CollectionSingleTypeSection/Entities/SKCSingleTypeSection.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,6 @@ public extension SKCSingleTypeSection {
713713

714714
func sendDeleteAction(_ type: CellActionType, view: Cell?, row: Int) {
715715
guard deletedModels[row] != nil || models.indices.contains(row) else {
716-
assertionFailure()
717716
return
718717
}
719718
let result = CellActionContext(section: self,

Sources/SectionUI/CollectionView/SectionCollectionView/SKCollectionViewController.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,5 @@ open class SKCollectionViewController: UIViewController {
7676
constraint.isActive = true
7777
}
7878

79-
override open func viewSafeAreaInsetsDidChange() {
80-
super.viewSafeAreaInsetsDidChange()
81-
guard sectionView.contentInset.bottom == 0 else {
82-
return
83-
}
84-
sectionView.contentInset = .init(top: sectionView.contentInset.top,
85-
left: sectionView.contentInset.left,
86-
bottom: view.safeAreaInsets.bottom,
87-
right: sectionView.contentInset.right)
88-
}
8979
}
9080
#endif

Sources/SectionUI/Sections/SKCEraseCell.swift renamed to Sources/SectionUI/Sections/SKCWrapperCell.swift

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ import UIKit
99

1010
public extension SKConfigurableView where Self: SKLoadViewProtocol {
1111

12-
static func eraseToCollectionCell() -> SKCEraseCell<Self>.Type {
13-
return SKCEraseCell<Self>.self
12+
static func wrapperToCollectionCell() -> SKCWrapperCell<Self>.Type {
13+
return SKCWrapperCell<Self>.self
1414
}
1515

1616
}
1717

1818
public extension SKConfigurableView where Self: SKLoadViewProtocol {
1919

20-
static func eraseToCollectionReusableView() -> SKCEraseReusableView<Self>.Type {
21-
return SKCEraseReusableView<Self>.self
20+
static func wrapperToCollectionReusableView() -> SKCWrapperReusableView<Self>.Type {
21+
return SKCWrapperReusableView<Self>.self
2222
}
2323

2424
}
2525

26-
public class SKCEraseCell<View: SKConfigurableView & SKLoadViewProtocol>: UICollectionViewCell, SKConfigurableView, SKLoadViewProtocol {
26+
public class SKCWrapperCell<View: SKConfigurableView & SKLoadViewProtocol>: UICollectionViewCell, SKConfigurableView, SKLoadViewProtocol {
2727

2828
public static func preferredSize(limit size: CGSize, model: View.Model?) -> CGSize {
2929
View.preferredSize(limit: size, model: model)
@@ -32,10 +32,10 @@ public class SKCEraseCell<View: SKConfigurableView & SKLoadViewProtocol>: UIColl
3232
public typealias Model = View.Model
3333

3434
public func config(_ model: View.Model) {
35-
eraseView.config(model)
35+
wrappedView.config(model)
3636
}
3737

38-
public private(set) lazy var eraseView = View()
38+
public private(set) lazy var wrappedView = View()
3939

4040
public override init(frame: CGRect) {
4141
super.init(frame: frame)
@@ -49,20 +49,20 @@ public class SKCEraseCell<View: SKConfigurableView & SKLoadViewProtocol>: UIColl
4949
}
5050

5151
private func initialize(contentView: UIView) {
52-
eraseView.translatesAutoresizingMaskIntoConstraints = false
53-
contentView.addSubview(eraseView)
54-
[eraseView.leftAnchor.constraint(equalTo: contentView.leftAnchor, constant: 0),
55-
eraseView.rightAnchor.constraint(equalTo: contentView.rightAnchor, constant: 0),
56-
eraseView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 0),
57-
eraseView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: 0)].forEach { constraint in
52+
wrappedView.translatesAutoresizingMaskIntoConstraints = false
53+
contentView.addSubview(wrappedView)
54+
[wrappedView.leftAnchor.constraint(equalTo: contentView.leftAnchor, constant: 0),
55+
wrappedView.rightAnchor.constraint(equalTo: contentView.rightAnchor, constant: 0),
56+
wrappedView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 0),
57+
wrappedView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: 0)].forEach { constraint in
5858
constraint.priority = .defaultHigh
5959
constraint.isActive = true
6060
}
6161
}
6262

6363
}
6464

65-
public class SKCEraseReusableView<View: SKConfigurableView & SKLoadViewProtocol>: UICollectionReusableView, SKConfigurableView, SKLoadViewProtocol {
65+
public class SKCWrapperReusableView<View: SKConfigurableView & SKLoadViewProtocol>: UICollectionReusableView, SKConfigurableView, SKLoadViewProtocol {
6666

6767
public static func preferredSize(limit size: CGSize, model: View.Model?) -> CGSize {
6868
View.preferredSize(limit: size, model: model)
@@ -72,10 +72,10 @@ public class SKCEraseReusableView<View: SKConfigurableView & SKLoadViewProtocol>
7272

7373

7474
public func config(_ model: View.Model) {
75-
eraseView.config(model)
75+
wrappedView.config(model)
7676
}
7777

78-
public private(set) lazy var eraseView = View()
78+
public private(set) lazy var wrappedView = View()
7979

8080
public override init(frame: CGRect) {
8181
super.init(frame: frame)
@@ -89,12 +89,12 @@ public class SKCEraseReusableView<View: SKConfigurableView & SKLoadViewProtocol>
8989

9090
private func initialize(contentView: UIView) {
9191
contentView.translatesAutoresizingMaskIntoConstraints = false
92-
eraseView.translatesAutoresizingMaskIntoConstraints = false
93-
contentView.addSubview(eraseView)
94-
[eraseView.leftAnchor.constraint(equalTo: contentView.leftAnchor, constant: 0),
95-
eraseView.rightAnchor.constraint(equalTo: contentView.rightAnchor, constant: 0),
96-
eraseView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 0),
97-
eraseView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: 0)].forEach { constraint in
92+
wrappedView.translatesAutoresizingMaskIntoConstraints = false
93+
contentView.addSubview(wrappedView)
94+
[wrappedView.leftAnchor.constraint(equalTo: contentView.leftAnchor, constant: 0),
95+
wrappedView.rightAnchor.constraint(equalTo: contentView.rightAnchor, constant: 0),
96+
wrappedView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 0),
97+
wrappedView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: 0)].forEach { constraint in
9898
constraint.priority = .defaultHigh
9999
constraint.isActive = true
100100
}

Sources/SectionUI/Sections/SKEraseView.swift renamed to Sources/SectionUI/Sections/SKWrapperView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import UIKit
99

10-
open class SKEraseView<Content: UIView>: UIView, SKLoadViewProtocol, SKConfigurableView {
10+
open class SKWrapperView<Content: UIView>: UIView, SKLoadViewProtocol, SKConfigurableView {
1111

1212
public struct Model {
1313
public let insets: UIEdgeInsets

0 commit comments

Comments
 (0)