Skip to content

Commit 6354de0

Browse files
author
Christian
committed
update sample to use new Backlink code generator
1 parent 8001591 commit 6354de0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Example/NotesExample-iOS/NotesOverviewViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class NotesOverviewViewController: UITableViewController {
2323
self.authorId = authorId
2424

2525
if let authorId = authorId {
26-
query = noteBox.query { Note.authorId == authorId }
26+
query = noteBox.query { Note.author == authorId }
2727
} else {
2828
query = noteBox.query()
2929
}

Example/Shared/Author.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import ObjectBox
66
class Author {
77
var id: Id<Author> // An `Id<Author>` is required by ObjectBox
88
var name: String
9-
var notes: ToMany<Note, Author> // Backlinks
9+
// sourcery: backlink = "author"
10+
var notes: ToMany<Note, Author>
1011

1112
// An initializer with no parameters is required by ObjectBox
1213
required init() {

0 commit comments

Comments
 (0)