Javaだとenumで実装することもあるのでSwiftではこんな感じ?
enum Singleton {
case INSTANCE
func hello() {
println("Hello, My First Singleton!")
}
}
let singleton = Singleton.INSTANCE;
singleton.hello()
Go to list of users who liked
More than 5 years have passed since last update.
Javaだとenumで実装することもあるのでSwiftではこんな感じ?
enum Singleton {
case INSTANCE
func hello() {
println("Hello, My First Singleton!")
}
}
let singleton = Singleton.INSTANCE;
singleton.hello()
Register as a new user and use Qiita more conveniently
Go to list of users who liked