A library that helps developers to easily perform file-related operations. In iOS,
We write our files mainly into three directories Documents Directory, Temporary Directory, Cache Directory
Requirements
File Operations Version
0.0.15
iOS Version
10.0+
Xcode
10+
Swift
4.2
Installation
Package Manager
Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
The Package Manager is included in Swift 3.0 and above.
Create directory in document/temp/cache directory with given file name. Method returns path of the directory created
let path = try? FileOperations.createDirectory(in: .document, direcotryName: "Image")
Create directory form given URL path. Method returns path of the directory created
let documentDirectoryURL = FileOperations.getDocumentDirectoryURL().appendingPathComponent("Images")
let path = try? FileOperations.createDirectory(with: documentDirectoryURL)
Remove directory from document/temp/cache directory with given file name
File Operations Preview
A library that helps developers to easily perform file-related operations. In iOS,
Requirements
Installation
Package Manager
Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
The Package Manager is included in Swift 3.0 and above.
Directory Types
DirectoryPath defines three directories which commonly used in our iOS application
Documents Directory
Temporary Directory
Cache Directory
URL Methods
Get Document Directory URL
Get Temporary Directory URL
Get Cache Directory URL
Directory Methods
Delete all contents of Directory Path
Create directory in document/temp/cache directory with given file name. Method returns path of the directory created
Create directory form given URL path. Method returns path of the directory created
Remove directory from document/temp/cache directory with given file name
Remove directory with provided URL
Bundle Related Methods
Readt text file from bundle
Text File Operations
Create text file with file name and directory path
Create text file form path
Delete file with specified path
Contributers