         spinningWheel.stopAnimating()
         Logger.logDebug("stoped animating spinning wheel", scope: pluginName)
     }
+
+    override open func destroy() {
+        super.destroy()
+        Logger.logDebug("destroying", scope: "LoadingContainerPlugin")
+        Logger.logDebug("destroying ui elements", scope: "LoadingContainerPlugin")
+        removeFromSuperview()
+        Logger.logDebug("destroyed", scope: "LoadingContainerPlugin")
+    }
 }


        let xCenterConstraint = NSLayoutConstraint(item: self, attribute: .centerX,
                                                   relatedBy: .equal, toItem: container, attribute: .centerX, multiplier: 1, constant: 0)
        container.addConstraint(xCenterConstraint)

        let yCenterConstraint = NSLayoutConstraint(item: self, attribute: .centerY,
                                                   relatedBy: .equal, toItem: container, attribute: .centerY, multiplier: 1, constant: 0)
        container.addConstraint(yCenterConstraint)
    }

    private func bindPlaybackEvents() {
        if let playback = container.playback {
            listenTo(playback, eventName: Event.playing.rawValue) { [weak self] (info: EventUserInfo) in self?.stopAnimating(info) }
            listenTo(playback, eventName: Event.stalled.rawValue) { [weak self] (info: EventUserInfo) in self?.startAnimating(info) }
            listenTo(playback, eventName: Event.error.rawValue) { [weak self] (info: EventUserInfo) in self?.stopAnimating(info) }

    }

    private func bindDidChangePlayback() {
        if let container = self.container {
            listenTo(container, eventName: InternalEvent.didChangePlayback.rawValue) { [weak self] (info: EventUserInfo) in self?.didChangePlayback(info) }
        }
    }

