-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Moya analysis to network section
- Loading branch information
1 parent
07256e4
commit 49f1e9b
Showing
6 changed files
with
121 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Moya | ||
|
||
let provider = ReactiveSwiftMoyaProvider<Printer>() | ||
|
||
provider.request(.disconnectPrinter) | ||
.filterSuccessfullStatusCodes() | ||
.startWithResult { result in | ||
/* zpracování odpovědi */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Moya | ||
|
||
provider.request(.authorize) | ||
.flatMap(.latest) { | ||
return provider.request(.movePrintHead(direction: .x)) | ||
} | ||
.flatMap(.latest) { | ||
return provider.request(.extrude) | ||
} | ||
.startWithResult { /* ... */} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Moya | ||
|
||
enum Printer: TargetType { | ||
case printFile(URL) | ||
case disconnectPrinter | ||
|
||
var baseURL = /* ... */ | ||
var path = /* ... */ | ||
var method = /* ... */ | ||
var parameters = /* ... */ | ||
var parametersEncoding = /* ... */ | ||
var sampleData = /* ... */ | ||
var task = /* ... */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters