Skip to content

Commit

Permalink
Disable builtin prefetching in RateLimiterDemoViewController
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Feb 1, 2017
1 parent c49242b commit 77a0635
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Example/Nuke/RateLimiterDemoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class RateLimiterDemoViewController: UICollectionViewController {

collectionView?.backgroundColor = UIColor.white
collectionView?.register(UICollectionViewCell.self, forCellWithReuseIdentifier: cellReuseID)
if #available(iOS 10.0, *) {
collectionView?.isPrefetchingEnabled = false
}
}

override func viewWillAppear(_ animated: Bool) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Loader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public final class Loader: Loading {
private func process(image: Image, context ctx: Context) {
queue.async {
guard let processor = self.makeProcessor(image, ctx.request) else {
ctx.completion(.success(image))
ctx.completion(.success(image)) // no need to process
return
}
self.schedulers.processing.execute(token: ctx.token) {
Expand Down

0 comments on commit 77a0635

Please sign in to comment.