Skip to content

Provides helpful extensions and rich features build on top of Foundation framework.

License

Notifications You must be signed in to change notification settings

swiftkits/CoreFoundationKit

Repository files navigation

CoreFoundationKit

MIT license CoreUIKit CI workflow Pod Carthage SPM

CoreFoundationKit provides helpful extensions and rich features build on top of Foundation framework.

Installation

Cocoapods

CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. Learn More!

pod 'CoreFoundationKit', '0.1.0'

Swift package manager

The 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. Learn More!

dependencies: [
    .package(url: "https://github.com/swiftkits/CoreFoundationKit.git", .upToNextMajor(from: "0.1.0"))
]

Carthage

A simple, decentralized dependency manager for Cocoa. Learn More!

github "CoreFoundationKit" ~> 0.1.0

Documentation

Examples

  • How to setup FileOperation
let manager = FileManager.default
let rootDir = try! manager.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false)

let directoryOperation = FileDirectoryOperation(manager: manager, rootDir: rootDir)
let fileOperations = FileOperation(directoryManager: directoryOperation)
  • How to save file data into local file storage
let savedFile = try fileOperations.save(contentsOf: imageData, with: fileName)

//
// Returns
// FileItem with saved file info
//

savedFile.location // Local storage url of the file
savedFile.name     // Name of the file
savedFile.data     // data of the file
  • How delete file from local storage
try fileOperations.deleteFile(at: localFileURL)
  • How to fetch the saved file from local storage
try fileOperations.getFile(at: localFileURL)

Learn

Following are the useful links for learning about autolayout.

Author

Written By Manish Pandey.

About

Provides helpful extensions and rich features build on top of Foundation framework.

Resources

License

Stars

Watchers

Forks