-
Notifications
You must be signed in to change notification settings - Fork 161
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
App crashes: KERN_PROTECTION_FAILURE error in childScrollViewDidScroll(_:). #69
Comments
I have got this error too |
Thanks for your feedback! May I ask what version of SegementSlide you used? |
@Jiar I am currently using version 3.0.1. |
@HyunjoonKo @lumanmann I run the Example under the same environment, but no problem is found. It is better to have a Demo that can reproduce the problem, otherwise it is difficult to troubleshoot the problem. |
I have got the same error from Firebase Crashlytics report. |
So as I... Is there anyone who solved this problem? |
@hansolnoh95 Not yet. It does not appear in the development environment, but many reports are still reported in Crashlytics and Xcode crash reports. |
@Jiar internal func childScrollViewDidScroll(_ childScrollView: UIScrollView) {
defer {
scrollViewDidScroll(childScrollView, isParent: false)
}
let parentContentOffsetY = scrollView.contentOffset.y // 0.0
let childContentOffsetY = childScrollView.contentOffset.y // 0.0
switch innerBouncesType {
case .parent:
if !canChildViewScroll {
childScrollView.contentOffset.y = 0 // Thread 1: EXC_BAD_ACCESS (code=2, address=0x16b8e3ff0)
} else if childContentOffsetY <= 0 {
canChildViewScroll = false
canParentViewScroll = true
}
case .child:
if !canChildViewScroll {
childScrollView.contentOffset.y = 0
} else if childContentOffsetY <= 0 {
if parentContentOffsetY <= 0 {
canChildViewScroll = true
}
canParentViewScroll = true
} else {
if parentContentOffsetY > 0 && parentContentOffsetY < headerStickyHeight {
canChildViewScroll = false
}
}
}
} The problem was solved when I tried to fix it as follows: // ...
case .parent:
if !canChildViewScroll, childScrollView.contentOffset.y != childContentOffsetY {
childScrollView.contentOffset.y = 0
} else if childContentOffsetY <= 0 {
canChildViewScroll = false
canParentViewScroll = true
}
// ... |
how can you fix it, can you share the why? |
Hi @skeyboy You can see the fixed source code here: Install with CocoaPods:
If |
A lot of error reports came into my app's Crashlytics. Please check.
Stack trace:
in SegementSlideViewController+scroll.swift:
The text was updated successfully, but these errors were encountered: