Here is how to do it:
- (IBAction)buttonReact:(id)sender
{
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(100.0f,
100.0f,
100.0f,
40.0f)];
label.text = @"Your text";
[self.view addSubview:label];
}
Or you can even go crazy and add the label at random location on the screen:
- (IBAction)buttonReact:(id)sender
{
CGPoint randomLocation = CGPointMake(arc4random_uniform(CGRectGetWidth(self.view.bounds)),
arc4random_uniform(CGRectGetHeight(self.view.bounds)));
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(randomLocation.x,
randomLocation.y,
100.0f,
40.0f)];
label.text = @"Your text";
[self.view addSubview:label];
}