Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.84 KB | None | 0 0
  1. import UIKit
  2.  
  3. enum Importance{
  4.     case unimportant
  5.     case common
  6.     case important
  7. }
  8.  
  9. struct Note{
  10.     let uid, title, content: String
  11.     let color: UIColor
  12.     let importance: Importance
  13.     let selfDestructionDate: Date?
  14.    
  15.     init(uid: String = UUID().uuidString, title: String, content: String, color: UIColor = UIColor.white, importance: Importance, selfDestructionDate: Date? = nil) {
  16.         self.uid = uid
  17.         self.title = title
  18.         self.content = content
  19.         self.color = color
  20.         self.importance = importance
  21.         self.selfDestructionDate = selfDestructionDate
  22.     }
  23. }
  24.  
  25. var a = Note(uid: "uid", title: "title", content: "content", color: UIColor.black, importance: Importance.important)
  26. print(a)
  27. var b = Note(title: "title2", content: "content2", importance: Importance.unimportant)
  28. print(b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement