Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6fe7d6e

Browse files
Update README.md
1 parent 3e81716 commit 6fe7d6e

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

‎README.md‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,11 @@ To ensure .play is applied before .pause, you can use `Task` to schedule the sec
170170
```swift
171171
playbackCommand = .play
172172

173-
Task {
173+
Task {@MainActor
174174
playbackCommand = .pause
175175
Task { playbackCommand = .play } // This runs AFTER `.pause`
176176
}
177177
```
178-
If playbackCommand is critical for playback logic, use an ObservableObject with @Published instead of @State. This avoids SwiftUI’s state batching
179-
```swift
180-
@Published var playbackCommand: PlaybackCommand = .pause
181-
```
182-
then works
183-
```swift
184-
playbackCommand = .play
185-
playbackCommand = .pause
186-
```
187178

188179
### Handling Sequential Similar Commands
189180

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /