-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hemanta Sapkota
committed
May 4, 2015
1 parent
2014900
commit bfc2725
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// SwiftStore.swift | ||
// SwiftStore | ||
// | ||
// Created by Hemanta Sapkota on 4/05/2015. | ||
// Copyright (c) 2015 Hemanta Sapkota. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class SwiftStore { | ||
|
||
var db:Store! | ||
|
||
init(storeName: String) { | ||
db = Store(DBName: storeName) | ||
} | ||
|
||
subscript(key: String) -> String? { | ||
get { | ||
return db.get(key) | ||
} | ||
|
||
set(newValue) { | ||
db.put(key, value: newValue!) | ||
} | ||
} | ||
} |