Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. // Type Properties
  2. // Exemplo de Propriedade Computada de Classe
  3.  
  4. import Foundation
  5.  
  6. class Calendario {
  7. class var anoAtual: Int {
  8. let agora = NSDate()
  9. let componentes: NSDateComponents =
  10. NSCalendar.currentCalendar().components(
  11. .CalendarUnitYear, fromDate: agora)
  12. let ano: Int = componentes.year
  13. return ano
  14. }
  15. }
  16.  
  17. Calendario.anoAtual
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement