title: Detecting background tap
body: <p>I'm busy with an app you need to touch a button, but when u touch outside the button (on the background of the app screen) i want to display an alert.</p>
  
  <p>Does anyone know how to detect an tap on the background </p>
  
  <p>Button:</p>
  
  <pre><code>   MyButton = [UIButton buttonWithType:UIButtonTypeCustom];
      MyButton.frame = CGRectMake(0, 0, 100, 100);
      [MyButton setImage:[UIImage imageNamed:@"tap.png"] forState:nil];
      [self.view addSubview:MyButton];
  
      [MyButton addTarget:self action:@selector(buttonPressed) forControlEvents:UIControlEventTouchUpInside];
  </code></pre>