• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UIImageView subclasses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UIImageView subclasses


  • Subject: Re: UIImageView subclasses
  • From: Matt Neuburg <email@hidden>
  • Date: Fri, 29 Jul 2011 09:30:15 -0700

On Fri, 29 Jul 2011 00:24:56 -0500, William Squires <email@hidden> said:
>Hi all!
>  Here's what I've got: (Xcode 3.2.5 - iOS SDK 4)
>
>A view controller that dynamically creates UIImageView subclass instances as subviews in it's awakeFromNib
>
>According to the documentation, UIImageView subclasses do not enable user interaction by default, so
>
>...
>// Create a UIImageView that'll animate Number1.png through Number8.png, and load Number.png as the
>// default (non-aminating) image
>MyImageView *iv = [[MyImageView alloc] initWithBaseName:@"Number"];
>[iv setUserInteractionEnabled:YES];
>// ...
>// Don't know what to do here!
>// ...
>[self.view addSubview:iv];
>...
>
>Okay, now what?

It depends on what you want to do. Is it that you'd like to know when a UIImageView is tapped? In that case, my book tells you how (using a gesture recognizer), and you can download code that demonstrates one approach:

https://github.com/mattneub/Programming-iOS-4-Book-Examples/tree/master/p424hitTesting

m.

--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: MPMoviePlayerController Fast forward
  • Next by Date: Re: A trap with full screen in Lion
  • Previous by thread: Re: UIImageView subclasses
  • Next by thread: Drawing performance in CALayer
  • Index(es):
    • Date
    • Thread