@@ -58,10 +58,18 @@ - (void)setup {
5858 self.backgroundView = [[UIView alloc ] initWithFrame: self .bounds];
5959
6060 UIView *containerView = self;
61+ #ifdef __IPHONE_26_0
6162 if (@available (iOS 26.0 , *)) {
63+ UIVisualEffect *effect = nil ;
64+ #if !TARGET_OS_VISION
6265 UIGlassEffect *glassEffect = [UIGlassEffect effectWithStyle: UIGlassEffectStyleClear];
6366 glassEffect.interactive = YES ;
64- _glassView = [[UIVisualEffectView alloc ] initWithEffect: glassEffect];
67+ effect = glassEffect;
68+ #else
69+ UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle: UIBlurEffectStyleProminent];
70+ effect = blurEffect;
71+ #endif
72+ _glassView = [[UIVisualEffectView alloc ] initWithEffect: effect];
6573 _glassView.cornerConfiguration = [UICornerConfiguration capsuleConfiguration ];
6674 _glassView.userInteractionEnabled = YES ;
6775 [self addSubview: _glassView];
@@ -72,6 +80,10 @@ - (void)setup {
7280 self.backgroundView .backgroundColor = [UIColor colorWithWhite: 0 .12f alpha: 1 .0f ];
7381 [self addSubview: self .backgroundView];
7482 }
83+ #else
84+ self.backgroundView .backgroundColor = [UIColor colorWithWhite: 0 .12f alpha: 1 .0f ];
85+ [self addSubview: self .backgroundView];
86+ #endif
7587
7688 // On iOS 9 and up, we can use the new layout features to determine whether we're in an 'Arabic' style language mode
7789 _reverseContentLayout = ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute: self .semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft);
@@ -103,11 +115,17 @@ - (void)setup {
103115 [_doneIconButton setImage: [TOCropToolbar doneImage ] forState: UIControlStateNormal];
104116 [_doneIconButton setTintColor: [UIColor colorWithRed: 1 .0f green: 0 .8f blue: 0 .0f alpha: 1 .0f ]];
105117 [_doneIconButton addTarget: self action: @selector (buttonTapped: ) forControlEvents: UIControlEventTouchUpInside];
118+ #if defined(__IPHONE_26_0)
106119 if (@available (iOS 26.0 , *)) {
120+ #if !TARGET_OS_VISION
107121 UIButtonConfiguration *configuration = [UIButtonConfiguration prominentGlassButtonConfiguration ];
108122 configuration.baseForegroundColor = [UIColor blackColor ];
123+ #else
124+ UIButtonConfiguration *configuration = [UIButtonConfiguration filledButtonConfiguration ];
125+ #endif
109126 _doneIconButton.configuration = configuration;
110127 }
128+ #endif
111129 [self addSubview: _doneIconButton];
112130
113131 // Set the default color for the done buttons
@@ -132,9 +150,15 @@ - (void)setup {
132150 _cancelIconButton = [UIButton buttonWithType: UIButtonTypeSystem];
133151 [_cancelIconButton setImage: [TOCropToolbar cancelImage ] forState: UIControlStateNormal];
134152 [_cancelIconButton addTarget: self action: @selector (buttonTapped: ) forControlEvents: UIControlEventTouchUpInside];
153+ #if defined(__IPHONE_26_0)
135154 if (@available (iOS 26.0 , *)) {
155+ #if !TARGET_OS_VISION
136156 _cancelIconButton.configuration = [UIButtonConfiguration clearGlassButtonConfiguration ];
157+ #else
158+ _cancelIconButton.configuration = [UIButtonConfiguration filledButtonConfiguration ];
159+ #endif
137160 }
161+ #endif
138162 [self addSubview: _cancelIconButton];
139163
140164 _clampButton = [UIButton buttonWithType: UIButtonTypeSystem];
0 commit comments