Skip to content

Latest commit

 

History

History
54 lines (33 loc) · 2.09 KB

README.md

File metadata and controls

54 lines (33 loc) · 2.09 KB

RxGRDBDemo

This demo application uses Action, RxDataSources, RxGRDB, and RxSwift to synchronize its view with the content of the database.

To play with it:

  1. Download the RxGRDB repository
  2. Run pod install
  3. Open RxGRDB.xcworkspace at the root of the repository
  4. Run the RxGRDBDemo application.

The rows of the players table view animate as you change the players ordering, delete all players, or refresh them (refreshing applies random transformations to the database)

Models

  • AppDatabase.swift

    AppDatabase defines the database for the whole application. It uses DatabaseMigrator in order to setup the database schema.

  • Player.swift

    Player is 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.

    struct Player: Codable, Equatable {
        var id: Int64?
        var name: String
        var score: Int
    }
  • Players.swift

    Players defines read and write operations on the players database.

User Interface