Scrollview viewdidlayout subviews called then content changed in scrollViewDidScroll iOS swift
Problem:
scrollViewDidScroll called while because i had a problem for one player is playing wants to be pause when user scroll the view.
But in layout subviews it's called automatically.How can i use that.
Solution:
Don't call scrollViewDidScroll.Use scrollViewWillBeginDragging to achieve that.
func scrollViewDidScroll(_ scrollView: UIScrollView) {
}
func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
print("will begin dragging")
if playerHow != nil {
playerHow.pause()
}
if playerSmart != nil {
playerSmart.pause()
}
}
Comments
Post a Comment