Re: UIImageView subclasses
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