I can not figure out why the error ...

//Значения в массивы добавляются по таймеру var counter = [Int]() var counterForInterval = [Int]() func arrayRange() { var minuteInterval = [Int]() if counter.count == 4 { minuteInterval = counterForInterval.dropFirst() } if counter.count == 8 { minuteInterval = counterForInterval.dropFirst() } // Далее используется minuteInterval } 

enter image description here

    1 answer 1

    Because they have different types. Use:

     [Int](counterForInterval.dropFirst()) 

    or

     counterForInterval.dropFirst().sorted()