There must be some really elegant way of copying end of the Array using Swift starting from some index, but I just could not find it, so I ended with this:
f
This is one possible solution, there are probably a few more
let array = [1, 2, 3, 4, 5]
let endOfArray = Array(array[2..
Or with dynamic index and range check
let array = [1, 2, 3, 4, 5]
let index = 2
let endOfArray : [Int]
if index < array.count {
endOfArray = Array(array[index..
The re-initializition of the array is needed since the range subscription of Array
returns ArraySlice