0

Code:

DispatchQueue.concurrentPerform(iterations: filters.count) { iteration in
        let filterComputed = originalImage.applyFilter(filterNamed: filters[iteration])
        syncQueue.sync {
            finalFilters.append(filterComputed)
            return
        }
    }
    return finalFilters

I have the above code in a static function which when complete returns the finalFilters array.

Is there a way where this array can be returned each time a computed filter is appended to it?

user2512523
  • 1,229
  • 2
  • 15
  • 25
  • (final Filters array) take data from (filter array) .So when something new is added to filter array it will go in final filters.So you can add a check to see if previous count for filters has increased or not and then call this method again if there is a new entry. – Tushar Sharma Feb 15 '17 at 13:33
  • tip - how to make observer on change capacity of array http://stackoverflow.com/questions/29089383/key-value-observe-in-swift-not-showing-insertions-and-removals-in-arrays – Daivest Feb 15 '17 at 14:14

0 Answers0