pull-to-refresh icon indicating copy to clipboard operation
pull-to-refresh copied to clipboard

fatal error: attempted to read an unowned reference but the object was already deallocated

Open siberianisaev opened this issue 8 years ago • 0 comments

Xcode 9 / Swift 4

on self.addObserver(newSuperview) of ESRefreshComponent

open override func willMove(toSuperview newSuperview: UIView?) {
        super.willMove(toSuperview: newSuperview)
        /// Remove observer from superview immediately
        self.removeObserver()
        DispatchQueue.main.async { [unowned self, newSuperview] in
            /// Add observer to new superview in next runloop
            self.addObserver(newSuperview)
        }
    }

siberianisaev avatar Sep 25 '17 08:09 siberianisaev