You may still have trouble displaying the output in the Assistant Editor. Rather than wrapping the string in println()
, simply output the string. For example:
for index in 1...5 {
"The number is \(index)"
}
Will write (5 times)
in the playground area. This will allow you to display it in the Assistant Editor (via the little circle on the far right edge).
However, if you were to println("The number is \(index)")
you wouldn't be able to visualize it in the Assistant Editor.