diff --git a/apps/studio/components/interfaces/Home/Connect/Connect.constants.ts b/apps/studio/components/interfaces/Home/Connect/Connect.constants.ts index 24bb9cec4a9..e7adce95098 100644 --- a/apps/studio/components/interfaces/Home/Connect/Connect.constants.ts +++ b/apps/studio/components/interfaces/Home/Connect/Connect.constants.ts @@ -206,6 +206,20 @@ export const MOBILES: ConnectionType[] = [ }, ], }, + { + key: 'swift', + label: 'Swift', + icon: 'swift', + guideLink: 'https://supabase.com/docs/guides/getting-started/tutorials/with-swift', + children: [ + { + key: 'supabaseswift', + label: 'supabase-swift', + children: [], + icon: 'supabase', + }, + ], + }, { key: 'androidkotlin', label: 'Android Kotlin', diff --git a/apps/studio/components/interfaces/Home/Connect/content/swift/supabaseswift/content.tsx b/apps/studio/components/interfaces/Home/Connect/content/swift/supabaseswift/content.tsx new file mode 100644 index 00000000000..a22a289bccc --- /dev/null +++ b/apps/studio/components/interfaces/Home/Connect/content/swift/supabaseswift/content.tsx @@ -0,0 +1,84 @@ +import type { ContentFileProps } from 'components/interfaces/Home/Connect/Connect.types' + +import { + ConnectTabs, + ConnectTabTriggers, + ConnectTabTrigger, + ConnectTabContent, +} from 'components/interfaces/Home/Connect/ConnectTabs' +import SimpleCodeBlock from 'components/to-be-cleaned/SimpleCodeBlock' + +const ContentFile = ({ projectKeys }: ContentFileProps) => { + return ( + + + + + + + + + + {` +import Foundation +import Supabase + +let supabase = SupabaseClient( + supabaseURL: URL(string: "${projectKeys.apiUrl ?? 'your-project-url'}")!, + supabaseKey: "${projectKeys.anonKey ?? 'your-anon-key'}" +) + `} + + + + + + {` +import Foundation + +struct Todo: Identifiable, Decodable { + var id: Int + var title: String +} +`} + + + + + + {` +import Supabase +import SwiftUI + +struct ContentView: View { + @State var todos: [Todo] = [] + + var body: some View { + NavigationStack { + List(todos) { todo in + Text(todo.title) + } + .navigationTitle("Todos") + .task { + do { + todos = try await supabase.from("todos").select().execute().value + } catch { + debugPrint(error) + } + } + } + } +} + +#Preview { + ContentView() +} + +`} + + + + ) +} + +export default ContentFile