extension Season { static var current: Season { let calendar = Calendar.current let date = Date() let dateComponents = calendar.dateComponents([.year], from: date) return dateComponents.year! } static var all: [Season] { let current: Season = .current return Array(1950...current).reversed() } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter