Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions Examples/Examples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1510;
LastUpgradeCheck = 1510;
LastUpgradeCheck = 2600;
TargetAttributes = {
793895C52954ABFF0044F2B8 = {
CreatedOnToolsVersion = 14.1;
Expand Down Expand Up @@ -625,6 +625,7 @@
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = ELTTE7K8TT;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -654,6 +655,7 @@
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand Down Expand Up @@ -699,6 +701,7 @@
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = ELTTE7K8TT;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand All @@ -721,6 +724,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
SWIFT_OPTIMIZATION_LEVEL = "-O";
Expand All @@ -737,9 +741,11 @@
CODE_SIGN_ENTITLEMENTS = Examples/Examples.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"Examples/Preview Content\"";
DEVELOPMENT_TEAM = ELTTE7K8TT;
ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SELECTED_FILES = readonly;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Examples/Info.plist;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand All @@ -763,9 +769,11 @@
CODE_SIGN_ENTITLEMENTS = Examples/Examples.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"Examples/Preview Content\"";
DEVELOPMENT_TEAM = ELTTE7K8TT;
ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SELECTED_FILES = readonly;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Examples/Info.plist;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand All @@ -790,9 +798,11 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"SlackClone/Preview Content\"";
DEVELOPMENT_TEAM = ELTTE7K8TT;
ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SELECTED_FILES = readonly;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = SlackClone/Info.plist;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
Expand Down Expand Up @@ -830,9 +840,11 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"SlackClone/Preview Content\"";
DEVELOPMENT_TEAM = ELTTE7K8TT;
ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SELECTED_FILES = readonly;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = SlackClone/Info.plist;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
Expand Down Expand Up @@ -870,9 +882,11 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"UserManagement/Preview Content\"";
DEVELOPMENT_TEAM = ELTTE7K8TT;
ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SELECTED_FILES = readonly;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = UserManagement/Info.plist;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
Expand Down Expand Up @@ -910,9 +924,11 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"UserManagement/Preview Content\"";
DEVELOPMENT_TEAM = ELTTE7K8TT;
ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SELECTED_FILES = readonly;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = UserManagement/Info.plist;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
LastUpgradeVersion = "2600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1520"
LastUpgradeVersion = "2600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
LastUpgradeVersion = "2600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
6 changes: 0 additions & 6 deletions Examples/Examples/Examples.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
<array>
<string>Default</string>
</array>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>keychain-access-groups</key>
<array/>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion Examples/Examples/MFAFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct MFAEnrollView: View {
.task {
do {
error = nil
enrollResponse = try await supabase.auth.mfa.enroll(params: MFAEnrollParams())
enrollResponse = try await supabase.auth.mfa.enroll(params: .totp())
} catch {
self.error = error
}
Expand Down
8 changes: 4 additions & 4 deletions Examples/Examples/TodoListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct TodoListView: View {
do {
error = nil
todos = try await IdentifiedArrayOf(
uniqueElements: supabase.database.from("todos")
uniqueElements: supabase.from("todos")
.select()
.execute()
.value as [Todo]
Expand All @@ -105,7 +105,7 @@ struct TodoListView: View {
isComplete: updatedTodo.isComplete,
ownerID: auth.currentUserID
)
updatedTodo = try await supabase.database.from("todos")
updatedTodo = try await supabase.from("todos")
.update(updateRequest, returning: .representation)
.eq("id", value: updatedTodo.id)
.single()
Expand All @@ -129,9 +129,9 @@ struct TodoListView: View {

todos.remove(atOffsets: offset)

try await supabase.database.from("todos")
try await supabase.from("todos")
.delete()
.in("id", value: todosToDelete.map(\.id))
.in("id", values: todosToDelete.map(\.id))
.execute()
} catch {
self.error = error
Expand Down
7 changes: 6 additions & 1 deletion Examples/SlackClone/ChannelStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import Foundation
import Supabase

Check warning on line 9 in Examples/SlackClone/ChannelStore.swift

View workflow job for this annotation

GitHub Actions / Examples

add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'PostgREST'

@MainActor
@Observable
Expand All @@ -27,7 +27,12 @@
let insertions = channel.postgresChange(InsertAction.self, table: "channels")
let deletions = channel.postgresChange(DeleteAction.self, table: "channels")

await channel.subscribe()
do {
try await channel.subscribeWithError()
} catch {
print("Error subscribing to channel: \(error)")
return
}

Task {
for await insertion in insertions {
Expand All @@ -50,7 +55,7 @@
try await supabase
.from("channels")
.insert(channel)
.execute()

Check warning on line 58 in Examples/SlackClone/ChannelStore.swift

View workflow job for this annotation

GitHub Actions / Examples

non-sendable result type 'PostgrestResponse<Void>' cannot be sent from nonisolated context in call to instance method 'execute(options:)'; this is an error in the Swift 6 language mode
} catch {
dump(error)
toast = .init(status: .error, title: "Error", description: error.localizedDescription)
Expand All @@ -66,7 +71,7 @@
.from("channels")
.select()
.eq("id", value: id)
.execute()

Check warning on line 74 in Examples/SlackClone/ChannelStore.swift

View workflow job for this annotation

GitHub Actions / Examples

non-sendable result type 'PostgrestResponse<Channel>' cannot be sent from nonisolated context in call to instance method 'execute(options:)'; this is an error in the Swift 6 language mode
.value
channels.append(channel)
return channel
Expand All @@ -90,7 +95,7 @@

private func fetchChannels() async -> [Channel] {
do {
return try await supabase.from("channels").select().execute().value

Check warning on line 98 in Examples/SlackClone/ChannelStore.swift

View workflow job for this annotation

GitHub Actions / Examples

non-sendable result type 'PostgrestResponse<[Channel]>' cannot be sent from nonisolated context in call to instance method 'execute(options:)'; this is an error in the Swift 6 language mode
} catch {
dump(error)
toast = .init(status: .error, title: "Error", description: error.localizedDescription)
Expand Down
7 changes: 6 additions & 1 deletion Examples/SlackClone/MessageStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation
import IdentifiedCollections
import Supabase

Check warning on line 10 in Examples/SlackClone/MessageStore.swift

View workflow job for this annotation

GitHub Actions / Examples

add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'PostgREST'

struct Messages {
private(set) var sections: [Section]
Expand Down Expand Up @@ -109,7 +109,12 @@
let updates = channel.postgresChange(UpdateAction.self, table: "messages")
let deletions = channel.postgresChange(DeleteAction.self, table: "messages")

await channel.subscribe()
do {
try await channel.subscribeWithError()
} catch {
print("Error subscribing to channel: \(error)")
return
}

Task {
for await insertion in insertions {
Expand Down Expand Up @@ -181,7 +186,7 @@
.select("*,user:user_id(*),channel:channel_id(*)")
.eq("channel_id", value: channelId)
.order("inserted_at", ascending: true)
.execute()

Check warning on line 189 in Examples/SlackClone/MessageStore.swift

View workflow job for this annotation

GitHub Actions / Examples

non-sendable result type 'PostgrestResponse<[Message]>' cannot be sent from nonisolated context in call to instance method 'execute(options:)'; this is an error in the Swift 6 language mode
.value
}
}
Expand Down
9 changes: 1 addition & 8 deletions Examples/SlackClone/SlackClone.entitlements
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<?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>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
<dict/>
</plist>
7 changes: 6 additions & 1 deletion Examples/SlackClone/UserStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@

let presences = channel.presenceChange()

await channel.subscribe()
do {
try await channel.subscribeWithError()
} catch {
print("Error subscribing to channel: \(error)")
return
}

Task {
let statusChange = channel.statusChange
Expand Down Expand Up @@ -69,7 +74,7 @@
.select()
.eq("id", value: id)
.single()
.execute()

Check warning on line 77 in Examples/SlackClone/UserStore.swift

View workflow job for this annotation

GitHub Actions / Examples

non-sendable result type 'PostgrestResponse<User>' cannot be sent from nonisolated context in call to instance method 'execute(options:)'; this is an error in the Swift 6 language mode
.value
users[user.id] = user
return user
Expand Down
4 changes: 2 additions & 2 deletions Examples/UserManagement/ProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import PhotosUI
import Supabase

Check warning on line 9 in Examples/UserManagement/ProfileView.swift

View workflow job for this annotation

GitHub Actions / Examples

add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'PostgREST'
import SwiftUI

@MainActor
Expand Down Expand Up @@ -105,7 +105,7 @@
.select()
.eq("id", value: currentUser.id)
.single()
.execute()

Check warning on line 108 in Examples/UserManagement/ProfileView.swift

View workflow job for this annotation

GitHub Actions / Examples

non-sendable result type 'PostgrestResponse<Profile>' cannot be sent from nonisolated context in call to instance method 'execute(options:)'; this is an error in the Swift 6 language mode
.value

username = profile.username ?? ""
Expand Down Expand Up @@ -141,7 +141,7 @@
.from("profiles")
.update(updatedProfile)
.eq("id", value: currentUser.id)
.execute()

Check warning on line 144 in Examples/UserManagement/ProfileView.swift

View workflow job for this annotation

GitHub Actions / Examples

non-sendable result type 'PostgrestResponse<Void>' cannot be sent from nonisolated context in call to instance method 'execute(options:)'; this is an error in the Swift 6 language mode
} catch {
debugPrint(error)
}
Expand Down Expand Up @@ -172,8 +172,8 @@
try await supabase.storage
.from("avatars")
.upload(
path: filePath,
file: data,
filePath,
data: data,
options: FileOptions(contentType: "image/jpeg", upsert: true)
)

Expand Down
9 changes: 1 addition & 8 deletions Examples/UserManagement/UserManagement.entitlements
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<?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>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
<dict/>
</plist>
Loading
Loading