Reorganize saving, generate feed
This commit is contained in:
9
CHDataManagement/Extensions/Array+Split.swift
Normal file
9
CHDataManagement/Extensions/Array+Split.swift
Normal file
@ -0,0 +1,9 @@
|
||||
extension Array {
|
||||
|
||||
func split(into size: Int) -> [[Element]] {
|
||||
guard size > 0 else { return [] }
|
||||
return stride(from: 0, to: count, by: size).map {
|
||||
Array(self[$0..<Swift.min($0 + size, count)])
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user