I came up with the following logic, which works and is quite simple:
let aYear = 1300
func isLeap() {
if aYear % 400 == 0 {
print("YES")
} else if aYear % 4 == 0 && aYear % 100 != 0
{
print("YES")
} else {
print("NO")
}
}
isLeap()
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: