Search code examples
swiftswift-playground

for loop not printing output of array


I am brand new to Xcode and swift and following a iOS video tutorial where the teacher is discussing for loops.

my code

let names = ["Chris", "John", "Steven", "Big Ralph"]

for name in names

{
    print ("Hi \(name)")

}

Problem: When I run the loop using Xcode 7.2 it shows (4times)in the playground but I can only see "Hi Big Ralph" as the printed output and not any of the other names in the array. Why is this.

enter image description here


Solution

  • Right click on the view and click on "Value History"