CombineCocoa icon indicating copy to clipboard operation
CombineCocoa copied to clipboard

UIScrollView publishers issue in version 0.4.0

Open omidgolparvar opened this issue 2 years ago • 1 comments

I have build error for this publishers:

/// Combine wrapper for `scrollViewWillBeginZooming(_:with:)`
var willBeginZoomingPublisher: AnyPublisher<UIView?, Never> {
    let selector = #selector(UIScrollViewDelegate.scrollViewWillBeginZooming(_:with:))
    return delegateProxy.interceptSelectorPublisher(selector)
        .map { $0[1] as! UIView? } // ❌ Cannot downcast from 'Any' to a more optional type 'UIView?'
        .eraseToAnyPublisher()
}

/// Combine wrapper for `scrollViewDidEndZooming(_:with:atScale:)`
var didEndZooming: AnyPublisher<(view: UIView?, scale: CGFloat), Never> {
    let selector = #selector(UIScrollViewDelegate.scrollViewDidEndZooming(_:with:atScale:))
    return delegateProxy.interceptSelectorPublisher(selector)
        .map { ($0[1] as! UIView?, $0[2] as! CGFloat) } // ❌ Cannot downcast from 'Any' to a more optional type 'UIView?'
        .eraseToAnyPublisher()
}

CombineCocoa 0.4.0 Xcode 12.4 Swift 5.3.2

omidgolparvar avatar Oct 11 '21 18:10 omidgolparvar

same here

merovic avatar Nov 03 '21 13:11 merovic