Skip to content

Commit 4dd545e

Browse files
committed
Add Swift 6 Release Notes
1 parent 10a8bc3 commit 4dd545e

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed

README.md

+34-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ After adding the dependency both [ServiceStack.Swift](https://github.com/Service
4444
```swift
4545
dependencies: [
4646
.package(name: "ServiceStack", url: "https://github.com/ServiceStack/ServiceStack.Swift.git",
47-
Version(5,0,0)..<Version(6,0,0)),
47+
Version(6,0,0)..<Version(7,0,0)),
4848
],
4949
```
5050

@@ -56,13 +56,44 @@ In your [Podfile](https://guides.cocoapods.org/syntax/podfile.html):
5656
use_frameworks!
5757

5858
# Pods for Project
59-
pod "ServiceStack", '~> 5.0'
59+
pod "ServiceStack", '~> 6.0'
6060
```
6161

6262
#### Carthage
6363

6464
```ruby
65-
github "ServiceStack/ServiceStack.Swift" ~> 5.0
65+
github "ServiceStack/ServiceStack.Swift" ~> 6.0
66+
```
67+
68+
### v6.0.0 Release
69+
70+
The latest **v6** Release is now dependency-free, where its PromiseKit async APIs have been replaced to use
71+
[Swift's native Concurrency](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/concurrency/) support.
72+
73+
```swift
74+
import ServiceStack
75+
76+
let client = JsonServiceClient(baseUrl:baseUrl)
77+
```
78+
79+
#### Async
80+
81+
```swift
82+
let request = Hello()
83+
request.name = "World"
84+
85+
let response = try await client.postAsync(request)
86+
print(response.result!)
87+
```
88+
89+
#### Sync
90+
91+
```swift
92+
let request = Hello()
93+
request.name = "World"
94+
95+
let response = try client.post(request)
96+
print(response.result!)
6697
```
6798

6899
### v5.0.0 Release

Tests/ServiceStackTests/JsonServiceClientTests.swift

+16
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@ final class JsonServiceClientTests : @unchecked Sendable {
1616
client = JsonServiceClient(baseUrl: "https://test.servicestack.net")
1717
}
1818

19+
@Test func Can_GET_Hello() throws {
20+
let request = Hello()
21+
request.name = "World"
22+
23+
let response = try client.post(request)
24+
print(response.result!)
25+
}
26+
27+
@Test func Can_GET_Hello_async() async throws {
28+
let request = Hello()
29+
request.name = "World"
30+
31+
let response = try await client.postAsync(request)
32+
print(response.result!)
33+
}
34+
1935
@Test func Can_POST_Test_HelloAllTypes_async() async throws {
2036
let request = createHelloAllTypes()
2137

0 commit comments

Comments
 (0)