Skip to content
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
14 changes: 13 additions & 1 deletion Objective-C/TOCropViewController/Views/TOCropToolbar.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,19 @@ - (void)setup {
if (@available(iOS 26.0, *)) {
UIVisualEffect *effect = nil;
#if !TARGET_OS_VISION
UIGlassEffect *glassEffect = [UIGlassEffect effectWithStyle:UIGlassEffectStyleClear];
// We've been getting reports that some devices have been crashing with the error message
// that `effectWithStyle` was unrecognized. The ONLY way this seems to be possible
// is if there are users out there using the beta versions of iOS 26.0 before this method
// was introduced. Either way, we're going to need to manually confirm the selector exists
// in order to fix these crashes.

UIGlassEffect *glassEffect = nil;
SEL effectSelector = NSSelectorFromString(@"effectWithStyle:");
if ([[UIGlassEffect class] respondsToSelector:effectSelector]) {
glassEffect = [UIGlassEffect effectWithStyle:UIGlassEffectStyleClear];
} else {
glassEffect = [UIGlassEffect new];
}
glassEffect.interactive = YES;
effect = glassEffect;
#else
Expand Down