Skip to content

Commit

Permalink
assdfsadf
Browse files Browse the repository at this point in the history
  • Loading branch information
cranci1 committed May 24, 2024
1 parent b2d883b commit 6f4ecb9
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 2 deletions.
Binary file not shown.
50 changes: 50 additions & 0 deletions AnimeGen/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,63 @@
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Test" id="goz-xu-vFw" userLabel="About">
<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"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="RHM-Tp-t0F" id="zsq-wp-PH0">
<rect key="frame" x="0.0" y="0.0" width="343" height="43.666667938232422"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="100" maximumValue="100" translatesAutoresizingMaskIntoConstraints="NO" id="4DX-53-zRn">
<rect key="frame" x="233" y="6" width="94" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</stepper>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Image Width" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Nl0-Dj-a0c">
<rect key="frame" x="16" y="11" width="87" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="UTq-rG-dol">
<rect key="frame" x="16" y="562.00000953674316" width="343" height="43.666667938232422"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="UTq-rG-dol" id="F7K-Dc-bSn">
<rect key="frame" x="0.0" y="0.0" width="343" height="43.666667938232422"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="60" maximumValue="100" translatesAutoresizingMaskIntoConstraints="NO" id="HxK-nZ-tZk">
<rect key="frame" x="233" y="6" width="94" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</stepper>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Image Height" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pBd-NK-uww">
<rect key="frame" x="16" y="11" width="92" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="BaH-N7-bdh" id="eAY-45-DhR"/>
<outlet property="delegate" destination="BaH-N7-bdh" id="hua-xE-gM5"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Settings" id="QYW-CF-MJD"/>
<connections>
<outlet property="SteppeHeight" destination="HxK-nZ-tZk" id="cDL-d7-Mat"/>
<outlet property="StepperWidth" destination="HxK-nZ-tZk" id="QXF-hn-nLj"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Chy-hT-HzR" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
<tapGestureRecognizer id="0ZA-XE-jX3" userLabel="Show Apis Status Page">
Expand Down
27 changes: 27 additions & 0 deletions AnimeGen/Settings/SettingsMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,26 @@ import SwiftUI

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()

StepperWidth.addTarget(self, action: #selector(widthStepperChanged(_:)), for: .valueChanged)
StepperHeight.addTarget(self, action: #selector(heightStepperChanged(_:)), for: .valueChanged)
}

@objc func widthStepperChanged(_ sender: UIStepper) {
imageWidth = sender.value
}

@objc func heightStepperChanged(_ sender: UIStepper) {
imageHeight = sender.value
}

@IBAction func APIsStatus(_ sender: UITapGestureRecognizer) {
Expand All @@ -25,3 +43,12 @@ class SettingsMain: UITableViewController {
}
}
}

class Settings {
static let shared = Settings()

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

private init() {}
}
7 changes: 5 additions & 2 deletions AnimeGen/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()

let imageWidths = Settings.shared.imageWidth
let imageHeights = Settings.shared.imageHeight

startTime = Date()

// Gestures
Expand Down Expand Up @@ -187,8 +190,8 @@ class ViewController: UIViewController {
// Image View
imageView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
imageView.centerYAnchor.constraint(equalTo: view.centerYAnchor, constant: -20),
imageView.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 1),
imageView.heightAnchor.constraint(equalTo: view.heightAnchor, multiplier: 0.60),
imageView.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: imageWidths),
imageView.heightAnchor.constraint(equalTo: view.heightAnchor, multiplier: imageHeights),

// API button
apiButton.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 5),
Expand Down

0 comments on commit 6f4ecb9

Please sign in to comment.