Files
amnezia-client/client/platforms/ios/ios_controller_wrapper.mm
2026-04-14 16:34:04 +03:00

48 lines
1.2 KiB
Plaintext

#import "ios_controller_wrapper.h"
#include "ios_controller.h"
@implementation IosControllerWrapper
- (instancetype)initWithCppController:(IosController *)controller {
self = [super init];
if (self) {
cppController = controller;
}
return self;
}
- (void)vpnStatusDidChange:(NSNotification *)notification {
NETunnelProviderSession *session = (NETunnelProviderSession *)notification.object;
if (session ) {
cppController->vpnStatusDidChange(session);
}
}
- (void) vpnConfigurationDidChange:(NSNotification *)notification {
// cppController->vpnStatusDidChange(notification);
}
@end
#if !MACOS_NE && !TARGET_OS_TV
@implementation DocumentPickerDelegate
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls {
for (NSURL *url in urls) {
if (self.documentPickerClosedCallback) {
self.documentPickerClosedCallback([url path]);
}
}
}
- (void)documentPickerWasCancelled:(UIDocumentPickerViewController *)controller {
if (self.documentPickerClosedCallback) {
self.documentPickerClosedCallback(nil);
}
}
@end
#endif