Skip to content

Commit 4b2f829

Browse files
committed
Update demo app
1 parent fbeaa15 commit 4b2f829

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

Demo/app/src/main/swift/MainActivity.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ private extension MainActivity {
8989
log("Found: \(result)")
9090
results[result.id] = result
9191
}
92-
// Update UI
93-
await updateListView()
9492
}
9593
catch {
9694
log("Error: \(error.localizedDescription)")
@@ -116,23 +114,20 @@ private extension MainActivity {
116114
#endif
117115
}
118116

119-
@MainActor
120117
func updateListView() {
121118
let results = results.keys.sorted().map { $0.description }
122119
setListView(results)
123120
}
124121

125122
func setRootView() {
126-
setListView([])
123+
setTextView()
127124
}
128125

129126
func setTextView() {
130127
let linearLayout = LinearLayout(self)
131128
linearLayout.orientation = .vertical
132129
linearLayout.gravity = .center
133130
linearLayout.addView(textView)
134-
configureButton()
135-
linearLayout.addView(button)
136131
setRootView(linearLayout)
137132
// update view on timer
138133
Task { [weak self] in
@@ -305,7 +300,12 @@ private extension MainActivity {
305300
@MainActor
306301
func updateTextView() {
307302
log("\(self).\(#function)")
308-
textView.text = "Hello Swift!\n\(Date().formatted(date: .numeric, time: .complete))"
303+
let results = results.keys.sorted().map { $0.description }
304+
var text = "Hello Swift!\n\(Date().formatted(date: .numeric, time: .complete))"
305+
for result in results {
306+
text += "\n\(result)"
307+
}
308+
textView.text = text
309309
}
310310

311311
func setTabBar() {

0 commit comments

Comments
 (0)