Answer the question
In order to leave comments, you need to log in
How to correctly build a database structure for a program?
I am writing a program - reader. Main page:
Pages:
The first one is the main one.
The second is favorites.
The third is a global search (via the server).
On the main page, I show popular (also gives the server) and recent (follow the user).
The problem is that I don't know how to correctly build a model for storing data about books, because:
1) I have two related (by the meaning of uicollectionview) on the main page, because if the user selects a book in the PopularCollectionview, and does her favorite, then I want the RecentCollectionView to be updated (if it has such a Cell (Book), and that it also be with an asterisk). How to do it?:
2) I operate with the following arrays: allBooks (if the user views a book from a global search, it will be added to this array, since it should appear in at least recent ones), recentBooks (add recent), favoriteBooks(favorites), popularBooks (get from the server ). It is possible to make one entity in Core Data - allBooks. It will contain the following additional variables:
var isFavorite:Bool = false
var isRecent:Bool = false
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question