Tarvo Mäesepp Tarvo Mäesepp - 10 months ago 59
iOS Question

Disable scrolling in tableview while popup is opened

I created simple poUp in swift however I can't seem to find answer to "how to disable scrolling in

while popup is opened?". The problem is that if popUp is opened I do not want to scroll.

That is how I create the popUp inside
if button is tapped:

let popOverVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "RatingViewController") as! RatingViewController
popOverVC.view.frame = self.view.frame
popOverVC.didMove(toParentViewController: self)
tableView.alwaysBounceVertical = false

I want it to be full screen and scrolling disabled but right now it is under navigationBar and scrolling is enabled.

I tried adding this line
tableView.alwaysBounceVertical = false
but it does nothing.

To illustrate things:

enter image description here

Answer Source

UITableViewinherits from UIScrollView. You can controll scrolling by setting isScrollEnabled.