質問編集履歴

1

文法修正

2020/05/09 17:40

投稿

Chiaki1111
Chiaki1111

スコア15

test CHANGED
File without changes
test CHANGED
@@ -13,8 +13,6 @@
13
13
 
14
14
 
15
15
  ```
16
-
17
- Instance member 'status' cannot be used on type 'ThemeObserver'; did you mean to use a value of this type instead?
18
16
 
19
17
  Type '()' cannot conform to 'View'; only struct/enum/class types can conform to protocols
20
18
 
@@ -82,11 +80,13 @@
82
80
 
83
81
  class OpenAnnouncementObserver: ObservableObject {
84
82
 
83
+ @ObservedObject var observed = ThemeObserver()
84
+
85
85
  @Published var themeList: [String]
86
86
 
87
87
  init() {
88
88
 
89
- ForEach(ThemeObserver.status){ theme in ←ここでエラー発生
89
+ ForEach(observed.status){ theme in ←ここでエラー発生
90
90
 
91
91
  if theme.status == "announcement" { ←ここでエラー発生
92
92