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

26 Likes

  • Nick Myers 1 year 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 1 year 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 1 year ago
    thank you for this tutorial. How can i get it and view offline?
  •  
  • Nick Myers 1 year ago
    Over on the right side of the page below the play count, there should be a link to download it.
  •  
  • Nick Myers 1 year 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 1 year 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 1 year 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 1 year 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 1 year ago
    Thanks for the info. I'll definitely have to look into that.
  •  
  • JetForMe plus 1 year 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 1 year 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 10 months 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 10 months 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 10 months 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 10 months ago
    Thanks
  •  
  • Anton Sinelnyk 10 months ago
    That's really awesome and useful. I have bookmarked you and I watching your tutorials again and again. Thanks
  •  
  • Coach Roebuck 7 months 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 7 months ago
    Thanks, Coach Roebuck! That was the missing piece I was looking for to get it working.
  •  
  • Dave 6 months 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 6 months 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 6 months 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 3 months ago
    thnx nick...this tutorial was really helpful
  •  
This conversation is missing your voice. Take five seconds to join Vimeo or log in.

Advertisement

Statistics

  •  
    plays
    likes
    comments
  • Total
    plays 22.3K
    likes 26
    comments 28
  • Nov 12th
    plays 45
    likes 0
    comments 0
  • Nov 11th
    plays 63
    likes 0
    comments 0
  • Nov 10th
    plays 89
    likes 0
    comments 0
  • Nov 9th
    plays 72
    likes 0
    comments 0
  • Nov 8th
    plays 43
    likes 0
    comments 0
  • Nov 7th
    plays 43
    likes 0
    comments 0
  • Nov 6th
    plays 60
    likes 0
    comments 0
  • Nov 5th
    plays 64
    likes 0
    comments 0
Previous Week

Downloads

Please join Vimeo or log in to download the original file. It only takes a few seconds.