Fixes for macOS catalyst version
This commit is contained in:
parent
993ba2f128
commit
8f99927861
@ -49,21 +49,5 @@
|
|||||||
landmarkType = "0">
|
landmarkType = "0">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</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>
|
</Breakpoints>
|
||||||
</Bucket>
|
</Bucket>
|
||||||
|
|||||||
@ -11,13 +11,6 @@ class MainTabController: UITabBarController, UITabBarControllerDelegate {
|
|||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
self.delegate = self
|
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, *) {
|
if #available(iOS 18, *) {
|
||||||
// Setting the horizontal size class will force the tab bar
|
// Setting the horizontal size class will force the tab bar
|
||||||
// to be displayed at the bottom.
|
// to be displayed at the bottom.
|
||||||
@ -25,7 +18,10 @@ class MainTabController: UITabBarController, UITabBarControllerDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addHistoryTab()
|
addHistoryTab()
|
||||||
|
|
||||||
|
#if !targetEnvironment(macCatalyst)
|
||||||
addDummyTab()
|
addDummyTab()
|
||||||
|
#endif
|
||||||
Task { await addSettings() }
|
Task { await addSettings() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -230,17 +230,15 @@ extension SceneDelegate: NSToolbarDelegate {
|
|||||||
|
|
||||||
func checkNewNumber(_ number: String) {
|
func checkNewNumber(_ number: String) {
|
||||||
guard let split = self.window?.rootViewController as? MainSplitController,
|
guard let split = self.window?.rootViewController as? MainSplitController,
|
||||||
let tabvc = split.viewControllers.first as? UITabBarController
|
let tabvc = split.viewControllers.first as? MainTabController
|
||||||
else {
|
else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
tabvc.selectedIndex = 0
|
tabvc.selectedIndex = 0
|
||||||
|
|
||||||
if let nav = tabvc.selectedViewController as? UINavigationController,
|
Task {
|
||||||
let checkController = nav.viewControllers.first as? CheckController {
|
await tabvc.historyViewModel?.checkNewNumber(number)
|
||||||
|
|
||||||
checkController.checkTapped(number: number)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,7 +74,11 @@ extension VehicleService: VehicleServiceProtocol {
|
|||||||
|
|
||||||
public func check(number: String) async throws -> VehicleWithErrors {
|
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)
|
try await check(number: number, forceUpdate: false, trackLocation: true, dbUpdatePolicy: .always)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public func updateHistory(number: String) async throws -> VehicleWithErrors {
|
public func updateHistory(number: String) async throws -> VehicleWithErrors {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user