Skip to content

Commit

Permalink
fix setting view too wide for iPad
Browse files Browse the repository at this point in the history
  • Loading branch information
hugeBlack committed Jun 2, 2024
1 parent 0f00df9 commit fb5b1d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/EeveeSpotify/Tweak.x.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ProfileSettingsSectionHook: ClassHook<NSObject> {
"RootSettingsViewController"
)!

let eeveeSettingsController = EeveeSettingsViewController()
let eeveeSettingsController = EeveeSettingsViewController(rootSettingsController.view.bounds)
eeveeSettingsController.title = "EeveeSpotify"

rootSettingsController.navigationController!.pushViewController(
Expand Down
12 changes: 11 additions & 1 deletion Sources/EeveeSpotify/Views/EeveeSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ import SwiftUI
import UIKit

class EeveeSettingsViewController: UIViewController {

let frame: CGRect
init(_ frame: CGRect) {
self.frame = frame
super.init(nibName: nil, bundle: nil)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func conforms(to aProtocol: Protocol) -> Bool {

Expand All @@ -24,7 +34,7 @@ class EeveeSettingsViewController: UIViewController {
super.viewDidLoad()

let hostingController = UIHostingController(rootView: EeveeSettingsView())
hostingController.view.frame = view.bounds
hostingController.view.frame = frame

view.addSubview(hostingController.view)
addChild(hostingController)
Expand Down

0 comments on commit fb5b1d9

Please sign in to comment.