MRProgress icon indicating copy to clipboard operation
MRProgress copied to clipboard

Overlay stops animating and view disappears when switching tabs

Open alexshive opened this issue 11 years ago • 4 comments

When swapping tabs, it stops the animation and looks broken. One workaround that helped me is by using the viewDidAppear/viewDidDisappear functions.

class ViewController: UIViewController {

    var overlay = MRProgressOverlayView()

    override func viewDidAppear(animated: Bool) {
         overlay = MRProgressOverlayView.showOverlayAddedTo(self.view, animated: false)
    }

    override func viewDidDisappear(animated: Bool) {
        overlay.dismiss(false)
    }
}

alexshive avatar Nov 05 '14 19:11 alexshive

I'm hitting this bug too...

gabriel avatar Dec 02 '14 00:12 gabriel

I am also with this problem

traleluia avatar Mar 31 '15 14:03 traleluia

+1

gpolak avatar Apr 04 '15 20:04 gpolak

So one obvious issue in the probably reduced example code here is that an overlay is initialized, but not added to the view hierachy before the view is loaded.

class ViewController: UIViewController {

-    var overlay = MRProgressOverlayView()
+    var overlay: MRProgressOverlayView?

Did you had the initialization before in an overriden viewDidLoad method?

mrackwitz avatar Apr 14 '15 13:04 mrackwitz