Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIScrollView publishers issue in version 0.4.0 #60

Open
omidgolparvar opened this issue Oct 11, 2021 · 1 comment
Open

UIScrollView publishers issue in version 0.4.0 #60

omidgolparvar opened this issue Oct 11, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@omidgolparvar
Copy link

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 omidgolparvar added the bug Something isn't working label Oct 11, 2021
@merovic
Copy link

merovic commented Nov 3, 2021

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants