My app has started reporting crashes with the error in the title. Had not seen this in the past year, and since I haven't changed any of my UIPageControl code, why the crashes?
Searching, I only found a single hit on that string, from China. Translated, it says:
After iOS was updated to iOS14, the Run project would crash because the UIPageControl that I encapsulated crashed, but this did not happen in iOS13 and below. Finally, it was found that the crash was caused by assigning number before assigning Count
Yup! The app code was setting the number before the count! Posting this here so others hitting the same issue will know how to fix it quickly!
EDIT:
To be more precise:
if pageControl.numberOfPages > 0 {
pageControl.currentPage = 0
}
Don't set the current page to anything if you don't have any pages yet!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With