What kind of type have the range in for loop?
问题 When we write the following: for i in 1...10 { //do stuff } I want know what type have the range 1...10 to use it in function call for example: myFunc(1...10) 回答1: If you put a breakpoint after defining let range = 1..<10 , you will see that it's actually not a Range structure, but rater a CountableRange (or CountableClosedRange for 0...10) Docs: CountableRange, CountableClosedRange Functions: func printRange(range: CountableRange<Int>) { for i in range { print ("\(i)") } } func printRange