forked from efrederickson/Multiplexer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
RASBWorkspaceFetcher.xm
31 lines (25 loc) · 934 Bytes
/
RASBWorkspaceFetcher.xm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#import "RASBWorkspaceFetcher.h"
#import <objc/runtime.h>
// IMPORTANT: DO NOT IMPORT HEADERS.H
// REASON: HEADERS.H IMPORTS THIS FILE
@interface __SBWorkspace__class_impl_dummy : NSObject
+ (id)sharedInstance;
@end
Class SBWorkspace_class_implementation_class = nil;
@implementation RASBWorkspaceFetcher
+ (Class)SBWorkspaceClass {
return SBWorkspace_class_implementation_class;
}
+ (SBWorkspace*)getCurrentSBWorkspaceImplementationInstanceForThisOS {
if ([SBWorkspace_class_implementation_class respondsToSelector:@selector(sharedInstance)]) {
return [SBWorkspace_class_implementation_class sharedInstance];
}
HBLogError(@"[ReachApp] \"SBWorkspace\" class '%s' does not have '+sharedInstance' method", class_getName(SBWorkspace_class_implementation_class));
return nil;
}
@end
%ctor {
// SBMainWorkspace: iOS 9
// SBWorkspace: iOS 8
SBWorkspace_class_implementation_class = %c(SBMainWorkspace) ?: %c(SBWorkspace);
}