2 // ApplicationDirecroriesExtension.swift
5 // Created by Hori,Masaki on 2018/04/16.
6 // Copyright © 2018年 Hori,Masaki. All rights reserved.
9 extension ApplicationDirecrories {
11 static let screenshotSaveDirectoryURL: URL = {
13 let parentURL = URL(fileURLWithPath: AppDelegate.shared.screenShotSaveDirectory)
14 let url = parentURL.appendingPathComponent(localizedAppName())
15 let fm = FileManager.default
16 var isDir: ObjCBool = false
20 if !fm.fileExists(atPath: url.path, isDirectory: &isDir) {
22 try fm.createDirectory(at: url, withIntermediateDirectories: false)
24 } else if !isDir.boolValue {
26 print("\(url) is regular file, not direcory.")
33 print("Can not create screenshot save directory.")