I am a beginner of Swift for iOS development, and want to find an elegant way to loop through an array from the second element.
If it is in Objective-C, I think I can write the code like below.
if(int i = 1; i < array.count; i++){
array[i].blablabla....
}
And I have tried several methods to do this in swift
for i in 1..<array.count {
array[i].blablabla....
}
But in this way, if the array's count is zero, the app will crash, because it cannot create an array from 1 to 0.
I also tried code like this, but it seems that it cannot enumerate from the second element.
for (index, object) in array.enumerate() {
object.blablabla...
}
So what's the best way to do this, do you guys have any idea?