mirror of
https://github.com/ish-app/ish.git
synced 2026-01-25 14:06:40 +00:00
Do screen updates on the next frame, animate resizing in sync with keyboard, remove status bar, transparent background for the terminal
36 lines
693 B
Objective-C
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
|