title: UIButton selected state change image
body: <p>I know this should be very simple but since I really have looked around here and on google without getting my code to work I will ask. Yes, I have checked related questions and they does not work...</p>
  
  <p>I simply want to change the image of the button when it is pressed. </p>
  
  <p>This is my header file:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface ViewController : UIViewController
  
  @property (strong, nonatomic) IBOutlet UIButton *myButton;
  
  @end
  </code></pre>
  
  <p>And my implementation file:</p>
  
  <pre><code>#import "ViewController.h"
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  
  - (void)viewDidLoad {
  [super viewDidLoad];
  
      [self.myButton setImage:[UIImage imageNamed:@"normal.png"] forState:UIControlStateNormal];
      [self.myButton setImage:[UIImage imageNamed:@"selected.png"] forState:UIControlStateSelected];
  
  }
  @end
  </code></pre>
  
  <p>The button is built and connected in Main.storyBoard and I have also tried to do it in the attributes inspector but neither way worked!</p>
  
  <p><img src="https://i.stack.imgur.com/eSH6D.png" alt="enter image description here"></p>
  
  <p>Please note that I am not looking for how to do highlighted state but selected.</p>