Mercurial > public > simoleon
comparison Simoleon/Persistence.swift @ 21:c3dda63f50ed v1.1
Added Core Data and UI changes
- Implement Watchlist
- Change conversion design
- Improve UX
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Mon, 19 Jul 2021 19:27:12 +0100 |
parents | e0c2bda6c51f |
children | 933d9ab04374 |
comparison
equal
deleted
inserted
replaced
20:f8aabe5b7251 | 21:c3dda63f50ed |
---|---|
14 let result = PersistenceController(inMemory: true) | 14 let result = PersistenceController(inMemory: true) |
15 let viewContext = result.container.viewContext | 15 let viewContext = result.container.viewContext |
16 for _ in 0..<10 { | 16 for _ in 0..<10 { |
17 let newItem = Item(context: viewContext) | 17 let newItem = Item(context: viewContext) |
18 newItem.timestamp = Date() | 18 newItem.timestamp = Date() |
19 } | |
20 | |
21 for _ in 0..<10 { | |
22 let favourite = Favourite(context: viewContext) | |
23 favourite.currencyPair = "USD/GBP" | |
19 } | 24 } |
20 do { | 25 do { |
21 try viewContext.save() | 26 try viewContext.save() |
22 } catch { | 27 } catch { |
23 // Replace this implementation with code to handle the error appropriately. | 28 // Replace this implementation with code to handle the error appropriately. |