Skip to content

Add MainActor attribute to AlertPresentable protocol#6

Merged
taka-2120 merged 1 commit intomainfrom
fix/protocol
Apr 28, 2025
Merged

Add MainActor attribute to AlertPresentable protocol#6
taka-2120 merged 1 commit intomainfrom
fix/protocol

Conversation

@taka-2120
Copy link
Owner

Add MainActor attribute to AlertPresentable protocol to avoid occurring Swift 6 errors.

@taka-2120 taka-2120 requested a review from Copilot April 28, 2025 14:09
@taka-2120 taka-2120 self-assigned this Apr 28, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the @mainactor attribute to the AlertPresentable protocol to prevent Swift 6 errors and demonstrates its usage in a concrete example.

  • Add @mainactor to the AlertPresentable protocol definition
  • Introduce a ContentViewModel conforming to AlertPresentable with the @mainactor attribute

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
Sources/AlertPresentable/AlertPresentableProtocol.swift Added @mainactor on the protocol to enforce main thread execution
AlertPresentableExample/AlertPresentableExample/ContentViewModel.swift New example implementing AlertPresentable with proper attributes
Files not reviewed (1)
  • AlertPresentableExample/AlertPresentableExample.xcodeproj/project.pbxproj: Language not supported

@taka-2120 taka-2120 merged commit 7af80b0 into main Apr 28, 2025
2 checks passed
@taka-2120 taka-2120 deleted the fix/protocol branch April 28, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants