Сбой приложения во время прокрутки. и получить стек в нечитаемой памяти.
private class ProxyView: UIView {
weak var headerView: UIView?
weak var scrollView: UIScrollView?
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
if let scrollView = self.scrollView,
let headerView = self.headerView {
/* ---------------------------------
** Test if the point is contained
** by the scroll view first.
*/
let scrollViewPoint = scrollView.convert(point, from: self)
if scrollView.point(inside: scrollViewPoint, with: event) {
/* -----------------------------------
** Ensure that the point doesn't fall
** into scroll view's inset space at
** the top.
*/
if scrollViewPoint.y > 0.0 {
return scrollView.hitTest(scrollViewPoint, with: event)
}
}
/* ------------------------------------
** Then test if the point is contained
** by the header view.
*/
let headerPoint = headerView.convert(point, from: self)
if headerView.point(inside: headerPoint, with: event) {
return headerView.hitTest(headerPoint, with: event)
}
} else {
print("ParallaxViewController must have a non-nill headerView and scrollView assigned to it.")
}
return self.superview?.hitTest(point, with: event)
}
error: Trying to put the stack in unreadable memory at: 0x16eed7d90.
Как остановить эту ошибку?