title: iOS Display Different Image on Click
body: <p>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.</p>
  
  <pre><code>-(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;
  }
  }
  </code></pre>