ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - iAmrSalman/StorageManager: Safe and easy way to use FileManager as Database
Safe and easy way to use FileManager as Database. Contribute to iAmrSalman/StorageManager development by creating an account on GitHub.
Visit Site

GitHub - iAmrSalman/StorageManager: Safe and easy way to use FileManager as Database

GitHub - iAmrSalman/StorageManager: Safe and easy way to use FileManager as Database

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 '<Your Target Name>' 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:

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.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory