Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Swift compatibility for main thread delegate methods #159

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Sources/AardvarkMailUI/ARKEmailBugReporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@required

/// Called on the main thread when a bug is filed. The key/value pairs in the returned dictionary will be appended to the bug report below the prefilledEmailBody.
- (nullable NSDictionary *)emailBodyAdditionsForEmailBugReporter:(nonnull ARKEmailBugReporter *)emailBugReporter;
- (nullable NSDictionary *)emailBodyAdditionsForEmailBugReporter:(nonnull ARKEmailBugReporter *)emailBugReporter NS_SWIFT_UI_ACTOR;

@end

Expand All @@ -41,16 +41,16 @@
@required

/// Called on the main thread when a bug is filed. When not implemented, all log stores added to the bug reporter will be included.
- (BOOL)emailBugReporter:(nonnull ARKEmailBugReporter *)emailBugReporter shouldIncludeLogStoreInBugReport:(nonnull ARKLogStore *)logStore;
- (BOOL)emailBugReporter:(nonnull ARKEmailBugReporter *)emailBugReporter shouldIncludeLogStoreInBugReport:(nonnull ARKLogStore *)logStore NS_SWIFT_UI_ACTOR;

/// Called on the main thread when a bug is filed. The attachments in the returned array will be attached to the bug report email.
- (nullable NSArray<ARKBugReportAttachment *> *)additionalEmailAttachmentsForEmailBugReporter:(nonnull ARKEmailBugReporter *)emailBugReporter;
- (nullable NSArray<ARKBugReportAttachment *> *)additionalEmailAttachmentsForEmailBugReporter:(nonnull ARKEmailBugReporter *)emailBugReporter NS_SWIFT_UI_ACTOR;

@end

typedef void (^ARKAttachmentGeneratorCompletionBlock)(ARKBugReportAttachment * _Nullable attachment);
typedef void (^ARKAttachmentGeneratorCompletionBlock)(ARKBugReportAttachment * _Nullable attachment) NS_SWIFT_UI_ACTOR;

typedef void (^ARKEmailBugReporterCustomPromptCompletionBlock)(ARKEmailBugReportConfiguration *_Nullable configuration);
typedef void (^ARKEmailBugReporterCustomPromptCompletionBlock)(ARKEmailBugReportConfiguration *_Nullable configuration) NS_SWIFT_UI_ACTOR;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Due to swiftlang/swift#76099 these blocks will only get @MainActor in Xcode 16.0+

Since they're silently dropped on older Xcodes we aren't any worse off than before this change


@protocol ARKEmailBugReporterPromptingDelegate <NSObject>

Expand All @@ -59,7 +59,7 @@ typedef void (^ARKEmailBugReporterCustomPromptCompletionBlock)(ARKEmailBugReport
/// Called on the main thread when a bug is filed to signal that a bug report prompt should be presented to the user.
/// The `completion` should be called on the main thread with either an updated configuration to present the email dialog, or `nil` to signal that the prompt was cancelled.
/// When the initial `configuration` has `includesScreenshot` or `includesViewHierarchyDescription` false, setting the field to true will have no effect.
- (void)showBugReportingPromptForConfiguration:(ARKEmailBugReportConfiguration *_Nonnull)configuration completion:(ARKEmailBugReporterCustomPromptCompletionBlock _Nonnull)completion;
- (void)showBugReportingPromptForConfiguration:(ARKEmailBugReportConfiguration *_Nonnull)configuration completion:(ARKEmailBugReporterCustomPromptCompletionBlock _Nonnull)completion NS_SWIFT_UI_ACTOR;

@end

Expand Down
Loading