StorageManager - FileManager framework that handels Store, fetch, delete and update files in local storage

Overview

StorageManager

CI Status Version License Platform

banner

FileManager framework that handels Store, fetch, delete and update files in local storage.

Requirements

  • iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 10.2+
  • Swift 5.0+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1+ is required to build StorageManager.

To integrate StorageManager into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '' do
    pod 'StorageManager'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate StorageManager into your Xcode project using Carthage, specify it in your Cartfile:

0.1.2 ">
github "iAmrSalman/StorageManager" ~> 0.1.2

Run carthage update to build the framework and drag the built StorageManager.framework into your Xcode project.

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is in early development, but StorageManager does support its use on supported platforms.

Once you have your Swift package set up, adding StorageManager as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/iAmrSalman/StorageManager.git", from: "0.1.2")
]

Usage

Store

Dictionary:
let exampleDictionary = ["foo": "bar", "x": 3, "pi": 3.1415, "names": ["Amr", "Salman"]]

try! StorageManager.default.store(dictionary: exampleDictionary, in: "exampleDictionary")
Array:
let exampleArray = ["foo", "bar", "x", "y"]

try! StorageManager.default.store(dictionary: exampleArray, in: "exampleArray")
Data:
let exampleData = Data()

try! StorageManager.default.store(data: exampleData, jsonType: .array, in: "exampleData")

Update

let newX = 5

try! StorageManager.default.update(vlaue: newX, forKey: "x", in: "exampleDictionary")

Delete

try! StorageManager.default.clear("exampleData")

Fetch

Single value
let x: Int = try! StorageManager.default.singleValue(forKey: "x", in: "exampleDictionary")
Array
let exampleArray: [String] = try! StorageManager.default.arrayValue("exampleArray")
Array as value for key
let names: [String] = try! StorageManager.default.arrayValue(forKey: "names", in: "exampleDictionary")
Dictionary
let exampleDictionary: [String: Any] = try! StorageManager.default.dictionaryValue("exampleDictionary")

Author

Amr Salman, [email protected]

License

StorageManager is available under the MIT license. See the LICENSE file for more info.

You might also like...
Check and update  app's version for both AppStore & Fir
Check and update app's version for both AppStore & Fir

VersionUpdate Check and update app's version for both AppStore & Fir How to use Add Channel in info.plist Now we only support two channels "AppStore"

🛶Shallows is a generic abstraction layer over lightweight data storage and persistence.

Shallows Shallows is a generic abstraction layer over lightweight data storage and persistence. It provides a StorageKey, Value type, instances of w

Disk is a powerful and simple file management library built with Apple's iOS Data Storage Guidelines in mind
Disk is a powerful and simple file management library built with Apple's iOS Data Storage Guidelines in mind

Disk is a powerful and simple file management library built with Apple's iOS Data Storage Guidelines in mind

Your Data Storage Troubleshooter 🛠
Your Data Storage Troubleshooter 🛠

Your Data Storage Troubleshooter 🛠 Introduction StorageKit is a framework which reduces the complexity of managing a persistent layer. You can easily

An elegant, fast, thread-safe, multipurpose key-value storage, compatible with all Apple platforms.
An elegant, fast, thread-safe, multipurpose key-value storage, compatible with all Apple platforms.

KeyValueStorage An elegant, fast, thread-safe, multipurpose key-value storage, compatible with all Apple platforms. Supported Platforms iOS macOS watc

rTracker is a complete iOS application for creating local on-device databases ('trackers') to log data with timestamps.
rTracker is a complete iOS application for creating local on-device databases ('trackers') to log data with timestamps.

rTracker is a complete iOS application for creating local on-device databases ('trackers') to log data with timestamps. Trackers can use a va

Store and retrieve Codable objects to various persistence layers, in a couple lines of code!
Store and retrieve Codable objects to various persistence layers, in a couple lines of code!

tl;dr You love Swift's Codable protocol and use it everywhere, who doesn't! Here is an easy and very light way to store and retrieve Codable objects t

macOS App for App Store Connect to Improve Processing Efficiency and Enjoy the Party.
macOS App for App Store Connect to Improve Processing Efficiency and Enjoy the Party.

Apple Party(苹果派) 一、App 介绍 AppleParty 是三七互娱旗下37手游 iOS 团队研发,实现快速操作 App Store Connect 后台的自动化 macOS 工具。 使用和原理介绍:开源一款苹果 macOS 工具 - AppleParty(苹果派) 支持功能 内购买

Classes-and-structures-in-swift - This source files show what is the difference between class and structure

This source files show what is the difference between class and structure You ca

Comments
  • Generic parameter 'T' could not be inferred

    Generic parameter 'T' could not be inferred

    When I call this code : let exampleArray_get = try! StorageManager.default.arrayValue("exampleArray") I get a error : Generic parameter 'T' could not be inferred How to fix it ps: Xcode version 10.3, swift 5.0 ths

    opened by umangoo 1
Owner
Amr Salman
iOS Developer & Swift enthusiast
Amr Salman
pick the voice from the local storage.you can play and pause the voice

flutter_add_voice A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you starte

Mehrab Bozorgi 1 Nov 27, 2021
Easiest local storage library in Swift

SundeedQLite SundeedQLite is the easiest offline database integration, built using Swift language Requirements iOS 12.0+ XCode 10.3+ Swift 5+ Installa

Nour Sandid 15 Sep 23, 2022
An Objective-C wrapper for RocksDB - A Persistent Key-Value Store for Flash and RAM Storage.

ObjectiveRocks ObjectiveRocks is an Objective-C wrapper of Facebook's RocksDB - A Persistent Key-Value Store for Flash and RAM Storage. Current RocksD

Iskandar Abudiab 56 Nov 5, 2022
💾 Safe, statically-typed, store-agnostic key-value storage written in Swift!

Storez ?? Safe, statically-typed, store-agnostic key-value storage Highlights Fully Customizable: Customize the persistence store, the KeyType class,

Kitz 67 Aug 7, 2022
Typed key-value storage solution to store Codable types in various persistence layers with few lines of code!

?? Stores A typed key-value storage solution to store Codable types in various persistence layers like User Defaults, File System, Core Data, Keychain

Omar Albeik 94 Dec 31, 2022
Web server serving local files

swift-web A web server serving local static files. Installation Using Mint The easiest way to install swift-web is via mint. mint install adam-fowler/

Adam Fowler 10 Dec 10, 2022
Movies Information DataBase (Add - Delete - Edit - Search)

MoviesInformation Movies Information DataBase (Add - Delete - Edit - Search) This Code Provide Simple Program About Movies Information This Program Ca

Mohammad Jaha 2 Sep 15, 2021
Swipe to delete for UIStackViews

SwipeableMenuView Swipe to delete for UIStackViews This looks/works similar like the normal UITableView swipe to delete behavior. In the example below

Christian Schwindt 6 Apr 22, 2022
An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.

中文版本请参看这里 MMKV is an efficient, small, easy-to-use mobile key-value storage framework used in the WeChat application. It's currently available on Andr

Tencent 15.4k Jan 6, 2023
A Swift library to fetch the schema from a SQLite3 database.

SQLite3Schema A small library to fetch the schema of a SQLite database. Contains a SQLite3 helper module for Linux. TBD. Uses just the raw SQLite API.

Helge Heß 4 Sep 17, 2022