76

Recently, I have started using Xcode 4 for developing iOS apps.

In Xcode intellisense's autocomplete box, there are some letters in colored boxes before every suggestion. I know that they represent the property of the word we are typing like f,T,C,M,P,C,K,# etc. enter image description here

Is there some kind of glossary available to find their quick meanings?

Meanings of f,C,T,# are understandable (function, class etc) but there are many others which I dont know. I assume these letters are standard across all IDEs like Visual Studio, Netbeans etc. Correct me if I am wrong.

Please suggest.

Jon
  • 38,814
  • 81
  • 233
  • 382
hiprakhar
  • 1,007
  • 3
  • 12
  • 15

2 Answers2

188

In Xcode this is called "Code Sense". And these icons also exist in Xcode 3. These icons are also used in symbol navigation.

Red: macros

  • # = macro (think #define)

Brown: Core Data / namespace

  • C = modeled class
  • M = modeled method
  • P = modeled property

  • N = C++ namespace

Orange: aliased types

  • C with underscore = Objective-C category
  • E = enum
  • T = typedef / typealias
  • Ex = Swift extension

Green: variables

  • B = binding
  • f = function
  • F = field
  • K = constant
  • L = local variable
  • O = IBOutlet
  • V = variable (can be ivar, global var, local var, etc.)
  • x = parameter (think f(x))

Blue: methods

  • A = IBAction
  • M = method
  • P = property

Purple: aggregate types

  • C = class (Objective-C, Swift or C++)
  • CE = class extension
  • Pr = Objective-C/Swift protocol
  • S = struct
  • U = union

Gray: snippets

  • {} = snippets

Icons: #pragma mark or comments

  • Flag = !!!: ...
  • Patch = FIXME: ...
  • ? = ???: ...
  • Items = TODO: ...
  • List = MARK: ...

You should be able to look up the meanings from the filenames from /Developer/Library/PrivateFrameworks/DVTFoundation.framework/Resources/Xcode.SourceCodeSymbolKind.*.Icon.tiff*.

In later versions of Xcode, the path is moved to /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Resources/Assets.car, see Analysing Assets.car file in IOS on how to extract the images from the *.car

Community
  • 1
  • 1
kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005
  • Nice, but more nice if you could put the icons and the explanation together. – PlainOldProgrammer Mar 15 '14 at 04:18
  • 1
    Can you explain what "modeled" means in the context of "modeled class/method/property"? – Lèse majesté Aug 21 '15 at 20:07
  • 1
    The icons are now stored in `/Applications/Xcode.app//Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/Assets.car`. You can extract the contents of this file using [`cartool`](https://github.com/steventroughtonsmith/cartool). – rob mayoff Jul 30 '16 at 16:37
  • Can we make any custom icons for something? – Johnykutty Jun 14 '19 at 13:13
  • is the link has changed? – Hassan Taleb Feb 28 '21 at 07:53
  • They seemed to have moved again in Xcode 13 beta. I haven't been able to find their new location. The closest I could find was `/Applications/Xcode-beta.app/Contents/SharedFrameworks/DVTUserInterfaceKit.framework/Versions/A/Resources/Assets.car`, but I don't see any of these icons using [AssetCatalogTinkerer](https://github.com/insidegui/AssetCatalogTinkerer) – Alexander Sep 01 '21 at 16:17
  • `/Users/Alex/Desktop/plists/DVTSymbolIcons.dvticonspecsc` is a PLIST that defines a bunch of icons programmatically. I think they're using this to generate these symbols on-the-fly. – Alexander Sep 01 '21 at 16:43
  • You should add blue `I` initializer to this list – Leo Dabus Feb 20 '23 at 05:41
1

I was searching for the meaning behind the "rM" icon. I finally found the answer (many thanks to kennytm):

The "rM" symbol represents a recursive method.

enter image description here

enter image description here

Dharman
  • 30,962
  • 25
  • 85
  • 135