Skip to content

Commit 6b83a95

Browse files
committed
feat: drop Swift 5.10
1 parent 8f78fe0 commit 6b83a95

21 files changed

+79
-129
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ body:
4040
attributes:
4141
label: Swift Version
4242
description: What version of Swift are you using?
43-
placeholder: ex. 5.10
43+
placeholder: ex. 6.0
4444
validations:
4545
required: true
4646

Examples/Examples/Profile/UserIdentityList.swift

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -237,30 +237,28 @@ struct UserIdentityList: View {
237237
}
238238
.id(id)
239239
.navigationTitle("Linked Identities")
240-
#if swift(>=5.10)
241-
.toolbar {
242-
ToolbarItem(placement: .primaryAction) {
243-
if !providers.isEmpty {
244-
Menu {
245-
ForEach(providers) { provider in
246-
Button {
247-
Task {
248-
await linkProvider(provider)
249-
}
250-
} label: {
251-
Label(
252-
provider.rawValue.capitalized,
253-
systemImage: iconForProvider(provider.rawValue)
254-
)
240+
.toolbar {
241+
ToolbarItem(placement: .primaryAction) {
242+
if !providers.isEmpty {
243+
Menu {
244+
ForEach(providers) { provider in
245+
Button {
246+
Task {
247+
await linkProvider(provider)
255248
}
249+
} label: {
250+
Label(
251+
provider.rawValue.capitalized,
252+
systemImage: iconForProvider(provider.rawValue)
253+
)
256254
}
257-
} label: {
258-
Label("Link Account", systemImage: "plus")
259255
}
256+
} label: {
257+
Label("Link Account", systemImage: "plus")
260258
}
261259
}
262260
}
263-
#endif
261+
}
264262
}
265263

266264
private func iconForProvider(_ provider: String) -> String {

Examples/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.7
1+
// swift-tools-version:6.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import Foundation

Examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Features:
171171

172172
## Prerequisites
173173

174-
- Xcode 15.0 or later
174+
- Xcode 16.0 or later
175175
- iOS 17.0+ / macOS 14.0+ or later
176176
- [Supabase CLI](https://supabase.com/docs/guides/cli) installed
177177

Package.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.10
1+
// swift-tools-version:6.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import Foundation
@@ -204,7 +204,8 @@ let package = Package(
204204
"Mocker",
205205
]
206206
),
207-
]
207+
],
208+
swiftLanguageModes: [.v6]
208209
)
209210

210211
for target in package.targets where !target.isTest {

[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ let package = Package(
204204
]
205205
),
206206
],
207-
swiftLanguageModes: [.v5]
207+
swiftLanguageModes: [.v6]
208208
)
209209

210210
for target in package.targets where !target.isTest {

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Supabase SDK for Swift. Mirrors the design of [supabase-js](https://github.com/s
1111

1212
### Requirements
1313
- iOS 16.0+ / macOS 13+ / tvOS 16+ / watchOS 9+ / visionOS 1+
14-
- Xcode 15.3+
15-
- Swift 5.10+
14+
- Xcode 16.0+
15+
- Swift 6.0+
1616

1717
> [!IMPORTANT]
1818
> Check the [Support Policy](#support-policy) to learn when dropping Xcode, Swift, and platform versions will not be considered a **breaking change**.

Sources/Auth/AuthClient.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private actor GlobalJWKSCache {
6060
private let globalJWKSCache = GlobalJWKSCache()
6161

6262
public actor AuthClient {
63-
static var globalClientID = 0
63+
static let globalClientID = LockIsolated(0)
6464
nonisolated let clientID: AuthClientID
6565

6666
nonisolated private var api: APIClient { Dependencies[clientID].api }
@@ -122,8 +122,7 @@ public actor AuthClient {
122122
/// - Parameters:
123123
/// - configuration: The client configuration.
124124
public init(configuration: Configuration) {
125-
AuthClient.globalClientID += 1
126-
clientID = AuthClient.globalClientID
125+
clientID = AuthClient.globalClientID.withValue { $0 += 1; return $0 }
127126

128127
Dependencies[clientID] = Dependencies(
129128
configuration: configuration,

Sources/Storage/Helpers.swift

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,21 @@ import Foundation
1717
import UniformTypeIdentifiers
1818

1919
func mimeType(forPathExtension pathExtension: String) -> String {
20-
#if swift(>=5.9)
21-
if #available(iOS 14, macOS 11, tvOS 14, watchOS 7, visionOS 1, *) {
22-
return UTType(filenameExtension: pathExtension)?.preferredMIMEType
23-
?? "application/octet-stream"
24-
} else {
25-
if let id = UTTypeCreatePreferredIdentifierForTag(
26-
kUTTagClassFilenameExtension, pathExtension as CFString, nil
27-
)?.takeRetainedValue(),
28-
let contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?
29-
.takeRetainedValue()
30-
{
31-
return contentType as String
32-
}
33-
34-
return "application/octet-stream"
20+
if #available(iOS 14, macOS 11, tvOS 14, watchOS 7, visionOS 1, *) {
21+
return UTType(filenameExtension: pathExtension)?.preferredMIMEType
22+
?? "application/octet-stream"
23+
} else {
24+
if let id = UTTypeCreatePreferredIdentifierForTag(
25+
kUTTagClassFilenameExtension, pathExtension as CFString, nil
26+
)?.takeRetainedValue(),
27+
let contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?
28+
.takeRetainedValue()
29+
{
30+
return contentType as String
3531
}
36-
#else
37-
if #available(iOS 14, macOS 11, tvOS 14, watchOS 7, *) {
38-
return UTType(filenameExtension: pathExtension)?.preferredMIMEType
39-
?? "application/octet-stream"
40-
} else {
41-
if let id = UTTypeCreatePreferredIdentifierForTag(
42-
kUTTagClassFilenameExtension, pathExtension as CFString, nil
43-
)?.takeRetainedValue(),
44-
let contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?
45-
.takeRetainedValue()
46-
{
47-
return contentType as String
48-
}
4932

50-
return "application/octet-stream"
51-
}
52-
#endif
33+
return "application/octet-stream"
34+
}
5335
}
5436
#else
5537

Sources/Storage/MultipartFormData.swift

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -569,39 +569,21 @@ class MultipartFormData {
569569
// MARK: - Private - Mime Type
570570

571571
static func mimeType(forPathExtension pathExtension: String) -> String {
572-
#if swift(>=5.9)
573-
if #available(iOS 14, macOS 11, tvOS 14, watchOS 7, visionOS 1, *) {
574-
return UTType(filenameExtension: pathExtension)?.preferredMIMEType
575-
?? "application/octet-stream"
576-
} else {
577-
if let id = UTTypeCreatePreferredIdentifierForTag(
578-
kUTTagClassFilenameExtension, pathExtension as CFString, nil
579-
)?.takeRetainedValue(),
580-
let contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?
581-
.takeRetainedValue()
582-
{
583-
return contentType as String
584-
}
585-
586-
return "application/octet-stream"
587-
}
588-
#else
589-
if #available(iOS 14, macOS 11, tvOS 14, watchOS 7, *) {
590-
return UTType(filenameExtension: pathExtension)?.preferredMIMEType
591-
?? "application/octet-stream"
592-
} else {
593-
if let id = UTTypeCreatePreferredIdentifierForTag(
594-
kUTTagClassFilenameExtension, pathExtension as CFString, nil
595-
)?.takeRetainedValue(),
596-
let contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?
597-
.takeRetainedValue()
598-
{
599-
return contentType as String
600-
}
601-
602-
return "application/octet-stream"
572+
if #available(iOS 14, macOS 11, tvOS 14, watchOS 7, visionOS 1, *) {
573+
return UTType(filenameExtension: pathExtension)?.preferredMIMEType
574+
?? "application/octet-stream"
575+
} else {
576+
if let id = UTTypeCreatePreferredIdentifierForTag(
577+
kUTTagClassFilenameExtension, pathExtension as CFString, nil
578+
)?.takeRetainedValue(),
579+
let contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?
580+
.takeRetainedValue()
581+
{
582+
return contentType as String
603583
}
604-
#endif
584+
585+
return "application/octet-stream"
586+
}
605587
}
606588
}
607589

0 commit comments

Comments
 (0)