I made this simple extension in Swift:
extension DispatchQueue {
func asyncAfter(delay: TimeInterval, block: @escaping ()->()) {
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: block)
}
}
In Project-Swift.h header it reports error at this line:
@interface OS_dispatch_queue (SWIFT_EXTENSION(...))
- (void)asyncAfterDelay:(NSTimeInterval)delay block:(void (^ _Nonnull)(void))block;
@end
Error is: Cannot find interface declaration for 'OS_dispatch_queue'
Is there a way to prevent extension being exported for Objective-C? Or is there a way to fix the error?