Home > Software engineering >  Xcode unable to find enum in scope
Xcode unable to find enum in scope

Time:03-20

I have an enum in my project called Theme. It is in a file called Theme.swift in App > shared. I then have a SwiftUI view called ThemeView in ThemeSettingsView.swift located in App > Shared > Settings. However whenever I try to declare a variable as var theme: Theme I get an error saying "Cannot find Theme in scope."

Any recommendations on how to fix. Do I have the files located in the wrong areas?

CodePudding user response:

I think the problem is the Target Membership of your Theme file. Check this enter image description here

  • Related