-
Notifications
You must be signed in to change notification settings - Fork 0
/
0ECAFA9B-29AE-40CF-A133-9BC6CCE3A261.codesnippet
67 lines (59 loc) · 2.04 KB
/
0ECAFA9B-29AE-40CF-A133-9BC6CCE3A261.codesnippet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDECodeSnippetCompletionPrefix</key>
<string>TTQuickCollectionViewListVC</string>
<key>IDECodeSnippetCompletionScopes</key>
<array>
<string>All</string>
</array>
<key>IDECodeSnippetContents</key>
<string>class 替换符VC: TTViewController {
let mainList = TTSingleCellTypeCollectionView<替换符ListCell> { config in
let cellWidth = (CGFloat.screenWidth - 5) / 2
let cellHeight = cellWidth * 16.0 / 9.0
config.itemSize = .init(width: cellWidth, height: cellHeight)
config.horizotalSpacing = 5
config.verticalSpacing = 5
}
override func setupUI() {
super.setupUI()
addSubView(mainList)
// test
mainList.snp.makeConstraints { (make) in
make.edges.equalToSuperview()
}
}
}
class 替换符ListCell: TTVersatileCollectionViewCell {
override func setupUI() {
super.setupUI()
addSubviews([titleLabel])
titleLabel.snp.makeConstraints { (make) in
make.edges.equalToSuperview()
}
}
override func bindViewModel(_ viewModel: TTCollectionViewCellViewModel) {
super.bindViewModel(viewModel)
if let viewModel = viewModel as? 替换符ListCellViewModel {
viewModel.titleRelay.bind(to: titleLabel.rx.text).disposed(by: cellDisposeBag)
}
}
}
class 替换符ListCellViewModel: TTVersatileTableViewCellViewModel {
}</string>
<key>IDECodeSnippetIdentifier</key>
<string>0ECAFA9B-29AE-40CF-A133-9BC6CCE3A261</string>
<key>IDECodeSnippetLanguage</key>
<string>Xcode.SourceCodeLanguage.Swift</string>
<key>IDECodeSnippetSummary</key>
<string>TTQuickCollectionViewListVC</string>
<key>IDECodeSnippetTitle</key>
<string>TTQuickCollectionViewListVC</string>
<key>IDECodeSnippetUserSnippet</key>
<true/>
<key>IDECodeSnippetVersion</key>
<integer>2</integer>
</dict>
</plist>