ish/app/DelayedUITask.m
Theodore Dubois 5477fdc1e6 Improve UI
Do screen updates on the next frame, animate resizing in sync with keyboard, remove status bar, transparent background for the terminal
2017-11-08 17:25:04 -08:00

36 lines
693 B
Objective-C

//
// DelayedUITask.m
// iSH
//
// Created by Theodore Dubois on 11/8/17.
//
#import "DelayedUITask.h"
@interface DelayedUITask ()
@property id target;
@property SEL action;
@property NSTimer *timer;
@end
@implementation DelayedUITask
- (instancetype)initWithTarget:(id)target action:(SEL)action {
if (self = [super init]) {
self.target = target;
self.action = action;
}
return self;
}
- (void)schedule {
if (!self.timer.valid) {
self.timer = [NSTimer timerWithTimeInterval:1.0/60 target:self.target selector:self.action userInfo:nil repeats:NO];
[NSRunLoop.mainRunLoop addTimer:self.timer forMode:NSDefaultRunLoopMode];
}
}
@end