Swift Editor Placeholder in source file

I found the same question many times on SO. But none of them gave the answer I was looking for.

You get the Placeholder in source file when you have one of these (where it says “String” with a blue background) in your code.

Image

A placeholder is for us programmers. It says “here should be a value of the type String”. You can click on it and start typing, to simply replace it with for example a variable name. You can also press tab to automatically select the next placeholder. This is very useful when you are calling a function with multiple parameters (and therefore multiple placeholders).

A placeholder is actually just normal text (<#T##Strign#>), but XCode “translates” it to look like how it does.

In your case the error is on line three.

...withReuseIdentifier: "Cell", for: <#T##IndexPath#>) as! CustomBrandCell

As you can see <#T##IndexPath#> is a placeholder as normal text as I mentioned earlier. You probably want this to be indexPath

Leave a Comment