Fixed view for iOS 14
This commit is contained in:
parent
cf0d721a1b
commit
8b8067be71
|
@ -30,16 +30,25 @@ extension View {
|
|||
|
||||
func customNavigationBarBackButton(_ onBackButtonPressed: @escaping () -> Void) -> some View {
|
||||
return self
|
||||
.navigationBarHidden(false)
|
||||
.navigationBarBackButtonHidden(true)
|
||||
.navigationBarItems(leading: createCancelButton(onBackButtonPressed))
|
||||
.setLeadingNavigationBarButton(createCancelButton(onBackButtonPressed))
|
||||
}
|
||||
|
||||
func setCancelAndDoneNavigationBarButtons(onCancelPressed: @escaping () -> Void, onDonePressed: @escaping () -> Void) -> some View {
|
||||
return self
|
||||
.customizeToSetLeadingNavigationBarButton()
|
||||
.navigationBarItems(leading: createCancelButton(onCancelPressed), trailing: createDoneButton(onDonePressed))
|
||||
}
|
||||
|
||||
func setLeadingNavigationBarButton<Button: View>(_ leadingButton: Button) -> some View {
|
||||
return self
|
||||
.customizeToSetLeadingNavigationBarButton()
|
||||
.navigationBarItems(leading: leadingButton)
|
||||
}
|
||||
|
||||
func customizeToSetLeadingNavigationBarButton() -> some View {
|
||||
return self
|
||||
.navigationBarHidden(false)
|
||||
.navigationBarBackButtonHidden(true)
|
||||
.navigationBarItems(leading: createCancelButton(onCancelPressed), trailing: createDoneButton(onDonePressed))
|
||||
}
|
||||
|
||||
func createDoneButton(_ onDoneButtonPressed: @escaping () -> Void) -> some View {
|
||||
|
|
|
@ -68,8 +68,11 @@ struct LoginDialog: View {
|
|||
|
||||
Spacer()
|
||||
}
|
||||
.fixKeyboardCoversLowerPart()
|
||||
.systemGroupedBackground()
|
||||
.edgesIgnoringSafeArea(.all)
|
||||
.showNavigationBarTitle("Login Dialog title")
|
||||
.navigationBarItems(leading: allowCancellingLogin == false ? nil : createCancelButton {
|
||||
.setLeadingNavigationBarButton(allowCancellingLogin == false ? nil : createCancelButton {
|
||||
self.closeDialogAndDispatchLoginResult(false)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue