Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ While AXPhotoViewer has many configurable properties on each of its modules, it

```swift
let dataSource = AXPhotosDataSource(photos: self.photos)
let photosViewController = PhotosViewController(dataSource: dataSource)
let photosViewController = AXPhotosViewController(dataSource: dataSource)
self.present(photosViewController, animated: true)
```

Expand Down
14 changes: 8 additions & 6 deletions Source/Integrations/NukeIntegration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,26 @@ class NukeIntegration: NSObject, AXNetworkIntegrationProtocol {
}
}

let completion: ImageTask.Completion = { [weak self] (response, error) in
let completion: ImageTask.Completion = { [weak self] (result) in
guard let `self` = self else { return }

self.retrieveImageTasks.removeObject(forKey: photo)

if let imageData = response?.image.animatedImageData {
switch result {
case let .success(response):
if let imageData = response.image.animatedImageData {
photo.imageData = imageData
AXDispatchUtils.executeInBackground { [weak self] in
guard let `self` = self else { return }
self.delegate?.networkIntegration(self, loadDidFinishWith: photo)
}
} else if let image = response?.image {
photo.image = image
} else {
photo.image = response.image
AXDispatchUtils.executeInBackground { [weak self] in
guard let `self` = self else { return }
self.delegate?.networkIntegration(self, loadDidFinishWith: photo)
}
} else {
}
case .failure:
let error = NSError(
domain: AXNetworkIntegrationErrorDomain,
code: AXNetworkIntegrationFailedToLoadErrorCode,
Expand Down