00:00
517
More
See all Show me
This tutorial goes over a very simple implementation of how to use UIScrollViews, as well as how to implement a UIScrollView's pinching and zooming functionality.

The source code for the tutorial can be downloaded from austinbull.com/tutorials/tutorial3.zip

Enjoy!

Credits

Likes

See all likes
  • Nick Myers 3 years ago
    Thanks for the compliment. I'm having trouble finding a good solution for a microphone. I have a bluetooth headset that I used for one of the tutorials, but it didn't work very well at all. In the other tutorials, I actually used the USB microphone that I got when I bought RockBand for my PS3. While it's a good microphone, I hate having to hold a mic while trying to type with one hand.....thus the volume issues. I'm still trying to find a better solution, so bear with me until I do. I'll try holding the mic a little closer while speaking into it.
  •  
  • Brian Williamson 3 years ago
    Thank you so much for creating these kinds of tutorials. Most of the info on iPhone programming I have found so far has been aimed at experienced Cocoa programmers so it is great to find something like this for us beginners.
  •  
  • chen lion 3 years ago
    thank you for this tutorial. How can i get it and view offline?
  •  
  • Nick Myers 3 years ago
    Over on the right side of the page below the play count, there should be a link to download it.
  •  
  • Nick Myers 3 years ago
    I think I understand what you're wanting to do, and I'm pretty sure that it will require implementing another delegate function. I'll have to play around with it before I can say for sure.
  •  
  • Brian Williamson 3 years ago
    I have tried to recreate this tutorial, but I need to have an actual interface I built in IB to scroll, not an image. I cannot get it to work. I'm using the same code except where the image view is concerned. You mentioned that if you want a view to scroll then use it's view controller in "viewForZoomingInScrollView" function, but how do you do this?
  •  
  • Nick Myers 3 years ago
    Are you putting the scroll view in the window or in the view controller. For what you're wanting to do, I'd add the scroll view to the view controller's view and then put all my content in there.
  •  
  • Tom Williamson 3 years ago
    How would you do the scroll/zoom using a textview instead of a imageview?

    Thanks
  •  
  • in reference to your Microphone issue, let me make a sugestion: Marshal ( as in the guitar amp) actually makes an affordable line of condenser mics that sound great for this... these use what is called "phantom power supply" basically a system of delivering power to the micdown the mic cable... normaly supplied by the mixer, most sound cards don't have phantom so you will probably have to buy an external one I built a battery powered version that is the cleanest sound I have ever heard in 20+ years in pro audio. expect to pay ~$80 used on like e=bay etc...
  •  
  • Nick Myers 3 years ago
    Thanks for the info. I'll definitely have to look into that.
  •  
  • JetForMe plus 3 years ago
    Hey, Nick, thanks for the tutorial. I've just started watching it, but I had a couple of comments. As of this writing (2008-11-19), IB has a UIScrollView in the library palette. Also, why didn't you connect the scroll view's delegate up in IB, rather than in code? Finally, why not embed the UIImageView in IB, rather than creating it programmatically?

    Thanks!
  •  
  • Nick Myers 3 years ago
    Sometimes IB gets in the way and makes things harder than they should be. Other times, IB obscures some really important things that you should probably understand before using a particular control. If you can do everything in code, it'll make using IB easier. However, the opposite isn't necessarily true.
  •  
  • Greg 3 years ago
    hi Nick,
    what a great tutorial!
    It's got me started a lot thank you.
    Although I have a question...is there a way to load an image file from the Resources folder instead of a web image?
    thanks
  •  
  • Greg 3 years ago
    hi Nick,
    what a great tutorial!
    It's got me started a lot thank you.
    Although I have a question...is there a way to load an image file from the Resources folder instead of a web image?
    thanks
  •  
  • Pieter 3 years ago
    I wonder why no-one has mentioned it yet, but there is a uiscrollview widget in interfacebuilder. It is, however, not in the "Windows, Views & Bars" group, but in "Data Views". Using that widget, you don't need to set things like clipping and zoom levels in code.

    Nevertheless, a great tutorial,
    Keep up the good work!
  •  
  • Anton Sinelnyk 3 years ago
    Thanks
  •  
  • Anton Sinelnyk 3 years ago
    That's really awesome and useful. I have bookmarked you and I watching your tutorials again and again. Thanks
  •  
  • Coach Roebuck 2 years ago
    Awesome tutorial! You made life very simple...

    Through IB, I had to set my file owner's delegate to the that scroll view app delegate object rather than the window to get the project to work properly. I'm rather new to this world, so go figure.

    Apart from that, thank you!
  •  
  • Zev Eisenberg 2 years ago
    Thanks, Coach Roebuck! That was the missing piece I was looking for to get it working.
  •  
  • Dave 2 years ago
    Hi Nick... Bringing up an old thread. I'm using a scrollview with an imageview inside and I want to add flick function to the scrollview.

    But all the touch events are sent to the scrollview and my viewcontroller never gets the touch events (touchesBegan is not called)

    How can I make sure that any pinch/zoom operations are handled by the scrollview but other touch events are passed to my viewcontroller?

    Thanks.
  •  
  • Deepesh 2 years ago
    Hey Nick,

    Thanks for the great tutorial. I have followed this and works great on simulator (iphone os v 2.2.1). However when deployed on actual device running iphone os 3 beta 5, zoom functionality is not there. Any heads on that?

    thanks!
    Deepesh
  •  
  • Deepesh 2 years ago
    Hey Nick,

    I got it, we need to explicitly set multi-touch-enabled attribute in order to get it working. I wonder how it is working in simulator???

    Thanks!
    Deepesh
  •  
  • abhinav kapur 2 years ago
    thnx nick...this tutorial was really helpful
  •  
  • Suman S 2 years ago
    thnx for the great tutorial.. but is it possible to have the image and pinch and zoom only on the part of the screen and put other controls on the rest of the screen ? u see, i wanted to put an image which I could pinch and zoom and put some labels below the image..Is it possible ?
  •  
  • Suman S 2 years ago
    hi..
    Sorry for the previous post.. your video answers that.. but I wanted to know if I could detect touches on the image as shown in the video, so that the coordinates of the point of touch could be recorded.
    Could anybody please help me out in this regard ?

    Thanks
  •  
  • Kalle Alm 2 years ago
    Thanks a lot for this tutorial. FINALLY feels like I got an entry point to the whole UIScrollView deal! Rock on :)
  •  
  • andrew hill 1 year ago
    Hi, Thanks for posting. I'm new at the whole iPhone Ap development and am wondering how to change the sample code so that the image displayed isn't a URL based image but an embedded image in the app. My terminology might be confusing, sorry.

    Any help would be appreciated.

    Thanks!
  •  
  • Tom Glenn 1 year ago
    Fantastic tutorial!

    I've been searching for the past 2 days for a solution to pinch zoom and scroll functionality on a UIImageView, and everywhere suggested pages upon pages of delegate fuddling or loading the image inside a UIWebView as a bit of a hack... I can't believe the solution was really this simple!! Thank you!!
  •  
  • Bryan Switalski 1 year ago
    This is great!
    Is there a way to make an initial image size so that the user can zoom in from there
    My project includes a rather large image and We want the user to see the whole page first before zooming in...then if the user chooses to view the image in depth they have that option
  •  
This conversation is missing your voice. Take five seconds to join Vimeo or log in.

Advertisement

About this video

FLV
00:08:37
  • 1280x784, 17.2MB
  • Uploaded Sun August 31, 2008
  • Please join or log in to download

Statistics

Date Plays Comments
Totals 90.7K 46 29
Feb 14th 46 0 0
Feb 13th 59 0 0
Feb 12th 31 0 0
Feb 11th 13 0 0
Feb 10th 25 0 0
Feb 9th 55 0 0
Feb 8th 53 0 0

Related lessons from Vimeo Video School

Check out these lessons to learn more about how you can make videos like this one!