I have an image that you can scroll through using UIScrollView. I want to add buttons to it. The buttons need to stay attached to the image and scroll with it, not separately. I need this all done programmatically.
This is the code I have right now:
imageView = UIImageView(image: UIImage(named: "Map 1.png"))
// 2
scrollView = UIScrollView(frame: view.bounds)
scrollView.backgroundColor = UIColor.blackColor()
// 3
scrollView.contentSize = imageView.bounds.size
// 4
scrollView.addSubview(imageView)
view.addSubview(scrollView)
scrollView.contentSize.height = scrollView.frame.size.height
you just need to add button to scrollview: