File tree 1 file changed +0
-9
lines changed 1 file changed +0
-9
lines changed Original file line number Diff line number Diff line change @@ -1087,16 +1087,9 @@ Task { @MainActor in
1087
1087
}
1088
1088
```
1089
1089
1090
- <!-- XXX TR: Should we show a detached task here instead? -->
1091
-
1092
1090
The code above is similar to
1093
1091
` downloadAndShowPhoto(named:) ` from the previous code listing,
1094
1092
but the code in this example doesn't wait for the UI update.
1095
- <!--
1096
- XXX more explanation of the difference?
1097
- Or why you'd use Task to do this kind of thing?
1098
- -->
1099
-
1100
1093
You can also write ` @MainActor ` on a structure, class, or enumeration
1101
1094
to ensure all of its methods and all access to its properties
1102
1095
to run on the main actor:
@@ -1140,8 +1133,6 @@ You'd see the same behavior if `View` were a base class
1140
1133
and ` PhotoGalleryView ` were a subclass ---
1141
1134
the subclass would be implicitly marked ` @MainActor ` .
1142
1135
1143
- <!-- XXX TR: Is there a parallel non-UI example, like for server code? -->
1144
-
1145
1136
In the examples above,
1146
1137
` PhotoGallery ` protects the entire structure on the main actor.
1147
1138
For more fine-grained control,
You can’t perform that action at this time.
0 commit comments