dimanche 10 mai 2015

How to implement the viewForZoomingInScrollView: and scrollViewDidEndZooming:withView:atScale: methods

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: I don't know what goes in the () for the viewForZoomingInScrollView method. My error is unresolved identifier 'viewForZoomingInScrollView'.

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

    viewForZoomingInScrollView(UIScrollView:scrollView) {

        return self.ImageView;

    }
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

}

Aucun commentaire:

Enregistrer un commentaire