mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
experimental support for set new storage path on iOS
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
import Flutter
|
||||
import UIKit
|
||||
import UniformTypeIdentifiers
|
||||
import Foundation // 添加此行
|
||||
|
||||
@main
|
||||
@objc class AppDelegate: FlutterAppDelegate, UIDocumentPickerDelegate {
|
||||
var flutterResult: FlutterResult?
|
||||
var directoryPath: URL!
|
||||
|
||||
// 定义插件通道名称
|
||||
private var directoryPicker: DirectoryPicker?
|
||||
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
@@ -42,6 +46,9 @@ import UniformTypeIdentifiers
|
||||
self.directoryPath?.stopAccessingSecurityScopedResource()
|
||||
self.directoryPath = nil
|
||||
result(nil)
|
||||
} else if call.method == "selectDirectory" {
|
||||
self.directoryPicker = DirectoryPicker()
|
||||
self.directoryPicker?.selectDirectory(result: result)
|
||||
} else {
|
||||
result(FlutterMethodNotImplemented)
|
||||
}
|
||||
|
Reference in New Issue
Block a user