You need to sign in or sign up before continuing.
Commit b579eb2b authored by shigemi miura's avatar shigemi miura

iOS27 iPhoneでタブボタンが押せない不具合を修正

通信処理の見直し
parent 1734c216
......@@ -16,6 +16,7 @@
dependencies = (
);
name = "AzureNotificationHubs-iOS";
productName = "AzureNotificationHubs-iOS";
};
/* End PBXAggregateTarget section */
......@@ -121,7 +122,7 @@
99743ABC5876BBF855E5EE7D4D9BBFBC /* HubConnection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HubConnection.swift; path = Sources/SignalRClient/HubConnection.swift; sourceTree = "<group>"; };
998C647A59261C90EA8DF5F841F81ED8 /* Pods-Sailassist-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Sailassist-umbrella.h"; sourceTree = "<group>"; };
9A23C67D0548DF810D1712CBE602461B /* LongPollingTransport.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LongPollingTransport.swift; path = Sources/SignalRClient/LongPollingTransport.swift; sourceTree = "<group>"; };
9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
9F9AF6D4F29B01D2A9287D1F02E85155 /* JSONHubProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JSONHubProtocol.swift; path = Sources/SignalRClient/JSONHubProtocol.swift; sourceTree = "<group>"; };
A347F728F5AAA8B41DAFE3AD233425B1 /* SwiftSignalRClient-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "SwiftSignalRClient-Info.plist"; sourceTree = "<group>"; };
B1C92344570F3702174B6CD251E58E9E /* Pods-SailAssistTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SailAssistTests-acknowledgements.plist"; sourceTree = "<group>"; };
......@@ -131,7 +132,7 @@
B718183D31FC6004F71844FA616C449A /* HandshakeProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HandshakeProtocol.swift; path = Sources/SignalRClient/HandshakeProtocol.swift; sourceTree = "<group>"; };
C0A0244A30A292024A7AB96104039BFB /* HubConnectionExtensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HubConnectionExtensions.swift; path = Sources/SignalRClient/HubConnectionExtensions.swift; sourceTree = "<group>"; };
C99CC2D377D211487E80F9DC15293987 /* NegotiationResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NegotiationResponse.swift; path = Sources/SignalRClient/NegotiationResponse.swift; sourceTree = "<group>"; };
CA2C16F20715BBB5C1E288B9406F6303 /* WindowsAzureMessaging.xcframework */ = {isa = PBXFileReference; includeInIndex = 1; name = WindowsAzureMessaging.xcframework; path = "WindowsAzureMessaging-SDK-Apple/WindowsAzureMessaging.xcframework"; sourceTree = "<group>"; };
CA2C16F20715BBB5C1E288B9406F6303 /* WindowsAzureMessaging.xcframework */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = wrapper.xcframework; name = WindowsAzureMessaging.xcframework; path = "WindowsAzureMessaging-SDK-Apple/WindowsAzureMessaging.xcframework"; sourceTree = "<group>"; };
CB2414C9D8D9290C1D5F4211D6FC4E26 /* Logger.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Logger.swift; path = Sources/SignalRClient/Logger.swift; sourceTree = "<group>"; };
D1D56B5309D1F749EC584E7F5D901428 /* HubConnectionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HubConnectionDelegate.swift; path = Sources/SignalRClient/HubConnectionDelegate.swift; sourceTree = "<group>"; };
D282F486E6C5E74D2F27BF5ED45ADD47 /* Pods-SailAssistTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SailAssistTests-umbrella.h"; sourceTree = "<group>"; };
......@@ -143,7 +144,7 @@
DFFD42573E1097252DD74B9B8686713D /* ServerInvocationHandler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerInvocationHandler.swift; path = Sources/SignalRClient/ServerInvocationHandler.swift; sourceTree = "<group>"; };
E04B4C3FF284BC409C8436B3C844044C /* SwiftSignalRClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SwiftSignalRClient-prefix.pch"; sourceTree = "<group>"; };
E347DFCE3670A0953EA7E9880C7723D0 /* SignalRError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SignalRError.swift; path = Sources/SignalRClient/SignalRError.swift; sourceTree = "<group>"; };
E7AFB048F72A32D1AB967A9164E20741 /* SwiftSignalRClient */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = SwiftSignalRClient; path = SwiftSignalRClient.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E7AFB048F72A32D1AB967A9164E20741 /* SwiftSignalRClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftSignalRClient.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F04040FA4924616899E5F9CD0D5FEF94 /* HttpConnection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HttpConnection.swift; path = Sources/SignalRClient/HttpConnection.swift; sourceTree = "<group>"; };
F371DF14209E4C63D0D1BFF890B0E44D /* Pods-SailAssistTests */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = "Pods-SailAssistTests"; path = Pods_SailAssistTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FAD4FBDFB36028046481AC609256BC25 /* Connection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Connection.swift; path = Sources/SignalRClient/Connection.swift; sourceTree = "<group>"; };
......@@ -287,7 +288,7 @@
children = (
32C8F03288ABF8CB2E1A04518F1394B9 /* Pods-Sailassist */,
F371DF14209E4C63D0D1BFF890B0E44D /* Pods-SailAssistTests */,
E7AFB048F72A32D1AB967A9164E20741 /* SwiftSignalRClient */,
E7AFB048F72A32D1AB967A9164E20741 /* SwiftSignalRClient.framework */,
);
name = Products;
sourceTree = "<group>";
......@@ -327,7 +328,6 @@
09BBFD81D450AA2C354BDC78D4AF50E6 /* WebsocketsTransport.swift */,
C80DDBE8FD00464F8F959003EF78F8BF /* Support Files */,
);
name = SwiftSignalRClient;
path = SwiftSignalRClient;
sourceTree = "<group>";
};
......@@ -346,7 +346,6 @@
1187AA037CB2DE219A69DE3350C6828B /* Frameworks */,
6AAA309192D5B46A98CB622F6E79D3D7 /* Support Files */,
);
name = "AzureNotificationHubs-iOS";
path = "AzureNotificationHubs-iOS";
sourceTree = "<group>";
};
......@@ -434,7 +433,7 @@
);
name = SwiftSignalRClient;
productName = SwiftSignalRClient;
productReference = E7AFB048F72A32D1AB967A9164E20741 /* SwiftSignalRClient */;
productReference = E7AFB048F72A32D1AB967A9164E20741 /* SwiftSignalRClient.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
......@@ -500,10 +499,14 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/AzureNotificationHubs-iOS/AzureNotificationHubs-iOS-xcframeworks-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Copy XCFrameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/AzureNotificationHubs-iOS/AzureNotificationHubs-iOS-xcframeworks-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/AzureNotificationHubs-iOS/AzureNotificationHubs-iOS-xcframeworks.sh\"\n";
......@@ -698,7 +701,7 @@
GCC_PREFIX_HEADER = "Target Support Files/SwiftSignalRClient/SwiftSignalRClient-prefix.pch";
INFOPLIST_FILE = "Target Support Files/SwiftSignalRClient/SwiftSignalRClient-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
......@@ -857,7 +860,7 @@
GCC_PREFIX_HEADER = "Target Support Files/SwiftSignalRClient/SwiftSignalRClient-prefix.pch";
INFOPLIST_FILE = "Target Support Files/SwiftSignalRClient/SwiftSignalRClient-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
......@@ -929,7 +932,7 @@
GCC_PREFIX_HEADER = "Target Support Files/SwiftSignalRClient/SwiftSignalRClient-prefix.pch";
INFOPLIST_FILE = "Target Support Files/SwiftSignalRClient/SwiftSignalRClient-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
......@@ -1046,7 +1049,7 @@
GCC_PREFIX_HEADER = "Target Support Files/SwiftSignalRClient/SwiftSignalRClient-prefix.pch";
INFOPLIST_FILE = "Target Support Files/SwiftSignalRClient/SwiftSignalRClient-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
......
......@@ -20,7 +20,7 @@ class GetPushHistory {
switch result {
case .success(let resultData):
let serverSession = ServerSession()
let resjson = serverSession.fromJSON(resultData: resultData, resltType: [ResPushHistory].self)
let resjson = serverSession.fromJSON(resultData: resultData, resultType: [ResPushHistory].self)
if let res = resjson {
for push in res {
if let id = push.id {
......
......@@ -17,7 +17,7 @@ class GetMessage {
switch response {
case .success(let resultData):
let serverSession = ServerSession()
let resjson = serverSession.fromJSON(resultData: resultData, resltType: ResGetMessages.self)
let resjson = serverSession.fromJSON(resultData: resultData, resultType: ResGetMessages.self)
if let res = resjson {
if res.mode == 1 {
SharingData.message.mode = true
......
......@@ -96,7 +96,7 @@ class ChatInputViewModel: ObservableObject {
print(debug: "Upload success: \(response)")
let serverSession = ServerSession()
_ = serverSession.fromJSON(resultData: response, resltType: ResLogin.self)
_ = serverSession.fromJSON(resultData: response, resultType: ResLogin.self)
sessionUploadImage.progress = 0.0 // 完了後リセット
isUploadingDialogPresented = false
......@@ -120,7 +120,7 @@ class ChatInputViewModel: ObservableObject {
print(debug: "Video upload success: \(response)")
let serverSession = ServerSession()
_ = serverSession.fromJSON(resultData: response, resltType: ResLogin.self)
_ = serverSession.fromJSON(resultData: response, resultType: ResLogin.self)
SessionUploadImage.OnlyOne.progress = 0.0
isUploadingDialogPresented = false
......
......@@ -70,7 +70,7 @@ class EcaArea {
switch result {
case .success(let resultData):
let serverSession = ServerSession()
let resjson = serverSession.fromJSON(resultData: resultData, resltType: [ResEcaArea].self)
let resjson = serverSession.fromJSON(resultData: resultData, resultType: [ResEcaArea].self)
if let res = resjson {
print(debug: res)
for ecaList in res {
......
......@@ -35,7 +35,7 @@ class EcaTask {
switch result {
case .success(let resultData):
let serverSession = ServerSession()
let resjson = serverSession.fromJSON(resultData: resultData, resltType: ResShipStatus.self)
let resjson = serverSession.fromJSON(resultData: resultData, resultType: ResShipStatus.self)
if let res = resjson {
SharingData.location.status = SharingData.location.setShipStatus(status: res.status)
SharingData.location.totalRmsAlarm = SharingData.location.setTotalRmsAlarm(alarm: res.totalRmsAlarm)
......
......@@ -22,7 +22,7 @@ class GetEcaList {
switch result {
case .success(let resultData):
let serverSession = ServerSession()
let resjson = serverSession.fromJSON(resultData: resultData, resltType: [ReqTaskList].self)
let resjson = serverSession.fromJSON(resultData: resultData, resultType: [ReqTaskList].self)
if let res = resjson {
var ecaAreas = ecaData.ecaArea
for ares in ecaData.ecaArea {
......
......@@ -137,6 +137,10 @@ struct LoginView: View {
)
}
}
.onDisappear {
timer?.invalidate()
timer = nil
}
}
}
.background(ColorSet.BackgroundPrimary.color)
......@@ -186,7 +190,7 @@ struct LoginView: View {
switch result {
case .success(let resultData):
let serverSession = ServerSession()
let resjson = serverSession.fromJSON(resultData: resultData, resltType: ResLogin.self)
let resjson = serverSession.fromJSON(resultData: resultData, resultType: ResLogin.self)
if let res = resjson {
SharingData.my.id = res.id
SharingData.my.shipId = res.shipId
......
......@@ -95,7 +95,7 @@ struct InputUserNameView: View {
switch result {
case .success(let resultData):
let serverSession = ServerSession()
let resjson = serverSession.fromJSON(resultData: resultData, resltType: ResLogin.self)
let resjson = serverSession.fromJSON(resultData: resultData, resultType: ResLogin.self)
if let res = resjson {
SharingData.my.id = res.id
SharingData.my.shipName = res.shipName
......
......@@ -21,7 +21,7 @@ class MonitoringRoute {
switch result {
case .success(let resultData):
let serverSession = ServerSession()
let resjson = serverSession.fromJSON(resultData: resultData, resltType: ResMonitoringRoute.self)
let resjson = serverSession.fromJSON(resultData: resultData, resultType: ResMonitoringRoute.self)
if let res = resjson {
SharingData.map.wayPoints = []
if let wayPoint = res.wayPoints {
......
......@@ -40,8 +40,8 @@ struct EcaListMainView: View {
}
}
Spacer()
.frame(height: 55)
// Spacer()
// .frame(height: 55)
}
}
......
......@@ -10,52 +10,61 @@ import SwiftUI
struct EcaListView: View {
@ObservedObject var taskViewModel : TaskViewModel
@ObservedObject var ecaData = SharingData.eca
private enum Layout {
static let rowHeight: CGFloat = 62
static let horizontalPadding: CGFloat = 30
static let iconSize: CGFloat = 12
static let buttonSize: CGFloat = 28
}
var body: some View {
ForEach(ecaData.ecaArea.map{ $0.1 }.sorted{ $0.areaId < $1.areaId }, id: \.name){ eca in
HStack {
Text(eca.name)
.font(FontStyle.DefaultText.font)
.foregroundColor(ColorSet.Body.color)
.onTapGesture {
ecaData.focusEca = eca.areaId
VStack {
ForEach(ecaData.ecaArea.map{ $0.1 }.sorted{ $0.areaId < $1.areaId }, id: \.areaId){ eca in
HStack {
Text(eca.name)
.font(FontStyle.DefaultText.font)
.foregroundColor(ColorSet.Body.color)
.onTapGesture {
ecaData.focusEca = eca.areaId
}
Spacer()
if !eca.isEnable{
Button(action: {
var newData = eca
newData.isEnable.toggle()
ecaData.editEcaArea(key: eca.areaId, value: newData, type: EcaOperation.Insert)
// taskViewModel.viewMode = .FuelSwitching
taskViewModel.edittingEcaArea = eca
taskViewModel.viewMode = .EcaSetting
}, label: {
Image("icon_plus")
.resizable()
.frame(width: Layout.iconSize, height: Layout.iconSize)
.padding(8)
})
.frame(width: Layout.buttonSize, height: Layout.buttonSize)
.background(.primaryActiveIcon)
.cornerRadius(50)
.padding()
}else{
Text("Registered")
.font(FontStyle.SupplementText2.font)
.frame(height: 25)
.foregroundColor(ColorSet.ButtonDisable.color)
.padding(.vertical, 4)
.padding(.horizontal, 10)
.background(ColorSet.PrimaryDisable.color)
.cornerRadius(99)
}
Spacer()
if !eca.isEnable{
Button(action: {
var newData = eca
newData.isEnable.toggle()
ecaData.editEcaArea(key: eca.areaId, value: newData, type: EcaOperation.Insert)
taskViewModel.viewMode = .FuelSwitching
taskViewModel.edittingEcaArea = eca
taskViewModel.viewMode = .EcaSetting
}, label: {
Image("icon_plus")
.resizable()
.frame(width: 12, height: 12)
.padding(8)
})
.frame(width: 28, height: 28)
.background(.primaryActiveIcon)
.cornerRadius(50)
.padding()
}else{
Text("Registered")
.font(FontStyle.SupplementText2.font)
.frame(height: 25)
.foregroundColor(ColorSet.ButtonDisable.color)
.padding(.vertical, 4)
.padding(.horizontal, 10)
.background(ColorSet.PrimaryDisable.color)
.cornerRadius(99)
}
.frame(height: Layout.rowHeight)
.padding(.horizontal, Layout.horizontalPadding)
Divider()
.background(.white)
}
.frame(height: 62)
.padding(.horizontal, 30)
Divider()
.background(.white)
}
}
}
......
......@@ -43,8 +43,8 @@ struct EcaSettingMainView: View {
}
}
Spacer()
.frame(height: 55)
// Spacer()
// .frame(height: 55)
}
}
......
......@@ -41,8 +41,8 @@ struct FuelSwitchingMainView: View {
}
}
Spacer()
.frame(height: 55)
// Spacer()
// .frame(height: 55)
}
}
......
......@@ -36,7 +36,7 @@ struct MenuMainView: View {
}
}
Spacer().frame(height: 55)
// Spacer().frame(height: 55)
}
.padding(EdgeInsets(top: 10, leading: 8, bottom: 13, trailing: 17))
}
......
......@@ -41,8 +41,8 @@ struct NgaNotificationMainView: View {
}
}
Spacer()
.frame(height: 55)
// Spacer()
// .frame(height: 55)
}
}
......
......@@ -50,8 +50,8 @@ struct NgaSettingMainView: View {
}
}
Spacer()
.frame(height: 55)
// Spacer()
// .frame(height: 55)
}
}
......
......@@ -17,7 +17,7 @@ class GetManualUrl {
case .success(let resultData):
print(debug: String(data: resultData, encoding: .utf8) as Any)
let serverSession = ServerSession()
let resjson = serverSession.fromJSON(resultData: resultData, resltType: [ResGetManualUrl].self)
let resjson = serverSession.fromJSON(resultData: resultData, resultType: [ResGetManualUrl].self)
if var res = resjson {
for index in res.indices {
let convert = res[index].path.replacingOccurrences(of: " ", with: "%20")
......
......@@ -21,7 +21,7 @@ class GetNgaList {
switch result {
case .success(let resultData):
let serverSession = ServerSession()
let resjson = serverSession.fromJSON(resultData: resultData, resltType: [ReqNgaList].self)
let resjson = serverSession.fromJSON(resultData: resultData, resultType: [ReqNgaList].self)
// if let res = resjson {
// var ngaTmp: Dictionary<UUID, RegisteredNga> = [:]
// for ngaList in res {
......
......@@ -20,7 +20,7 @@ class GetInformation {
switch result {
case .success(let resultData):
let serverSession = ServerSession()
let resjson = serverSession.fromJSON(resultData: resultData, resltType: [ResInformation].self)
let resjson = serverSession.fromJSON(resultData: resultData, resultType: [ResInformation].self)
SharingData.information.content = []
if let res = resjson {
SharingData.information.content = res
......
......@@ -30,6 +30,15 @@ struct MainTabView: View {
@State private var offset = CGSize.zero
@State var isSignout = false
@State private var sheetHeight: CGFloat = 100
@State private var dragStartHeight: CGFloat = 100
@State private var bottomInset: CGFloat = 0
let minHeight: CGFloat = 100
let midHeight: CGFloat = 300
let maxHeight: CGFloat = 600
var isTabWindowActive: Bool {
sceneDelegate.tabWindow != nil
}
......@@ -46,6 +55,14 @@ struct MainTabView: View {
padView
}
}
.background(
GeometryReader { proxy in
Color.clear
.onAppear {
bottomInset = proxy.safeAreaInsets.bottom
}
}
)
.onAppear {
SharingData.location.focusOwnShip = true
configureTabBarAppearance()
......@@ -53,7 +70,8 @@ struct MainTabView: View {
}
private var phoneView: some View {
ZStack(alignment: .bottom) {
let tabBarHeight: CGFloat = bottomInset
return ZStack(alignment: .bottom) {
TabView(selection: $selectedTabModel.activeTab) {
mapTab
if SharingData.my.isCommunication {
......@@ -62,17 +80,33 @@ struct MainTabView: View {
NotificationView().tag(Tab.alert)
MenuView(isSignout: $isSignout).tag(Tab.menu)
}
.sheet(isPresented: .constant(isTaskSel && isTabWindowActive)) {
MenuTaskView()
.zIndex(0)
.presentationDragIndicator(.hidden)
.presentationDetents([.height(150), .medium, .fraction(0.99)])
.presentationCornerRadius(15)
.presentationBackgroundInteraction(.enabled(upThrough: .medium))
.presentationBackground(ColorSet.BackgroundSecondary.color)
.interactiveDismissDisabled()
.overlay(alignment: .bottom) {
if selectedTabModel.activeTab == .map {
MenuTaskView()
.frame(height: max(minHeight, sheetHeight - tabBarHeight))
.background(.ultraThinMaterial)
.clipShape(RoundedRectangle(cornerRadius: 16))
.padding(.bottom, tabBarHeight)
.gesture(
DragGesture()
.onChanged { value in
let newHeight = dragStartHeight - value.translation.height
sheetHeight = max(minHeight, min(maxHeight, newHeight))
}
.onEnded { _ in
let detents: [CGFloat] = [minHeight, midHeight, maxHeight]
sheetHeight = detents.min {
abs($0 - sheetHeight) < abs($1 - sheetHeight)
} ?? minHeight
dragStartHeight = sheetHeight
}
)
}
}
}
.onAppear {
dragStartHeight = sheetHeight
}
}
private var padView: some View {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment