Disabling vertical scrolling in UIScrollView in swift?
Another way to do this is to set the height to 1.0
scrollView.contentSize = CGSizeMake(theFrame.size.height, 1.0)
Try this. This sets the content size to the height of the frame so it disables vertical scrolling because it can display the whole size.
let scrollSize = CGSizeMake(theFrame.size.height, yourWidth)
myScrollView.contentSize = scrollSize