active fix
This commit is contained in:
parent
742ea295b9
commit
7e5aa638dd
@ -161,14 +161,14 @@ open class VideoModel: MoleculeModelProtocol {
|
|||||||
open func addActiveListener(for view: Video, delegateObject: MVMCoreUIDelegateObject?) {
|
open func addActiveListener(for view: Video, delegateObject: MVMCoreUIDelegateObject?) {
|
||||||
removeActiveListener()
|
removeActiveListener()
|
||||||
|
|
||||||
guard let containingView = (delegateObject?.moleculeDelegate as? UIViewController)?.view else { return }
|
|
||||||
resignActiveListener = NotificationCenter.default.addObserver(forName: UIApplication.willResignActiveNotification, object: nil, queue: OperationQueue.main) { [weak self] (notification) in
|
resignActiveListener = NotificationCenter.default.addObserver(forName: UIApplication.willResignActiveNotification, object: nil, queue: OperationQueue.main) { [weak self] (notification) in
|
||||||
self?.halted = true
|
self?.halted = true
|
||||||
}
|
}
|
||||||
activeListener = NotificationCenter.default.addObserver(forName: UIApplication.didBecomeActiveNotification, object: nil, queue: OperationQueue.main) { [weak self] (notification) in
|
activeListener = NotificationCenter.default.addObserver(forName: UIApplication.didBecomeActiveNotification, object: nil, queue: OperationQueue.main) { [weak self] (notification) in
|
||||||
if MVMCoreUIUtility.isView(view, visibleIn: containingView) {
|
guard let self = self,
|
||||||
self?.halted = false
|
let view = self.view,
|
||||||
}
|
view.isVisibleInDelegate() else { return }
|
||||||
|
self.halted = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user