mirror of
https://github.com/SoPat712/YTLitePlus.git
synced 2025-10-30 12:23:58 -04:00
26 lines
605 B
Objective-C
26 lines
605 B
Objective-C
//
|
|
// NSTimer+Blocks.m
|
|
// FLEX
|
|
//
|
|
// Created by Tanner on 3/23/17.
|
|
//
|
|
|
|
#import "NSTimer+FLEX.h"
|
|
|
|
@interface Block : NSObject
|
|
- (void)invoke;
|
|
@end
|
|
|
|
#pragma clang diagnostic ignored "-Wincomplete-implementation"
|
|
@implementation NSTimer (Blocks)
|
|
|
|
+ (instancetype)flex_fireSecondsFromNow:(NSTimeInterval)delay block:(VoidBlock)block {
|
|
if (@available(iOS 10, *)) {
|
|
return [self scheduledTimerWithTimeInterval:delay repeats:NO block:(id)block];
|
|
} else {
|
|
return [self scheduledTimerWithTimeInterval:delay target:block selector:@selector(invoke) userInfo:nil repeats:NO];
|
|
}
|
|
}
|
|
|
|
@end
|