iOS Display Different Image on Click
Posted
by
user1506841
on Stack Overflow
See other posts from Stack Overflow
or by user1506841
Published on 2012-09-08T03:01:27Z
Indexed on
2012/09/08
3:38 UTC
Read the original article
Hit count: 112
Using XCode, I am trying to figure out how to display a different image when someone clicks or presses down on one of my buttons before being taken to a second screen. For example, I have a contact icon on my home screen. When a user clicks the icon, it should change to a darker version on tap before going to the contact screen. Any help is appreciated.
-(IBAction) ButtonPressed :(id)sender
{
UIButton *tempButton = (UIButton *) sender;
int tag = tempButton.tag;
NSString *viewName;
switch (tag)
{
case 1:
[FlurryAnalytics logEvent:@"Contact-Screen"];
viewName = @"ContactScreen";
if( self.appDelegate.sound)
[Click play];
[self.appDelegate moveToView:viewName];
break;
}
}
© Stack Overflow or respective owner