Morteza Soleimani Morteza Soleimani - 6 months ago 27
Swift Question

UIView over UIScrollView prevent it from scrolling

I have a

, Each cell has a view like below image, a
in background and another view on the UIScrollView.

UIScrollView contains multiple images and user should be able to see them by swiping right or left on the table cell, But as second View (red area) covered UIScrollview, Scrolling not work when I swipe my finger in this area, But in the top of red area it's ok and works perfect.

enter image description here

I see in the other application that have this feature that scrolling is possible in all cell height even when they have other views that covered the background.

I should be grateful if you share your suggestions with me :)


try disable userInteraction on the view in the red area, this will allow touches to pass though it. this can be done through the storyboard, or just go view.userInteractionEnabled = false