I'm new to Swift. I don't understand what's the purpose of self.seconds = seconds in the following example:
class Time {
var seconds:Double = 0
init(seconds: Double) {
self.seconds = seconds
}
var minutes: Double {
get {
return (seconds / 60)
}
set {
self.seconds = (newValue * 60)
}
}
var hours: Double {
get {
return (seconds / (60 * 60))
}
set {
self.seconds = (newValue * (60 * 60))
}
}
}
According to xcode 'self.seconds' is a variable and 'seconds' is a let constant. I'm confused. Any thoughts ?