Skip to content

Commit 2db4cb4

Browse files
committed
fixed the glitch when low quality image is about to replace with the higher one.
1 parent 5f39e93 commit 2db4cb4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Sources/ImageViewerController.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,12 @@ class ImageViewerController:UIViewController, UIGestureRecognizerDelegate {
9696
placeholderImage: placeholder ?? sourceView?.image,
9797
options: [],
9898
progress: nil) {[weak self] (img, err, type, url) in
99-
self?.imageView.layoutIfNeeded()
100-
}
99+
DispatchQueue.main.async {
100+
UIView.performWithoutAnimation {
101+
self?.imageView.layoutIfNeeded()
102+
}
103+
}
104+
}
101105
default:
102106
break
103107
}

0 commit comments

Comments
 (0)