Not sure if appropriate for this community, or for !programming_horror@programming.dev.

17 points
*

I think you might be misunderstanding what this does.

You did a search for symbol references that contain “User” ignoring cases.

When you do a search for symbol references this way, Xcode will return two things:

  1. A declaration of all the symbols containing “User” and/or some context surrounding the symbol (ignoring Case)
  2. Show any places where your code references the symbol

And it did just that.

The first three .swift files show references to symbols that contain “User”.
The forth one, User.swift, is in and of itself a symbol that matches the query and has symbols inside itself.
The last one UserViewModel.swift is in itself a symbol as well and all the parts that are nested within that you’ve annotated with underscores and question marks, serve to give you context about the symbol “UserViewModel”, hence the ellipses.

It’s essentially telling you “Hey I’ve found this symbol UserViewModel, it starts with a var named username, has a bunch of stuff following that (i.e. …) then has an extension, then some more stuff (i.e. …) and then ends”.

Without knowing what’s inside UserViewModel.swift I can’t tell if it goofed with giving you a typical declaration, but that doesn’t change the fact that its trying to give you context about a valid search result, the symbol UserViewModel, so that you can figure out if that’s the one you’re looking for.

Keep in mind that variables are considered symbols as well, but in this instance I don’t think that’s what happened here, otherwise it would’ve been marked with a P instead of a C.

If this is not desired behavior then I suggest you switch from “Containing” to “Matching Word” or instead consider using the search bar at the bottom of the Symbol Navigator. Another option, if you’re searching while going through code, is to right click on the symbol in your code and click Find > Find Selected Symbol in Workspace.

Lastly it might be an idea to go over the Xcode documentation as a refresher. This would be a good starting point.

That said, Apple clearly feels that things can be improved by clarifying, because in the current Xcode beta they’ve changed the option label from References to Symbols (and added a few more options).

permalink
report
reply
2 points

Happy to see those new options in Xcode 15. Those seem really useful.

permalink
report
parent
reply
4 points

I’ll be the first to admit that I am certainly no Xcode expert. So thank you for taking the time to explain how the reference/symbols search works.

Another option, if you’re searching while going through code, is to right click on the symbol in your code and click Find > Find Selected Symbol in Workspace.

Funny enough, that’s what I did. Everything in the search window is what was selected by default in Xcode; probably why I was confused. I still contend it’s not intuitive.

permalink
report
parent
reply
1 point

Yeah not sure why Find Selected Symbol defaults to contains instead of matching. My search results get polluted with other symbols when I search for example MyStruct.image and MyStruct also has the property imageName.

permalink
report
parent
reply
6 points

Save for the “…” blank lines I see no problem with this. You just ran a Ctrl (command?) + F on everything that contains “User” ignoring case and it did exactly that.

permalink
report
reply
34 points
*

I still don’t understand why programmers are forced to use a specific tool, to write apps for a specific ecosystem.

i.e. writing a Flutter mobile app for Android and iOS. You can do everything in VSCode for the Android part incl. the apk-build.

But for iOS you’re forced to use Xcode for implementing certain things like permissions, build and upload.

Nothing but headaches.

permalink
report
reply
7 points
*

But for iOS you’re forced to use Xcode for implementing certain things like permissions, build and upload.

You can do all that via VSCode as well if you so desire.

Permissions, configurations, etc. are essentially all just XML files and can be edited as such, building, running in simulator and uploading can all be done via CLI.

And if you’re not comfortable doing it via the terminal in VSCode, you can also find some extensions.

Personally as a native dev I don’t know why you’d want to of course, but to each their own.

permalink
report
parent
reply
15 points

Apple: our way or the highway

permalink
report
parent
reply
5 points

I wouldn’t mind being locked into Xcode if Apple would beef it up and make it better.

permalink
report
parent
reply
11 points

Yeah, for the 100 bucks they take each year, just to be able to publish apps on their platform, there’s really no financial excuse for not making it better.

permalink
report
parent
reply
16 points
*
Deleted by creator
permalink
report
reply
4 points

I mean in a way the ? makes it an uncertain question because it is optional, so in a way you’re absolutely right to think that way.

permalink
report
parent
reply
0 points

I was actually looking to add Swift to my list of languages but if Xcode is this shitty, it’s kind of a deterrent.

permalink
report
reply
1 point

You only need Xcode to Swift for Apple platforms

permalink
report
parent
reply
1 point

Swift has its own problems. But don’t let either of those facts stop you.

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 5.2K

    Monthly active users

  • 1K

    Posts

  • 38K

    Comments