Add settings to your app with a few lines of code.
- iOS 11.0 or later
- Swift 5.2
SettingsViewController is capable to handle Bool
, Float
and Selection
types of settings.
let settingsViewController = SettingsViewController(settings: [
BoolSetting(name: "Enable Postprocessing",
initialValue: true) { isPostprocessingEnabled in
self.enablePostprocessing(isPostprocessingEnabled)
},
SelectionSetting(name: "Scale Type",
initialValue: 0,
segments: ["Billinear", "Lanczos"]) { scaleType in
self.setScaleType(scaleType)
},
FloatSetting(name: "Brightness",
defaultValue: 0,
min: -1,
max: 1) { brightness in
self.setBrightness(brightness)
},
FloatSetting(name: "Saturation",
defaultValue: 0,
min: -1,
max: 1) { saturation in
self.setSaturation(saturation)
},
])
The project is inspired by and based on DebugMenu's options implementation.