Following from this question: Loading Screen from any Class in Swift
Issue: The loading overlay view will display but will not hide when hideOverlay
Swift 2
Are you calling hideOverlayView()
from a background thread? If you are, you should make sure it runs on the main thread:
dispatch_async(dispatch_get_main_queue(), { // This makes the code run on the main thread
LoadingOverlay.shared.hideOverlayView()
})
Swift 3+
DispatchQueue.main.async {
LoadingOverlay.shared.hideOverlayView()
}