@@ -9,21 +9,21 @@ import UIKit
9
9
10
10
public extension SKConfigurableView where Self: SKLoadViewProtocol {
11
11
12
- static func eraseToCollectionCell ( ) -> SKCEraseCell < Self > . Type {
13
- return SKCEraseCell < Self> . self
12
+ static func wrapperToCollectionCell ( ) -> SKCWrapperCell < Self > . Type {
13
+ return SKCWrapperCell < Self> . self
14
14
}
15
15
16
16
}
17
17
18
18
public extension SKConfigurableView where Self: SKLoadViewProtocol {
19
19
20
- static func eraseToCollectionReusableView ( ) -> SKCEraseReusableView < Self > . Type {
21
- return SKCEraseReusableView < Self> . self
20
+ static func wrapperToCollectionReusableView ( ) -> SKCWrapperReusableView < Self > . Type {
21
+ return SKCWrapperReusableView < Self> . self
22
22
}
23
23
24
24
}
25
25
26
- public class SKCEraseCell < View: SKConfigurableView & SKLoadViewProtocol > : UICollectionViewCell , SKConfigurableView , SKLoadViewProtocol {
26
+ public class SKCWrapperCell < View: SKConfigurableView & SKLoadViewProtocol > : UICollectionViewCell , SKConfigurableView , SKLoadViewProtocol {
27
27
28
28
public static func preferredSize( limit size: CGSize , model: View . Model ? ) -> CGSize {
29
29
View . preferredSize ( limit: size, model: model)
@@ -32,10 +32,10 @@ public class SKCEraseCell<View: SKConfigurableView & SKLoadViewProtocol>: UIColl
32
32
public typealias Model = View . Model
33
33
34
34
public func config( _ model: View . Model ) {
35
- eraseView . config ( model)
35
+ wrappedView . config ( model)
36
36
}
37
37
38
- public private( set) lazy var eraseView = View ( )
38
+ public private( set) lazy var wrappedView = View ( )
39
39
40
40
public override init ( frame: CGRect ) {
41
41
super. init ( frame: frame)
@@ -49,20 +49,20 @@ public class SKCEraseCell<View: SKConfigurableView & SKLoadViewProtocol>: UIColl
49
49
}
50
50
51
51
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
58
58
constraint. priority = . defaultHigh
59
59
constraint. isActive = true
60
60
}
61
61
}
62
62
63
63
}
64
64
65
- public class SKCEraseReusableView < View: SKConfigurableView & SKLoadViewProtocol > : UICollectionReusableView , SKConfigurableView , SKLoadViewProtocol {
65
+ public class SKCWrapperReusableView < View: SKConfigurableView & SKLoadViewProtocol > : UICollectionReusableView , SKConfigurableView , SKLoadViewProtocol {
66
66
67
67
public static func preferredSize( limit size: CGSize , model: View . Model ? ) -> CGSize {
68
68
View . preferredSize ( limit: size, model: model)
@@ -72,10 +72,10 @@ public class SKCEraseReusableView<View: SKConfigurableView & SKLoadViewProtocol>
72
72
73
73
74
74
public func config( _ model: View . Model ) {
75
- eraseView . config ( model)
75
+ wrappedView . config ( model)
76
76
}
77
77
78
- public private( set) lazy var eraseView = View ( )
78
+ public private( set) lazy var wrappedView = View ( )
79
79
80
80
public override init ( frame: CGRect ) {
81
81
super. init ( frame: frame)
@@ -89,12 +89,12 @@ public class SKCEraseReusableView<View: SKConfigurableView & SKLoadViewProtocol>
89
89
90
90
private func initialize( contentView: UIView ) {
91
91
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
98
98
constraint. priority = . defaultHigh
99
99
constraint. isActive = true
100
100
}
0 commit comments