funcsegmentationArrWithCount(_count:Int,arr:[String]) -> [[String]] {
letcontentArr =NSMutableArray.init(array: arr)
varresultCount:Int=0
letnum =Double(contentArr.count) /Double(count)
letn =Int(num)
ifnum -Double(n) >0{
resultCount =Int(num) +1
}else{
resultCount =Int(num)
}
varresultArr = [[String]]()
foriin0..
letindex = i * count
ifnum -Double(n) >0{
ifi == resultCount -1{
leta = contentArr.count- (count * n)
letrange =NSMakeRange(index, a)
letsubArr = contentArr.subarray(with: range)as! [String]
resultArr.append(subArr)
}else{
letrange =NSMakeRange(index, count)
letsubArr = contentArr.subarray(with: range)as! [String]
resultArr.append(subArr)
}
}else{
letrange =NSMakeRange(index, count)
letsubArr = contentArr.subarray(with: range)as! [String]
resultArr.append(subArr)
}
}
returnresultArr
}