Skip to content

Commit

Permalink
sds
Browse files Browse the repository at this point in the history
  • Loading branch information
cranci1 committed May 24, 2024
1 parent da6107b commit 5c29e00
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion AnimeGen/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Test" id="goz-xu-vFw" userLabel="About">
<tableViewSection headerTitle="Test" id="goz-xu-vFw" userLabel="Test">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="RHM-Tp-t0F">
<rect key="frame" x="16" y="518.33334159851074" width="343" height="43.666667938232422"/>
Expand Down
27 changes: 18 additions & 9 deletions AnimeGen/Settings/SettingsMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,32 @@ class SettingsMain: UITableViewController {
@IBOutlet weak var StepperWidth: UIStepper!
@IBOutlet weak var StepperHeight: UIStepper!

var imageWidth: Double = 100.0
var imageHeight: Double = 60.0


override func viewDidLoad() {
super.viewDidLoad()

// Initialize steppers with singleton values
StepperWidth.value = Settings.shared.imageWidth
StepperHeight.value = Settings.shared.imageHeight

// Set minimum and maximum values if needed
StepperWidth.minimumValue = 50.0
StepperWidth.maximumValue = 300.0
StepperHeight.minimumValue = 50.0
StepperHeight.maximumValue = 300.0

// Add target actions for steppers
StepperWidth.addTarget(self, action: #selector(widthStepperChanged(_:)), for: .valueChanged)
StepperHeight.addTarget(self, action: #selector(heightStepperChanged(_:)), for: .valueChanged)
}
}

@IBAction func widthStepperChanged(_ sender: UIStepper) {
imageWidth = sender.value
@objc func widthStepperChanged(_ sender: UIStepper) {
Settings.shared.imageWidth = sender.value
print("New imageWidth: \(Settings.shared.imageWidth)")
}

@IBAction func heightStepperChanged(_ sender: UIStepper) {
imageHeight = sender.value
@objc func heightStepperChanged(_ sender: UIStepper) {
Settings.shared.imageHeight = sender.value
print("New imageHeight: \(Settings.shared.imageHeight)")
}

@IBAction func APIsStatus(_ sender: UITapGestureRecognizer) {
Expand Down

0 comments on commit 5c29e00

Please sign in to comment.