swift 创建单例模式
class func sharedInstance() -> GlobalConstant {
struct Singleton{
static var predicate:dispatch_once_t = 0
static var instance:GlobalConstant? = nil
}
dispatch_once(&Singleton.predicate,{
Singleton.instance = GlobalConstant()
}
)
return Singleton.instance!
}