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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ jobs:
deriveddata-examples-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift', '**/Examples/**/*.swift') }}
restore-keys: |
deriveddata-examples-
- name: Select Xcode 16.3
run: sudo xcode-select -s /Applications/Xcode_16.3.app
- name: Select Xcode 26.0
run: sudo xcode-select -s /Applications/Xcode_26.0.app
- name: Set IgnoreFileSystemDeviceInodeChanges flag
run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
- name: Update mtime for incremental builds
Expand Down
34 changes: 25 additions & 9 deletions Examples/Examples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1510;
LastUpgradeCheck = 1510;
LastUpgradeCheck = 2600;
TargetAttributes = {
793895C52954ABFF0044F2B8 = {
CreatedOnToolsVersion = 14.1;
Expand Down Expand Up @@ -550,6 +550,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 @@ -579,11 +580,12 @@
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";
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand Down Expand Up @@ -624,6 +626,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 @@ -646,11 +649,12 @@
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";
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Release;
};
Expand All @@ -662,9 +666,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 @@ -688,9 +694,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 @@ -715,9 +723,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 @@ -755,9 +765,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 @@ -795,9 +807,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 @@ -835,9 +849,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
4 changes: 2 additions & 2 deletions Examples/Examples/Auth/AuthWithMagicLink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct AuthWithMagicLink: View {
actionState = .inFlight

actionState = await .result(
Result {
Result { @Sendable in
try await supabase.auth.signInWithOTP(
email: email,
redirectTo: Constants.redirectToURL
Expand All @@ -125,7 +125,7 @@ struct AuthWithMagicLink: View {

actionState = .inFlight
actionState = await .result(
Result {
Result { @Sendable in
try await supabase.auth.session(from: url)
}
)
Expand Down
2 changes: 1 addition & 1 deletion Examples/Examples/Auth/GoogleSignInSDKFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Guilherme Souza on 05/03/24.
//

@preconcurrency import GoogleSignIn
import GoogleSignIn
import GoogleSignInSwift
import Supabase
import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion Examples/Examples/Auth/SignInWithApple.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct SignInWithApple: View {

private func signInWithApple(using idToken: String, fullName: String?) async {
actionState = .inFlight
let result = await Result {
let result = await Result { @Sendable in
_ = try await supabase.auth.signInWithIdToken(
credentials: .init(
provider: .apple,
Expand Down
2 changes: 1 addition & 1 deletion Examples/Examples/Auth/SignInWithOAuth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct SignInWithOAuth: View {
VStack {
Picker("Provider", selection: $provider) {
ForEach(providers) { provider in
Text("\(provider)").tag(provider)
Text(provider.rawValue).tag(provider)
}
}

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 @@ -206,7 +206,7 @@ struct MFAEnrollView: View {
isLoading = true
defer { isLoading = false }

enrollResponse = try await supabase.auth.mfa.enroll(params: MFAEnrollParams())
enrollResponse = try await supabase.auth.mfa.enroll(params: .totp())
} catch {
self.error = error
}
Expand Down
4 changes: 2 additions & 2 deletions Examples/Examples/Realtime/PostgresChangesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ struct PostgresChangesView: View {
table: "todos"
)

await channel.subscribe()
try await channel.subscribeWithError()

self.channel = channel
isSubscribed = true
Expand Down Expand Up @@ -142,7 +142,7 @@ struct PostgresChangesView: View {

// Handle deletes
Task {
for await delete in deletes {
for await _ in deletes {
await MainActor.run {
events.insert(
RealtimeEvent(
Expand Down
2 changes: 1 addition & 1 deletion Examples/Examples/Storage/BucketDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct BucketDetailView: View {
private func load() async {
fileObjects = .inFlight
fileObjects = await .result(
Result {
Result { @Sendable in
try await supabase.storage.from(bucket.id).list()
}
)
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
2 changes: 1 addition & 1 deletion Examples/SlackClone/ChannelStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class ChannelStore {
let insertions = channel.postgresChange(InsertAction.self, table: "channels")
let deletions = channel.postgresChange(DeleteAction.self, table: "channels")

await channel.subscribe()
try await channel.subscribeWithError()

Task {
for await insertion in insertions {
Expand Down
14 changes: 8 additions & 6 deletions Examples/SlackClone/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ extension Logger {

struct SupaLogger: SupabaseLogger {
func log(message: SupabaseLogMessage) {
let logger = Logger.supabase
Task { @MainActor in
let logger = Logger.supabase

switch message.level {
case .debug: logger.debug("\(message, privacy: .public)")
case .error: logger.error("\(message, privacy: .public)")
case .verbose: logger.info("\(message, privacy: .public)")
case .warning: logger.notice("\(message, privacy: .public)")
switch message.level {
case .debug: logger.debug("\(message, privacy: .public)")
case .error: logger.error("\(message, privacy: .public)")
case .verbose: logger.info("\(message, privacy: .public)")
case .warning: logger.notice("\(message, privacy: .public)")
}
}
}
}
2 changes: 1 addition & 1 deletion Examples/SlackClone/MessageStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ final class MessageStore {
let updates = channel.postgresChange(UpdateAction.self, table: "messages")
let deletions = channel.postgresChange(DeleteAction.self, table: "messages")

await channel.subscribe()
try await channel.subscribeWithError()

Task {
for await insertion in insertions {
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>
4 changes: 1 addition & 3 deletions Examples/SlackClone/UserStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class UserStore {

let presences = channel.presenceChange()

await channel.subscribe()
try await channel.subscribeWithError()

Task {
let statusChange = channel.statusChange
Expand Down Expand Up @@ -88,8 +88,6 @@ final class UserStore {
case .delete(let action):
guard let id = action.oldRecord["id"]?.stringValue else { return }
users[UUID(uuidString: id)!] = nil
default:
break
}
} catch {
dump(error)
Expand Down
3 changes: 2 additions & 1 deletion Examples/UserManagement/AvatarImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct AvatarImage: Transferable, Equatable {

static var transferRepresentation: some TransferRepresentation {
DataRepresentation(importedContentType: .image) { data in
guard let image = AvatarImage(data: data) else {
guard let image = await AvatarImage(data: data) else {
throw TransferError.importFailed
}

Expand All @@ -40,6 +40,7 @@ struct AvatarImage: Transferable, Equatable {
}

extension AvatarImage {
@MainActor
init?(data: Data) {
guard let uiImage = PlatformImage(data: data) else {
return nil
Expand Down
4 changes: 2 additions & 2 deletions Examples/UserManagement/ProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ struct ProfileView: View {
try await supabase.storage
.from("avatars")
.upload(
path: filePath,
file: data,
filePath,
data: data,
options: FileOptions(contentType: "image/jpeg", upsert: true)
)

Expand Down
Loading
Loading