Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating hidden/private directories FileManager Swift

Tags:

ios

swift

swift4

My app needs to have a hidden/private(if possible) folder for storing audio files that the app generates itself. This audio files are used to build Database where only the App can populate and delete if needed.

The only activity that the user is able to do is exporting some of this file in a folder called "exported" into either the share folder or the iCloud.

The question is, how do I create this hidden/private folder where a User has no permissions?

like image 809
Reimond Hill Avatar asked Oct 16 '22 23:10

Reimond Hill


1 Answers

lazy var documentsUrl:URL = { return fileManager.urls(for: .documentDirectory, in: .userDomainMask).first! }()
lazy var appInternalMusic:URL = { documentsUrl.appendingPathComponent(".InternalFolder") }()  
try! fileManager.createDirectory(at: appInternalMusic, withIntermediateDirectories: true, attributes: nil)
like image 71
Reimond Hill Avatar answered Oct 26 '22 16:10

Reimond Hill