Xcode and Supabase Package

Hi All,

I'll start by saying i am complete beginner when it comes to coding/ developing. So please be easy on me, im also using AI tools to help and learn so apologies if what im saying doesnt make sense.

The error im getting is

/Services/SupabaseManager.swift:47:29 Cannot find 'GlobalOptions' in scope

From AI tells me 'GlobalOptions' is defined a types.swift file in the supabase package

public struct GlobalOptions: Sendable {
/// Optional headers for initializing the client, it will be passed down to all sub-clients.
public let headers: [String: String]
/// A session to use for making requests, defaults to `URLSession.shared`.
public let session: URLSession
/// The logger to use across all Supabase sub-packages.
public let logger: (any SupabaseLogger)?
public init(
headers: [String: String] = [:],
session: URLSession = .shared,
logger: (any SupabaseLogger)? = nil
) {
self.headers = headers
self.session = session
self.logger = logger
}
}

From what i can see i have added the supabase package successfully, following this guide - https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app

Here are some screenshots of my xcode to show the added package.

Maybe you need to do something like "import Supabase" in your SupabaseManager.swift file?

I don't think the AI is really helping you. I've never heard of Supabase. Apparently, it's an open source alternative to Firebase. OK, so what's Firebase? Who! That's Google. Full reverse!

Is that what's causing that long list of external dependencies in your app? You aren't going to be able to actually learn how to write apps this way. It's too far beyond your current capabilities. It's like trying to teach brain surgery to a toddler. All brain surgeons were once toddlers, but that doesn't mean they did their surgical residencies in preschool.

'import Supabase' - is there at the beginning of the file, and that doesn't cause an error so its 'seeing' the package...

The external dependencies appear automatically when adding the Supabase dependency.

I understand your comment about learning etc... and i'd be lying if i said i didnt expect a comment like that... but the fact is, i know more know about coding/ developing/ xcode/ Swift then i did a month ago... this is my way of learning. I'm not expecting to build a breakthrough app, just something I AM happy with and something I AM proud off.

Anyone offer any support?

Hi, this is Guilherme from Supabase.

The GlobalOptions is nested within the SupabaseClientOptions type, so you actually have to access it as SupabaseClientOptions.GlobalOptions

Let me know if that helps you.

Thanks.

Xcode and Supabase Package
 
 
Q