Skip to content

Commit

Permalink
Updated the source files for #19
Browse files Browse the repository at this point in the history
  • Loading branch information
mozharovsky committed Jan 24, 2017
1 parent a9cec86 commit 2911798
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions Source/ATHImagePickerAssetsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -249,20 +249,18 @@ extension ATHImagePickerAssetsViewController: UICollectionViewDataSource, UIColl
targetSize: UIScreen.main.bounds.size,
contentMode: .aspectFill,
options: fetchingOptions) { result, info in
if info!["PHImageFileURLKey"] != nil {
if let previewController = self.holder.previewController, previewController.state == .folded {
let floatingView = self.holder.floatingView
previewController.restore(view: floatingView, to: .unfolded, animated: true)
previewController.animationCompletion = { _ in
self.collectionView.scrollToItem(at: indexPath, at: .top, animated: true)
previewController.animationCompletion = nil
}
}

DispatchQueue.main.async {
self.holder.previewController?.image = result
if let previewController = self.holder.previewController, previewController.state == .folded {
let floatingView = self.holder.floatingView
previewController.restore(view: floatingView, to: .unfolded, animated: true)
previewController.animationCompletion = { _ in
self.collectionView.scrollToItem(at: indexPath, at: .top, animated: true)
previewController.animationCompletion = nil
}
}

DispatchQueue.main.async {
self.holder.previewController?.image = result
}
}
}
}
Expand Down

0 comments on commit 2911798

Please sign in to comment.