             // fix issue that `APNGImageView` may cause crash when deinit
             layer?.contents = nil
             wantsLayer = false
+        #else
+            NotificationCenter.default.removeObserver(self, name:  Notification.Name.UIApplicationWillResignActive, object: nil)
+            NotificationCenter.default.removeObserver(self, name:  Notification.Name.UIApplicationDidBecomeActive, object: nil)
         #endif
     }
 

        isAnimating = false
        autoStartAnimation = false
        super.init(frame: frame)
    }
    
    /**

        isAnimating = false
        autoStartAnimation = false
        super.init(coder: aDecoder)
        
        addObservers()
    }
    
    /**
