質問編集履歴
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -64,18 +64,6 @@
|
|
64
64
|
|
65
65
|
|
66
66
|
|
67
|
-
// 画像パス関連(テスト)
|
68
|
-
|
69
|
-
func getDocumentsURL() -> NSURL {
|
70
|
-
|
71
|
-
let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] as NSURL
|
72
|
-
|
73
|
-
return documentsURL
|
74
|
-
|
75
|
-
}
|
76
|
-
|
77
|
-
|
78
|
-
|
79
67
|
@IBAction func imageTapGesture(_ sender: Any) {
|
80
68
|
|
81
69
|
|
@@ -83,6 +71,36 @@
|
|
83
71
|
changeImage()
|
84
72
|
|
85
73
|
}
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
// 画像パス関連(テスト)
|
78
|
+
|
79
|
+
// DocumentディレクトリのfileURL取得
|
80
|
+
|
81
|
+
func getDocumentsURL() -> NSURL {
|
82
|
+
|
83
|
+
let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] as NSURL
|
84
|
+
|
85
|
+
return documentsURL
|
86
|
+
|
87
|
+
}
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
// ディレクトリのパスにファイル名をつなげてファイルのフルパスを作る
|
92
|
+
|
93
|
+
func fileInDocumentsDirectory(filename: String) -> String {
|
94
|
+
|
95
|
+
let fileURL = getDocumentsURL().appendingPathComponent(filename)
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
print(fileURL)
|
100
|
+
|
101
|
+
return fileURL!.path
|
102
|
+
|
103
|
+
}
|
86
104
|
|
87
105
|
|
88
106
|
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -64,6 +64,18 @@
|
|
64
64
|
|
65
65
|
|
66
66
|
|
67
|
+
// 画像パス関連(テスト)
|
68
|
+
|
69
|
+
func getDocumentsURL() -> NSURL {
|
70
|
+
|
71
|
+
let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] as NSURL
|
72
|
+
|
73
|
+
return documentsURL
|
74
|
+
|
75
|
+
}
|
76
|
+
|
77
|
+
|
78
|
+
|
67
79
|
@IBAction func imageTapGesture(_ sender: Any) {
|
68
80
|
|
69
81
|
|