1

I have a UIScrollview covering the entire UIViewController's main view. Inside UIScrollview is a content view that allows the UIScrollview get the scrollable content. Inside the Content View of Scroll View is a UITableView. I'm not being able to scroll the UITableView. Instead the vertical swipe is passed directly to the ScrollView causing it to scroll. How can I make the UITableView scroll inside the UIScrollview?

I have read the answers of many similar questions but none of them solved my issue

Question 1

Question 2

Question 3

Community
  • 1
  • 1
MrDank
  • 2,020
  • 2
  • 17
  • 39
  • Have you found any good solution? – Snoobie Nov 10 '16 at 20:18
  • 1
    @Snoobie yes I did. I stopped using scrollView all together and instead used a static TableView with cell having another tableView. UITableView is the most powerful tool in Swift. Use it when you can. – MrDank Nov 11 '16 at 06:41
  • I solved it too with another method, it's little tricky but I catch SwipeGesture and TapGesture in aim to active or not the scroll of my main ScrollView. Thank you by the way ! – Snoobie Nov 11 '16 at 17:06

2 Answers2

0

You need to set correct constraints (or frames) for UITableView (size of TableView must be less, then contentSize for scrolling).

Igor
  • 12,165
  • 4
  • 57
  • 73
0
  • Make sure that's your constraints of UITableView related to UiScrollView
  • Disable UITableView scrolling
  • Make your scollView center Verticly to the main container and change the priority of constraint to 999

Hope that help you

Muhammed
  • 584
  • 1
  • 11
  • 24