File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Objective-C/TOCropViewController/Views Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,19 @@ - (void)setup {
6161 if (@available (iOS 26.0 , *)) {
6262 UIVisualEffect *effect = nil ;
6363#if !TARGET_OS_VISION
64- UIGlassEffect *glassEffect = [UIGlassEffect effectWithStyle: UIGlassEffectStyleClear];
64+ // We've been getting reports that some devices have been crashing with the error message
65+ // that `effectWithStyle` was unrecognized. The ONLY way this seems to be possible
66+ // is if there are users out there using the beta versions of iOS 26.0 before this method
67+ // was introduced. Either way, we're going to need to manually confirm the selector exists
68+ // in order to fix these crashes.
69+
70+ UIGlassEffect *glassEffect = nil ;
71+ SEL effectSelector = NSSelectorFromString (@" effectWithStyle:" );
72+ if ([[UIGlassEffect class ] respondsToSelector: effectSelector]) {
73+ glassEffect = [UIGlassEffect effectWithStyle: UIGlassEffectStyleClear];
74+ } else {
75+ glassEffect = [UIGlassEffect new ];
76+ }
6577 glassEffect.interactive = YES ;
6678 effect = glassEffect;
6779#else
You can’t perform that action at this time.
0 commit comments