I want to make a button appear, then I want to show it for 1 second and after that the view controller has to change. I tried my best. but it doesn't matter where I put the sleep(1); - it always does the same. It waits for 1 second, then displays the button for a very very short time and changes to the other view controller.
Can anyone help?
My code:
[self.resultButton setTitle:category forState:UIControlStateNormal];
self.resultButton.hidden = NO;
sleep(1);
UIViewController *vc = [[UIViewController alloc] init];
vc = [self.storyboard instantiateViewControllerWithIdentifier:@"mapViewControllerID"];
[self presentModalViewController:vc animated:YES];