-
Notifications
You must be signed in to change notification settings - Fork 0
/
6A99EC94-2F52-40D3-9F88-A07A06BC0ADC.codesnippet
76 lines (65 loc) · 2.4 KB
/
6A99EC94-2F52-40D3-9F88-A07A06BC0ADC.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
68
69
70
71
72
73
74
75
76
<?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>q_vm_input_out</string>
<key>IDECodeSnippetCompletionScopes</key>
<array>
<string>All</string>
<string>TopLevel</string>
</array>
<key>IDECodeSnippetContents</key>
<string>import RxSwift
import HandyJSON
protocol <#Name#>ViewModelInputs {
func getData()
func touchAction(_ action: ActionModel)
}
protocol <#Name#>ViewModelOutputs {
//var dataObs: Observable<<#Name#>Response?>{ get }
var touchActionModel: Observable<ActionModel> { get }
}
protocol <#Name#>ViewModelType {
var inputs: <#Name#>ViewModelInputs { get }
var outputs: <#Name#>ViewModelOutputs { get }
}
class <#Name#>ViewModel: <#Name#>ViewModelType,<#Name#>ViewModelInputs, <#Name#>ViewModelOutputs {
init() {
// dataObs = dataRelay.flatMap { id in
// NetworkService.rx_request(.appraisalGetOrderReport(id))
// .map { BaseResponse<GetOrderReportResponse>.deserialize(from: $0)?.data }
// .catchErrorJustReturn(nil)
// }.share()
touchActionModel = touchRelay
}
func getData(_ id: Int) {
dataRelay.on(.next(id))
}
func touchAction(_ action: ActionModel) {
touchRelay.on(.next(action))
}
fileprivate let dataRelay = PublishSubject<Int>()
fileprivate let touchRelay = PublishSubject<ActionModel>()
//let dataObs: Observable<<#Name#>Response?>
let touchActionModel: Observable<ActionModel>
var inputs: <#Name#>ViewModelInputs { return self }
var outputs: <#Name#>ViewModelOutputs { return self }
}
</string>
<key>IDECodeSnippetIdentifier</key>
<string>6A99EC94-2F52-40D3-9F88-A07A06BC0ADC</string>
<key>IDECodeSnippetLanguage</key>
<string>Xcode.SourceCodeLanguage.Swift</string>
<key>IDECodeSnippetPlatformFamily</key>
<string>iphoneos</string>
<key>IDECodeSnippetSummary</key>
<string>快速创建带input&output的VM</string>
<key>IDECodeSnippetTitle</key>
<string>q_vm_inout_put</string>
<key>IDECodeSnippetUserSnippet</key>
<true/>
<key>IDECodeSnippetVersion</key>
<integer>2</integer>
</dict>
</plist>