mirror of
https://github.com/sudosylabs/vnidrop.git
synced 2026-08-05 02:29:55 +02:00
refactor(platform): remove Apple targets from KMP
This commit is contained in:
@@ -3,7 +3,7 @@ import Foundation
|
||||
import UIKit
|
||||
import VnidropCore
|
||||
|
||||
/// iOS file system service, ported from `FileSystemService.ios.kt`.
|
||||
/// Native iOS file system service.
|
||||
/// App-owned Documents is the fixed receive folder; custom folders are not
|
||||
/// supported because raw external picker URLs do not survive relaunch.
|
||||
struct IosFileSystemService: FileSystemService {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
/// Builds a `.vnd` invitation filename from a transfer name, mirroring the iOS
|
||||
/// helper in `TransferShareActions.ios.kt`.
|
||||
/// Builds a `.vnd` invitation filename from a transfer name.
|
||||
func invitationFileName(_ transferName: String) -> String {
|
||||
let trimmed = transferName.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
let base = trimmed.isEmpty ? "invitation" : trimmed
|
||||
|
||||
@@ -7,7 +7,7 @@ import UniformTypeIdentifiers
|
||||
@MainActor
|
||||
func makeReceiveInvitationActions() -> ReceiveInvitationActions { IosReceiveInvitationActions() }
|
||||
|
||||
/// iOS invitation acquisition, ported from `ReceiveInvitationActions.ios.kt`:
|
||||
/// iOS invitation acquisition:
|
||||
/// document picker, camera QR scanner, and NFC read.
|
||||
final class IosReceiveInvitationActions: NSObject, ReceiveInvitationActions, UIDocumentPickerDelegate {
|
||||
private var documentResult: ((Result<String, Error>) -> Void)?
|
||||
|
||||
@@ -5,7 +5,7 @@ import UIKit
|
||||
@MainActor
|
||||
func makePlatformShareActions() -> TransferShareActions { IosTransferShareActions() }
|
||||
|
||||
/// iOS invitation delivery, ported from `TransferShareActions.ios.kt`: export via
|
||||
/// iOS invitation delivery: export via
|
||||
/// document picker, native share via `UIActivityViewController`, and NFC write.
|
||||
final class IosTransferShareActions: NSObject, TransferShareActions {
|
||||
private var nfcWriter: InvitationNfcWriter?
|
||||
@@ -61,8 +61,7 @@ final class IosTransferShareActions: NSObject, TransferShareActions {
|
||||
}
|
||||
}
|
||||
|
||||
/// Writes a VniDrop invitation to a writable NDEF tag, ported from
|
||||
/// `InvitationNfcWriter` in `TransferShareActions.ios.kt`.
|
||||
/// Writes a VniDrop invitation to a writable NDEF tag.
|
||||
// Runs entirely on the NFC session's `.main` delegate queue.
|
||||
final class InvitationNfcWriter: NSObject, NFCNDEFReaderSessionDelegate, @unchecked Sendable {
|
||||
private let ticket: String
|
||||
|
||||
Reference in New Issue
Block a user