I have several view controllers with one or multiple scrollviews. Although I have explicitly set the scrollsToTop
flags in view controllers with more than one scrol
I changed the accepted answers into swift for convenience:
func findMisbehavingScrollViews() {
var aview = UIApplication.sharedApplication().keyWindow
findMisbehavingScrollViewsIn(aview!)
}
func findMisbehavingScrollViewsIn(aview: UIView) {
if aview.isKindOfClass(UIScrollView) {
if (aview as! UIScrollView).scrollsToTop {
print("found uiscrollview \(aview)")
}
}
for bview in aview.subviews {
findMisbehavingScrollViewsIn(bview)
}
}