-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBaseClass.swift
47 lines (28 loc) · 946 Bytes
/
BaseClass.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// BaseClass.swift
// StarCard
//
// Created by 雅风 on 16/7/23.
// Copyright © 2016年 星夜暮晨. All rights reserved.
//
import Foundation
open class BaseClass {
func cacheSetString(_ key:String,value:String) {
let userInfo = UserDefaults()
userInfo.setValue(value, forKey: key)
}
func cacheGetString(_ key:String) -> String {
let userInfo = UserDefaults()
let tmpSign = userInfo.string(forKey: key)
return tmpSign!
}
func cacheSetArray(_ key:String,value:AnyObject) {
let userInfo = UserDefaults()
userInfo.setValue(value, forKey: key)
}
func cacheGetArray(_ key:String) -> AnyObject {
let userInfo = UserDefaults()
let tmSign = userInfo.object(forKey: key)
return tmSign! as AnyObject
}
}