Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Example/ExampleTests/UIScrollViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ class UIScrollViewTests: XCTestCase {
.store(in: &subscriptions)

let givenVelocity: CGPoint = .init(x: 42, y: 42)
let givenTargetContentOffset: UnsafeMutablePointer<CGPoint> = UnsafeMutablePointer<CGPoint> .allocate(capacity: 1)
let givenTargetContentOffset: UnsafeMutablePointer<CGPoint> = UnsafeMutablePointer<CGPoint>.allocate(capacity: 1)

defer { givenTargetContentOffset.deallocate(capacity: 1) }
defer { givenTargetContentOffset.deallocate() }

scrollView.delegate!.scrollViewWillEndDragging!(scrollView, withVelocity: givenVelocity, targetContentOffset: givenTargetContentOffset)

Expand Down
4 changes: 2 additions & 2 deletions Sources/CombineCocoa/Controls/UIScrollView+Combine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ public extension UIScrollView {
var willBeginZoomingPublisher: AnyPublisher<UIView?, Never> {
let selector = #selector(UIScrollViewDelegate.scrollViewWillBeginZooming(_:with:))
return delegateProxy.interceptSelectorPublisher(selector)
.map { $0[1] as! UIView? }
.map { $0[1] as? 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) }
.map { ($0[1] as? UIView, $0[2] as! CGFloat) }
.eraseToAnyPublisher()
}

Expand Down