Fixes for macOS catalyst version

This commit is contained in:
Selim Mustafaev 2025-02-14 22:48:46 +03:00
parent 993ba2f128
commit 8f99927861
4 changed files with 10 additions and 28 deletions

View File

@ -49,21 +49,5 @@
landmarkType = "0">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "88924AF0-7C20-4DBB-A9C1-7F575E0CE5C2"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "AutoCat/AppDelegate.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "115"
endingLineNumber = "115"
landmarkName = "application(_:configurationForConnecting:options:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

View File

@ -11,13 +11,6 @@ class MainTabController: UITabBarController, UITabBarControllerDelegate {
super.viewDidLoad()
self.delegate = self
#if targetEnvironment(macCatalyst)
// Remove "+" tab for macOS version (it will be on the toolbar)
viewControllers?.remove(at: 2)
#endif
if #available(iOS 18, *) {
// Setting the horizontal size class will force the tab bar
// to be displayed at the bottom.
@ -25,7 +18,10 @@ class MainTabController: UITabBarController, UITabBarControllerDelegate {
}
addHistoryTab()
#if !targetEnvironment(macCatalyst)
addDummyTab()
#endif
Task { await addSettings() }
}

View File

@ -230,17 +230,15 @@ extension SceneDelegate: NSToolbarDelegate {
func checkNewNumber(_ number: String) {
guard let split = self.window?.rootViewController as? MainSplitController,
let tabvc = split.viewControllers.first as? UITabBarController
let tabvc = split.viewControllers.first as? MainTabController
else {
return
}
tabvc.selectedIndex = 0
if let nav = tabvc.selectedViewController as? UINavigationController,
let checkController = nav.viewControllers.first as? CheckController {
checkController.checkTapped(number: number)
Task {
await tabvc.historyViewModel?.checkNewNumber(number)
}
}
}

View File

@ -74,7 +74,11 @@ extension VehicleService: VehicleServiceProtocol {
public func check(number: String) async throws -> VehicleWithErrors {
#if targetEnvironment(macCatalyst)
try await check(number: number, forceUpdate: false, trackLocation: false, dbUpdatePolicy: .always)
#else
try await check(number: number, forceUpdate: false, trackLocation: true, dbUpdatePolicy: .always)
#endif
}
public func updateHistory(number: String) async throws -> VehicleWithErrors {