Skip to content

Instantly share code, notes, and snippets.

@morishin
Created April 24, 2017 05:24
Show Gist options
  • Save morishin/23e1a45824e0ae7f85cdafaa48e187f8 to your computer and use it in GitHub Desktop.
Save morishin/23e1a45824e0ae7f85cdafaa48e187f8 to your computer and use it in GitHub Desktop.
import Foundation
struct Hoge {
static var staticVar = Date()
static var staticComputedVar: Date { return Date() }
static let staticLet = Date()
static let staticLet2 = { return Date() }()
}
Hoge.staticVar == Hoge.staticVar // true
Hoge.staticComputedVar == Hoge.staticComputedVar // false
Hoge.staticLet == Hoge.staticLet // true
Hoge.staticLet2 == Hoge.staticLet2 // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment