Skip to content

Commit

Permalink
fix iOS-ObjectiveC build
Browse files Browse the repository at this point in the history
  • Loading branch information
armcknight committed Oct 16, 2024
1 parent 5bfdc59 commit e928971
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
22 changes: 18 additions & 4 deletions Samples/iOS-ObjectiveC/iOS-ObjectiveC/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,41 @@ - (BOOL)application:(UIApplication *)application
};

options.configureUserFeedback = ^(SentryUserFeedbackConfiguration *_Nonnull config) {
UIOffset layoutOffset = UIOffsetMake(25, 75);
if ([args containsObject:@"--io.sentry.iOS-Swift.user-feedback.all-defaults"]) {
config.configureWidget = ^(SentryUserFeedbackWidgetConfiguration *widget) {
widget.layoutUIOffset = layoutOffset;
};
return;
}
config.useShakeGesture = YES;
config.showFormForScreenshots = YES;
config.configureWidget = ^(SentryUserFeedbackWidgetConfiguration *_Nonnull widget) {
if ([args
containsObject:@"--io.sentry.iOS-Swift.auto-inject-user-feedback-widget"]) {
widget.labelText = @"Report Jank";
widget.widgetAccessibilityLabel = @"io.sentry.iOS-Swift.button.report-jank";
widget.layoutUIOffset = UIOffsetMake(12, 50);
widget.layoutUIOffset = layoutOffset;
} else {
widget.autoInject = NO;
}

if ([args containsObject:@"--io.sentry.iOS-Swift.user-feedback.no-widget-text"]) {
widget.labelText = nil;
}
if ([args containsObject:@"--io.sentry.iOS-Swift.user-feedback.no-widget-icon"]) {
widget.showIcon = NO;
}
};
config.configureForm = ^(SentryUserFeedbackFormConfiguration *_Nonnull uiForm) {
uiForm.formTitle = @"Jank Report";
uiForm.submitButtonLabel = @"Report that jank";
uiForm.addScreenshotButtonLabel = @"Show us the jank";
uiForm.messagePlaceholder
= @"Describe the nature of the jank. Its essence, if you will.";
uiForm.themeOverrides = ^(SentryUserFeedbackThemeConfiguration *_Nonnull theme) {
theme.font = [UIFont fontWithName:@"Comic Sans" size:25];
};
};
config.configureTheme = ^(SentryUserFeedbackThemeConfiguration *_Nonnull theme) {
theme.font = [UIFont fontWithName:@"ChalkboardSE-Regular" size:25];
};
config.onSubmitSuccess = ^(NSDictionary<NSString *, id> *_Nonnull info) {
NSString *name = info[@"name"] ?: @"$shakespearean_insult_name";
Expand Down
2 changes: 1 addition & 1 deletion Samples/iOS-Swift/iOS-Swift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
uiForm.messagePlaceholder = "Describe the nature of the jank. Its essence, if you will."
}
config.configureTheme = { theme in
let fontSize: CGFloat = 40
let fontSize: CGFloat = 25

let fontFamily: String
if Locale.current.languageCode == "ar" { // arabic; ar_EG
Expand Down

0 comments on commit e928971

Please sign in to comment.