Develop a DataStorageManager and implement data storage using SwiftData
and SQLite
.
#17
Labels
Milestone
SwiftData
and SQLite
.
#17
Основное задание
Разработать DataStorageManager и pеализовать хранение данных с помощью SwiftData и SQLite.
ModelContainer
хранится внутриSDStorageManager
, инициализируется в момент созданияSDStorageManager
.SDStorageManager
содержит методinsert(_ item: Item)
— добавитьItem
в бд.SDStorageManager
содержит методfetch()
— получить все сохраненныеItem
в бд.SDStorageManager
содержит методdelete(_ item: Item)
— удалитьItem
в бд.SDStorageManager
содержит методupdate(_ item: Item)
— обновитьItem
в бд.Дополнительное задание 1:
fetch
, чтобыSDStorageManager
возвращал уже отсортированные и/или отфильтрованные[Item]
.Predicate
иFetchDescriptor
должна быть только внутриSDStorageManager
/ методаfetch
.Дополнительное задание 2:
SQLStorageManager
дополнительные методыfetch/insert/delete/update
(нейминг можно поменять согласно своему чувству прекрасного), которые будут осуществлять чтение/запись в файл из базыSQLite
.fetch
— получение списка всехItem
из бд.insert
— добавление в бдItem
.delete
— удаление из бдItem
.update
— обновить в бдItem
.MyTodoApp
)Settings Bundle
(формат отображения настройки выбираете на свое усмотрение — тогл, выбор хранилища галочкой и т.д.).SwiftData
.The text was updated successfully, but these errors were encountered: