我对 Swift 和 SwiftUI 非常陌生,我正在尝试编写一个 iOS 应用程序来读取文件夹,计算每个文件的哈希值,然后将它们复制到外部驱动器。
现在我正在尝试导入一个文件并计算其哈希值。但是,我总是遇到同样的错误,说我没有查看它的权限。
这是我的代码:
//
// ContentView.swift
// FileExporter
//
// Created by adrien le falher on 27/09/2020.
//
import SwiftUI
import CryptoKit
struct ContentView: View {
@State private var document: MessageDocument = MessageDocument(message: "Hello, World!")
@State private var isImporting: Bool = false
@State private var isExporting: Bool = false
@State private var isMoving: Bool = false
var body: some View {
VStack {
GroupBox(label: Text("Message:")) {
TextEditor(text: $document.message)
}
GroupBox {
HStack {
Spacer() …Run Code Online (Sandbox Code Playgroud)