mirror of
https://github.com/StikDebug/StikDebug.git
synced 2026-10-16 12:30:29 +00:00
Fix File Importer
This commit is contained in:
parent
f468d03e4b
commit
984a43ba47
3 changed files with 12 additions and 3 deletions
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
import em_proxy
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
@main
|
||||
struct HeartbeatApp: App {
|
||||
|
|
@ -40,7 +41,7 @@ struct HeartbeatApp: App {
|
|||
startHeartbeatInBackground()
|
||||
}
|
||||
}
|
||||
.fileImporter(isPresented: $isPairing, allowedContentTypes: [.item]) {result in
|
||||
.fileImporter(isPresented: $isPairing, allowedContentTypes: [UTType(filenameExtension: "mobiledevicepairing", conformingTo: .data)!, .propertyList]) {result in
|
||||
switch result {
|
||||
|
||||
case .success(let url):
|
||||
|
|
|
|||
|
|
@ -6,6 +6,13 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
extension UIDocumentPickerViewController {
|
||||
@objc func fix_init(forOpeningContentTypes contentTypes: [UTType], asCopy: Bool) -> UIDocumentPickerViewController {
|
||||
return fix_init(forOpeningContentTypes: contentTypes, asCopy: true)
|
||||
}
|
||||
}
|
||||
|
||||
struct HomeView: View {
|
||||
@AppStorage("username") private var username = "User"
|
||||
|
|
@ -61,7 +68,7 @@ struct HomeView: View {
|
|||
.onReceive(timer) { _ in
|
||||
refreshBackground()
|
||||
}
|
||||
.fileImporter(isPresented: $isShowingPairingFilePicker, allowedContentTypes: [.item]) {result in
|
||||
.fileImporter(isPresented: $isShowingPairingFilePicker, allowedContentTypes: [UTType(filenameExtension: "mobiledevicepairing", conformingTo: .data)!, .propertyList]) {result in
|
||||
switch result {
|
||||
|
||||
case .success(let url):
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
struct SettingsView: View {
|
||||
@AppStorage("username") private var username = "User"
|
||||
|
|
@ -111,7 +112,7 @@ struct SettingsView: View {
|
|||
.font(.bodyFont)
|
||||
.accentColor(.accentColor)
|
||||
}
|
||||
.fileImporter(isPresented: $isShowingPairingFilePicker, allowedContentTypes: [.item]) {result in
|
||||
.fileImporter(isPresented: $isShowingPairingFilePicker, allowedContentTypes: [UTType(filenameExtension: "mobiledevicepairing", conformingTo: .data)!, .propertyList]) {result in
|
||||
switch result {
|
||||
|
||||
case .success(let url):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue