← Back to notebook index

Notebook Topic

Data Persistence

English topic guide inspired by the original iOS Developer Notebook, expanded for both iOS and Android teams.

What this topic covers

Execution checklist

iOS implementation notes

Android implementation notes

Code examples

Swift

@Model final class TaskItem {
  var title: String
  var done: Bool
  init(title: String, done: Bool = false) { self.title = title; self.done = done }
}

Kotlin

@Entity data class TaskEntity(@PrimaryKey val id: String, val title: String, val done: Boolean)
@Dao interface TaskDao { @Query("SELECT * FROM TaskEntity") suspend fun all(): List }

Reference links

Related topics