I'm trying to follow the instructions from this post How to zoom in/out an UIImage object when user pinches screen? but I don't know how to implement these methods. I know that is a basic question but if anyone could take a minute to help a beginner I would greatly appreciate it thanks!
Edit: Error I'm getting is 'optional' can only be applied to protocol members.
This stuff is incredibly difficult to figure out for a beginner... is there an easier way to learn coding??
import UIKit
class ViewController: UIViewController, UIScrollViewDelegate {
@IBOutlet weak var ImageView: UIImageView!
@IBOutlet weak var scrollView: UIScrollView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
scrollView.delegate = self
optional func viewForZoomingInScrollView(scrollView: UIScrollView) -> UIView? {
return self.ImageView;
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}