Skip to content

Commit

Permalink
Merge pull request #76 from zfoltin/master
Browse files Browse the repository at this point in the history
Set image on the main thread
  • Loading branch information
Krisiacik committed Nov 12, 2016
2 parents a14a9c0 + 102e53e commit c2142a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ImageViewer/Source/ItemBaseController.swift
Expand Up @@ -171,10 +171,12 @@ class ItemBaseController<T: UIView>: UIViewController, ItemController, UIGesture

if let image = image {

self?.itemView.image = image
DispatchQueue.main.async {
self?.itemView.image = image

self?.view.setNeedsLayout()
self?.view.layoutIfNeeded()
self?.view.setNeedsLayout()
self?.view.layoutIfNeeded()
}
}
}
}
Expand Down

0 comments on commit c2142a1

Please sign in to comment.