add iOS AppDelegate interface to app_delegate.h

This commit is contained in:
scawful
2024-08-02 15:34:06 -04:00
parent 45941ec24c
commit bf47e5ee99
2 changed files with 23 additions and 5 deletions

View File

@@ -1,7 +1,26 @@
#ifndef YAZE_APP_CORE_PLATFORM_APP_DELEGATE_H #ifndef YAZE_APP_CORE_PLATFORM_APP_DELEGATE_H
#define YAZE_APP_CORE_PLATFORM_APP_DELEGATE_H #define YAZE_APP_CORE_PLATFORM_APP_DELEGATE_H
#ifdef TARGET_OS_MAC #if defined(__APPLE__) && defined(__MACH__)
/* Apple OSX and iOS (Darwin). */
#import <CoreText/CoreText.h>
#include <TargetConditionals.h>
#if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
/* iOS in Xcode simulator */
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate, UIDocumentPickerDelegate>
@property (strong, nonatomic) UIWindow *window;
@property UIDocumentPickerViewController *documentPicker;
@property (nonatomic, copy) void (^completionHandler)(NSString *selectedFile);
- (void)presentDocumentPickerWithCompletionHandler:(void (^)(NSString *selectedFile))completionHandler;
@end
#elif TARGET_OS_MAC == 1
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -15,4 +34,6 @@ void InitializeCocoa();
#endif // TARGET_OS_MAC #endif // TARGET_OS_MAC
#endif // defined(__APPLE__) && defined(__MACH__)
#endif // YAZE_APP_CORE_PLATFORM_APP_DELEGATE_H #endif // YAZE_APP_CORE_PLATFORM_APP_DELEGATE_H

View File

@@ -11,12 +11,9 @@
#import <CoreText/CoreText.h> #import <CoreText/CoreText.h>
#if TARGET_IPHONE_SIMULATOR == 1 #if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
/* iOS in Xcode simulator */ /* iOS in Xcode simulator */
#elif TARGET_OS_IPHONE == 1
/* iOS */
#elif TARGET_OS_MAC == 1 #elif TARGET_OS_MAC == 1
/* macOS */ /* macOS */
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>