i know there are a lot of posts on this already, but I've searched through them and nothing seems to be working for me.
so my app has one page that you can zoom on an image. That works perfectly fine. But when i try to navigate to the other page that has the weblink button on it... my app crashes.. Then if i disable the zoom feature on the image, the page with the web link button works.. and the app doesn't crash.. super confused. all of my outlets are linked properly.
import UIKit
class ViewController: UIViewController, UIScrollViewDelegate {
@IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var imageView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
self.scrollView.minimumZoomScale = 1.0 //getting error here EXC_BAD_instruction
self.scrollView.maximumZoomScale = 6.0
}
@IBAction func WebLink(_ sender: AnyObject) {
if let url = URL(string: "https://xxxxxxxxxxxxxxxx") {
UIApplication.shared.open(url, options: [:]) {
boolean in
// do something with the boolean
}
}
}
func viewForZooming(in scrollView: UIScrollView) -> UIView? {
return self.imageView
}
}