SWFファイル内の画像を表示/書き出しするGUIツール
修訂 | 9a13939d4dfd017378c32672aef570f468f5e2c8 (tree) |
---|---|
時間 | 2016-10-02 13:48:12 |
作者 | masakih <masakih@user...> |
Commiter | masakih |
HMTemporaryDirectoryをstructに変更
@@ -80,7 +80,7 @@ class HMSwfDocument: NSDocument { | ||
80 | 80 | } |
81 | 81 | |
82 | 82 | override func close() { |
83 | - temporaryDirectory = nil | |
83 | + temporaryDirectory?.cleanUp() | |
84 | 84 | } |
85 | 85 | |
86 | 86 | func actionTarget() -> HMSwfImage? { |
@@ -12,7 +12,7 @@ enum HMTemporaryDirectoryError : Error { | ||
12 | 12 | case CoanNotCreateDirectory |
13 | 13 | } |
14 | 14 | |
15 | -class HMTemporaryDirectory: NSObject { | |
15 | +struct HMTemporaryDirectory { | |
16 | 16 | let url: URL |
17 | 17 | |
18 | 18 | init(name: String) throws { |
@@ -32,7 +32,7 @@ class HMTemporaryDirectory: NSObject { | ||
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | - deinit { | |
35 | + func cleanUp() { | |
36 | 36 | do { |
37 | 37 | try FileManager().removeItem(at: url) |
38 | 38 | } catch { |