Skip to content

Commit 1d7a36a

Browse files
committed
Added new interface to the header for supporting glass
1 parent 8cdffa5 commit 1d7a36a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

TORoundedButton/TORoundedButton.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ NS_ASSUME_NONNULL_BEGIN
2727
@class TORoundedButton;
2828
@class UICornerConfiguration;
2929

30+
/// The types of static/dynamic visual styles that can be applied to the background.
31+
typedef NS_ENUM(NSInteger, TORoundedButtonBackgroundStyle) {
32+
TORoundedButtonBackgroundStyleSolid,
33+
TORoundedButtonBackgroundStyleBlur,
34+
TORoundedButtonBackgroundStyleGlass
35+
};
36+
3037
NS_SWIFT_NAME(RoundedButtonDelegate)
3138
@protocol TORoundedButtonDelegate <NSObject>
3239

@@ -64,12 +71,15 @@ IB_DESIGNABLE @interface TORoundedButton : UIControl
6471
/// (Default value is 15 points inset from each edge).
6572
@property (nonatomic, assign) UIEdgeInsets contentInset;
6673

67-
/// Replaces the solid color background with a blur view. (Default is NO)
68-
@property (nonatomic, assign) BOOL isTranslucent;
74+
/// The style, whether static or dynamic of the button's background view.
75+
@property (nonatomic, assign) TORoundedButtonBackgroundStyle backgroundStyle;
6976

70-
/// When `isTranslucent` is `YES`, the amount of blur the background view has.
77+
/// When `backgroundStyle` is set to `.blur`, the specific blur style to apply.
7178
@property (nonatomic, assign) UIBlurEffectStyle blurStyle;
7279

80+
/// When `backgroundStyle` is set to `.blur`, the specific blur style to apply.
81+
@property (nonatomic, assign) UIGlassEffectStyle glassStyle API_AVAILABLE(ios(26.0));
82+
7383
/// The text that is displayed in center of the button (Default is nil).
7484
/// This adds an internally controlled label view to the main content view.
7585
@property (nonatomic, copy, nullable) IBInspectable NSString *text;

0 commit comments

Comments
 (0)