Q:

Swift - not getting the suggestion for the Variable name in println

var firstLoop = 0
for i in 2..<6 {
    firstLoop += i
}
println(firstLoop)
println("\(firstLoop)")
println("\(firstLoop.description)")

Here i am printing the firstLoop variable. But in the first println, when I type the word firstLoop, it is not showing any suggestions, while in next two println as I type firstLoop it is showing suggestions. Here can any one explain to me why it is not showing the suggestion in first println? And can I use this format to print the variable? Is that a correct way to print the varible?

A:

Yes, it is legal and correct; there is absolutely no need to perform string interpolation merely to println something (and indeed, string interpolation merely does the same thing println itself does, namely, calls the description of a Printable). You've found an Xcode code completion bug. This has nothing to do with iOS or Swift except tangentially; it's an Xcode problem.

