git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit f3cbc1990e33ab86188d91d8c217eba001143d5d
parent 583c234953d60f8783170a6408fba6080fac8bec
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Sat, 28 Jun 2025 13:06:38 +0300

Allow building on older SDKs

Diffstat:
MiOS/GBSlider.m19+++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/iOS/GBSlider.m b/iOS/GBSlider.m @@ -1,4 +1,19 @@ #import "GBSlider.h" +#import <objc/runtime.h> + +#if !__has_include(<UIKit/UISliderTrackConfiguration.h>) +/* Building with older SDKs */ +API_AVAILABLE(ios(26.0)) +@interface UISliderTrackConfiguration : NSObject +@property (nonatomic, readwrite) bool allowsTickValuesOnly; +@property (nonatomic, readwrite) float neutralValue; ++ (instancetype)configurationWithNumberOfTicks:(NSInteger)ticks; +@end + +@interface UISlider (configuration) +@property(nonatomic, copy, nullable) UISliderTrackConfiguration *trackConfiguration API_AVAILABLE(ios(26.0)); +@end +#endif static inline void temperature_tint(double temperature, double *r, double *g, double *b) { @@ -162,7 +177,7 @@ static inline void temperature_tint(double temperature, double *r, double *g, do switch (_style) { case GBSliderStyleTemperature: case GBSliderStyleTicks: { - UISliderTrackConfiguration *conf = [UISliderTrackConfiguration configurationWithNumberOfTicks:3]; + UISliderTrackConfiguration *conf = [objc_getClass("UISliderTrackConfiguration") configurationWithNumberOfTicks:3]; conf.allowsTickValuesOnly = false; conf.neutralValue = 0.5; self.trackConfiguration = conf; @@ -171,7 +186,7 @@ static inline void temperature_tint(double temperature, double *r, double *g, do break; } case GBSliderStyleHue: { - UISliderTrackConfiguration *conf = [UISliderTrackConfiguration configurationWithNumberOfTicks:0]; + UISliderTrackConfiguration *conf = [objc_getClass("UISliderTrackConfiguration") configurationWithNumberOfTicks:0]; conf.allowsTickValuesOnly = false; self.trackConfiguration = conf; self.minimumTrackTintColor = [UIColor clearColor];

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.