Git Product home page Git Product logo

ytkkeyvaluestore_swift's Introduction

YTKKeyValueStore

CocoaPods Version Platform Carthage compatible License MIT

objc version ๏ผšhttps://github.com/yuantiku/YTKKeyValueStore

Requirements

  • iOS 8.0+
  • Xcode 7.0
  • Swift 2.0

Usage

import YTKKeyValueStore

YTKKeyValueStore

var store = try! YTKKeyValueStore("test.db")   // create or open the key-value store

try! store.createTable("User")    // create table

let table = store["User"]      // get table (YTKTable)

try! store.dropTable("User")    // drop table

YTKTable

let isExists = table.isExists

try! table.put( "name" <- "sgxiang")     // put value("sgxiang") for key("name") into table , support string,number,dictionary,array


let objct = try! table.get("name")    // get object with key , return YTKObject?
let item = try! table.getItem("name")   // get item with key ,return YTKItem?
let allItems = try! table.getAllItems()  // get all item with key , return  [YTKItem]?


try! table.clear()  // clear table
try! table.delete("name1","name2")   // delete row where key == "name1" and "name2"
try! table.deletePreLike("name")   // delete row where key pre like "name"

YTKItem

itemId       :   itemKey
itemObject   :   itemValue , is json string
createdTime  :   item created time

YTKObject

objectValue       :     return  AnyObject?
stringValue       :     return  String?
numberValue       :     return  NSNumber?
dictionaryValue   :     return  Dictionary<String , AnyObject>?
arrayValue        :     return  Array<AnyObject>?

Installation

Carthage

Update Cartfile to include the following:

github "sgxiang/YTKKeyValueStore_Swift" ~> 0.3.4

Run carthage update and add the appropriate framework.

CocoaPods

Update Podfile to include the following:

use_frameworks!

pod 'YTKKeyValueStore_Swift', '~> 0.3.4'

Run pod install

Embedded Framework

  • Add YTKKeyValueStore as a submodule by opening the Terminal, cd-ing into your top-level project directory, and entering the following command:
$ git submodule add https://github.com/Sgxiang/YTKKeyValueStore_Swift.git
  • Open the YTKKeyValueStore folder, and drag YTKKeyValueStore.xcodeproj into the file navigator of your app project.

  • In Xcode, navigate to the target configuration window by clicking on the blue project icon, and selecting the application target under the "Targets" heading in the sidebar.

  • Ensure that the deployment target of YTKKeyValueStore.framework matches that of the application target.

  • In the tab bar at the top of that window, open the "Build Phases" panel. Expand the "Target Dependencies" group, and add YTKKeyValueStore.framework.

  • Click on the + button at the top left of the panel and select "New Copy Files Phase". Rename this new phase to "Copy Frameworks", set the "Destination" to "Frameworks", and add YTKKeyValueStore.framework.

Communication

Author

ytkkeyvaluestore_swift's People

Contributors

sgxiang avatar victorteokw avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.