SettingsViewController

0.2.5

eugenebokhan/settings-view-controller

What's New

SettingsViewController

Add settings to your app with a few lines of code.

preview

Requirements

  • iOS 11.0 or later
  • Swift 5.2

Usage

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",
                 initialValue: 0,
                 min: -1,
                 max: 1) { brightness in
                    self.setBrightness(brightness)
    },
    FloatSetting(name: "Saturation",
                 initialValue: 0,
                 min: -1,
                 max: 1) { saturation in
                    self.setSaturation(saturation)
    },
])

References

The project is inspired by and based on DebugMenu's options implementation.

License

MIT

Description

  • Swift Tools 5.2.0
View More Packages from this Author

Dependencies

Last updated: Tue Mar 19 2024 14:23:51 GMT-0900 (Hawaii-Aleutian Daylight Time)