-
Notifications
You must be signed in to change notification settings - Fork 0
/
SDLUIKitDelegate.mm
37 lines (31 loc) · 1.02 KB
/
SDLUIKitDelegate.mm
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
32
33
34
35
36
37
#import <UIKit/UIKit.h>
#import <FBSDKCoreKit/FBSDKApplicationDelegate.h>
#import <VKSdk/VKSdk.h>
#import <SDLUIKitDelegate.h>
extern "C" {
#include <SDL_video.h>
#include <SDL_dropevents_c.h>
}
@implementation SDLUIKitDelegate(ProjectSDLUIKitDelegate)
- (void)sendDropFileForURL:(NSURL *)url {
NSURL *fileURL = url.filePathURL;
if (fileURL != nil) {
SDL_SendDropFile(NULL, fileURL.path.UTF8String);
} else {
SDL_SendDropFile(NULL, url.absoluteString.UTF8String);
}
SDL_SendDropComplete(NULL);
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
NSLog(@"openURL");
[[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation];
[VKSdk processOpenURL:url fromApplication:sourceApplication];
[self sendDropFileForURL:url];
return YES;
}
@end
@implementation ProjectSDLUIKitDelegate
@end