Question : check enumatted arrray last item swift
Answered by : sore-skylark-wvyrh3g1t9a5
for (idx, element) in array.enumerated() { if idx == array.endIndex-1 { // handling the last element } }
Source : https://stackoverflow.com/questions/51209600/swift-how-can-i-check-if-i-iterate-through-the-last-item-of-liststring | Last Update : Thu, 01 Oct 20