how to display loop times in playground

74 views Asked by At

I want to get the loop times info in playground. But it seems to only display the latest result for a loop on the right side. Do I miss anything? Xcode 15.0.1

import Cocoa

for i in 1...5{
    print("\(i)")
}

I have a screenshot: enter image description here

EDIT:

Sorry for my poor English. I actually want to know how to switch the "5\n" to "(5 times)". I remember it used to display like that in the past. However, I can only switch in between "latest value" and "value history" for now. Is it changed because of the Xcode version. Or I'm looking in the wrong place

1

There are 1 answers

3
Mahi Al Jawad On

I don't know why you are importing Cocoa. With importing Foundation framework it works completely fine:


import Foundation

for i in 1...5{
    print("\(i)")
}

I see that you are not checking the output section in the bottom of the screen. Check my screenshot: enter image description here