// // Array+Extensions.swift // CapCollector // // Created by Christoph on 12.05.20. // Copyright © 2020 CH. All rights reserved. // import Foundation extension Array { func split(intoPartsOf maxElements: Int) -> [ArraySlice] { guard !isEmpty, maxElements > 0 else { return [] } var result = [ArraySlice]() var currentIndex = 0 while true { let nextIndex = currentIndex + maxElements if nextIndex >= count { result.append(self[currentIndex..