diff --git a/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate b/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate index 7d31c83c..67652e13 100644 Binary files a/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate and b/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/AnimeGen/Main.storyboard b/AnimeGen/Main.storyboard index 3a113673..8527b468 100644 --- a/AnimeGen/Main.storyboard +++ b/AnimeGen/Main.storyboard @@ -225,12 +225,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -253,7 +307,7 @@ - + @@ -276,7 +330,7 @@ - + @@ -301,58 +355,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -361,8 +363,8 @@ - - + + diff --git a/AnimeGen/Settings/SettingsMain.swift b/AnimeGen/Settings/SettingsMain.swift index e653023c..ef71abc8 100644 --- a/AnimeGen/Settings/SettingsMain.swift +++ b/AnimeGen/Settings/SettingsMain.swift @@ -9,36 +9,36 @@ import UIKit import SwiftUI class SettingsMain: UITableViewController { - - @IBOutlet weak var StepperWidth: UIStepper! - @IBOutlet weak var StepperHeight: UIStepper! - + + @IBOutlet weak var stepperWidth: UIStepper! + @IBOutlet weak var stepperHeight: UIStepper! + override func viewDidLoad() { super.viewDidLoad() - - StepperWidth.value = Settings.shared.imageWidth - StepperHeight.value = Settings.shared.imageHeight - - StepperWidth.minimumValue = 1.0 - StepperWidth.maximumValue = 100.0 - - StepperHeight.minimumValue = 1.0 - StepperHeight.maximumValue = 100.0 - - StepperWidth.addTarget(self, action: #selector(widthStepperChanged(_:)), for: .valueChanged) - StepperHeight.addTarget(self, action: #selector(heightStepperChanged(_:)), for: .valueChanged) + + stepperWidth.value = Settings.shared.imageWidth + stepperHeight.value = Settings.shared.imageHeight + + stepperWidth.minimumValue = 0.1 + stepperWidth.maximumValue = 1.0 + + stepperHeight.minimumValue = 0.1 + stepperHeight.maximumValue = 1.0 + + stepperWidth.addTarget(self, action: #selector(widthStepperChanged(_:)), for: .valueChanged) + stepperHeight.addTarget(self, action: #selector(heightStepperChanged(_:)), for: .valueChanged) } - + @IBAction func widthStepperChanged(_ sender: UIStepper) { Settings.shared.imageWidth = sender.value print("New imageWidth: \(Settings.shared.imageWidth)") } - + @IBAction func heightStepperChanged(_ sender: UIStepper) { Settings.shared.imageHeight = sender.value print("New imageHeight: \(Settings.shared.imageHeight)") } - + @IBAction func APIsStatus(_ sender: UITapGestureRecognizer) { DispatchQueue.main.async { [weak self] in guard let self = self, let navigationController = self.navigationController else { return } @@ -53,9 +53,9 @@ class SettingsMain: UITableViewController { class Settings { static let shared = Settings() - - var imageWidth: Double = 100.0 - var imageHeight: Double = 60.0 - + + var imageWidth: Double = 1.0 + var imageHeight: Double = 0.6 + private init() {} }