@property NSTimer *timer;
self.timer = [NSTimer scheduledTimerWithTimeInterval:300.0
target:self
selector:@selector(targetMethod)
userInfo:nil
repeats:NO];
-(void) targetMethod
{
//Your code with msg "you time is over"(Use UILabel)
// Add lbl to your view
[self.view addSubview:lbl];
lbl.hidden = NO;
//If you want to hide that msg after 1.0 sec.....
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
lbl.hidden = YES;
});
}
....以下のコードで
出典
2017-11-17 09:55:00
iOS
?必要に応じてアラートやアクションシートを表示することができます。他に何があなたの要求です –