ptsytovich

Untitled

Nov 8th, 2018
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.64 KB | None | 0 0
  1. let financeAccount = FinanceAccount(context: persistentContainer.viewContext)
  2.         financeAccount.title = "My visa card"
  3.         financeAccount.summa = 100
  4.        
  5.         let op1 = FinanceOperation(context: persistentContainer.viewContext)
  6.         op1.money = 10
  7.         op1.category = "milk"
  8.         op1.dateOperation = Date() as NSDate
  9.         financeAccount.addToFinanceOperations(op1)
  10.         let op2 = FinanceOperation(context: persistentContainer.viewContext)
  11.         op2.money = 25
  12.         op2.category = "Subway"
  13.         op2.dateOperation = Date() as NSDate
  14.         financeAccount.addToFinanceOperations(op2)
  15.         saveContext()
Advertisement
Add Comment
Please, Sign In to add comment