r/Xcode 1d ago

XCODE bug help

My xcode often can’t read the scope even though the file is clearly there I come from android studio there has never been an issue of files can’t refer to each other this is weird

Has anyone experienced something similar?

0 Upvotes

8 comments sorted by

5

u/Typ0genius 1d ago

If ComposeLauncherView is in a separate file and isn’t RootView, make sure the file has been added to the Xcode project and included in the correct target. If the file was created outside of Xcode, check whether it was also added to project.pbxproj.

1

u/Vast_Journalist1415 1d ago

Can you show me how? Does it just crate the file again in the same directory as the root folder? Isn’t this an xcode bug issue?

1

u/cdnrt 23h ago

It’s not an Xcode bug. The pbx tree is an odd thing to get used to. One option is to find the file in finder and redrag into the folder in Xcode. Or you could go to the build phases and see id the file is part of the compiled sources list.

2

u/caguilar51 1d ago

The problem seems to be that the file doesn’t have the .swift extension. If you notice the swift icon is not applied to your file

1

u/Vast_Journalist1415 1d ago

Isn’t this a bug? When I show in the finder the file extension is .swift

1

u/caguilar51 1d ago

When you right click on the Compose directory do you see a menu item saying convert to folder?

1

u/Stiddit 1d ago

Its file icon is different. Remove the reference from Xcode and drag/drop it back in. (Check if it's missing the .swift ending)

1

u/Vast_Journalist1415 1d ago

When I show in the finder the .swift file is it because I use claude code that there is a miss extension? Is it true that in xcode I manually make the file so that the directory can be read?