In my tableview I get my data shown from these arrays:
var offersProduct = [String]()
var offersPrice = [String]()
var savings = [String]()
var shops = [String]()
var imageNames = [String]()
var exDates = [Int]()
var pickedIDs = [String]()
var setDates = [Int]()
Right now the data isn't sorted in any way. So I have 2 questions.
- How do I sort arrays after date? Nearest to NSDate first.
I have the array of exDates, witch is an array of Int of timeIntervalSince1970. So i want the closest expiry date to get index 0 of the array.
- How do I sort the other arrays like the first one?
So, lets say I have sorted exDates array, that gives me another problem, cause now the expiry date shown, doesn't match with the data from the other arrays. So I need to somehow sort the other arrays, by moving the data in from the same index as in the exDates array. How can that be done?
Hope someone can help.