Skip to content

Commit

Permalink
fix some issue
Browse files Browse the repository at this point in the history
Signed-off-by: NguyenPhongVN <nguyenphong.mobile.engineer@gmail.com>
  • Loading branch information
NguyenPhongVN committed Aug 1, 2023
1 parent 0a2a7ac commit 481eac1
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 14 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<key>CombineRequest.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
<integer>7</integer>
</dict>
<key>CombineSocketIO.xcscheme_^#shared#^_</key>
<dict>
Expand All @@ -22,12 +22,12 @@
<key>CombineWebSocket.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>4</integer>
<integer>10</integer>
</dict>
<key>Networking-Package.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
<key>ReactiveSwift (Playground) 1.xcscheme</key>
<dict>
Expand Down Expand Up @@ -74,17 +74,17 @@
<key>ReactiveSwiftRequest.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>5</integer>
<integer>6</integer>
</dict>
<key>ReactiveSwiftSocketIO.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>6</integer>
<integer>2</integer>
</dict>
<key>ReactiveSwiftWebSocket.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>7</integer>
<integer>8</integer>
</dict>
<key>Rx (Playground) 1.xcscheme</key>
<dict>
Expand All @@ -110,17 +110,17 @@
<key>RxSwiftRequest.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>8</integer>
<integer>9</integer>
</dict>
<key>RxSwiftSocketIO.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>10</integer>
<integer>4</integer>
</dict>
<key>RxSwiftWebSocket.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>9</integer>
<integer>5</integer>
</dict>
</dict>
</dict>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "BF5393CB-3B24-4AF4-8BB9-4AF3E5C6190C"
type = "1"
version = "2.0">
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?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>SchemeUserState</key>
<dict>
<key>Examples.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>ReactiveSwift (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>15</integer>
</dict>
<key>ReactiveSwift (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>16</integer>
</dict>
<key>ReactiveSwift (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>14</integer>
</dict>
<key>ReactiveSwift-UIExamples (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>18</integer>
</dict>
<key>ReactiveSwift-UIExamples (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>19</integer>
</dict>
<key>ReactiveSwift-UIExamples (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>17</integer>
</dict>
<key>Rx (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>12</integer>
</dict>
<key>Rx (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>13</integer>
</dict>
<key>Rx (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>11</integer>
</dict>
</dict>
</dict>
</plist>
23 changes: 22 additions & 1 deletion Examples/Examples/ExamplesApp.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
import SwiftUI
import MCombineRequest
import Transform

@main
struct ExamplesApp: App {
var body: some Scene {
WindowGroup {
ContentView()
Text("RT")
.task {
Task {
let data = try await MRequest {
RUrl(urlString: "http://127.0.0.1:8080")
.withPath("todos")
Rbody(Todo(id: UUID(), text: "_text", isCompleted: false).toData())
RMethod(.post)
REncoding(JSONEncoding.default)
}
.printCURLRequest()
.data
}
}
}
}
}

private struct Todo: Codable, Hashable, Identifiable {
var id: UUID
var text: String
var isCompleted: Bool
}
5 changes: 1 addition & 4 deletions Sources/BuildRequest/Core/RequestProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ extension RequestProtocol {
var items: [RequestProtocol] = []
items.append(contentsOf: requests.filter({$0 is RUrl}))
items.append(contentsOf: requests.filter({$0 is RPath}))
items.append(contentsOf: requests.filter({$0 is Rbody}))
items.append(contentsOf: requests.filter({$0 is RMethod}))
items.append(contentsOf: requests.filter({$0 is RHeaders}))
items.append(contentsOf: requests.filter({$0 is RQueryItem || $0 is RQueryItems}))
items.append(contentsOf: requests.filter({!($0 is RUrl || $0 is REncoding || $0 is RPath)}))
items.append(contentsOf: requests.filter({$0 is REncoding}))
/// build
items.forEach {
Expand Down

0 comments on commit 481eac1

Please sign in to comment.