| .. | ||
| GRDBDemoiOS | ||
| GRDBDemoiOS.xcodeproj | ||
| GRDBDemoWatchOS | ||
| GRDBDemoWatchOS Extension | ||
| README.md | ||
Demo Application
This demo application shows you:
- how to setup a database in an iOS app
- how to define a simple Codable Record
- how to track database changes and animate a table view with FetchedRecordsController.
Files of interest:
-
AppDelegatecreates, on application startup, a unique instance of DatabaseQueue available for the whole application. -
AppDatabasedefines the database for the whole application. It uses DatabaseMigrator in order to setup the database schema. -
Playeris a Record type, able to read and write in the database. It conforms to the standard Codable protocol in order to gain all advantages of Codable Records. -
PlayersViewControllerdisplays a list of players. It keeps its title up-to-date with ValueObservation, and animates its table view according to database changes with FetchedRecordsController. -
PlayerEditionViewController.swift
PlayerEditionViewControllercan create or edit a player, and save it in the database.