Skip to content

Commit 3eb18fd

Browse files
Copilotaromanov91
andauthored
Fix typos and improve naming conventions across navigation components (#8)
* Initial plan * Fix critical typos and incorrect file comments Co-authored-by: aromanov91 <[email protected]> * Complete naming improvements and add backward compatibility Co-authored-by: aromanov91 <[email protected]> * Fix additional typos in file headers and code content Co-authored-by: aromanov91 <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: aromanov91 <[email protected]> Co-authored-by: Alexander Romanov <[email protected]>
1 parent e637a10 commit 3eb18fd

File tree

10 files changed

+97
-44
lines changed

10 files changed

+97
-44
lines changed

Sources/OversizeNavigation/Alert/AlertResolve.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Copyright © 2024 Alexander Romanov
3-
// AlertRouter.swift, created on 11.04.2024
3+
// AlertResolve.swift, created on 11.04.2024
44
//
55

66
import OversizeLocalizable
@@ -46,7 +46,7 @@ public extension AppAlert {
4646
case .discard:
4747
"discard"
4848
case .default:
49-
"default`"
49+
"default"
5050
}
5151
}
5252
}

Sources/OversizeNavigation/NavigationCoverLayout/NavigationCoverLayoutView.swift

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Copyright © 2025 Alexander Romanov
3-
// PageView.swift, created on 06.06.2025
3+
// NavigationCoverLayoutView.swift, created on 06.06.2025
44
//
55

66
import NavigatorUI
@@ -25,7 +25,7 @@ public struct NavigationCoverLayoutView<
2525
var coverStyle: CoverNavigationType = .static
2626
var contentCornerRadius: CGFloat = 0
2727

28-
@State private var isPresentBackConfirmation: Bool = false
28+
@State private var isBackConfirmationPresented: Bool = false
2929

3030
public var body: some View {
3131
CoverLayoutView(
@@ -41,23 +41,23 @@ public struct NavigationCoverLayoutView<
4141
.toolbar {
4242
if isShowBackButton {
4343
ToolbarItem(placement: .cancellationAction) {
44-
Button(action: onTapBackButton) {
44+
Button(action: handleBackButtonTap) {
4545
backImage.icon()
4646
}
4747
.confirmationDialog(
4848
backConfirmation?.title ?? "Are you sure?",
49-
isPresented: $isPresentBackConfirmation,
49+
isPresented: $isBackConfirmationPresented,
5050
titleVisibility: .visible,
5151
presenting: backConfirmation,
5252
actions: { details in
5353
Button(
5454
details.confirmationButtonTitle,
55-
action: onTapConfirmationBack
55+
action: handleConfirmationBackTap
5656
)
5757
Button(
5858
details.cancelButtonTitle ?? "Cancel",
5959
role: .cancel,
60-
action: onTapConfirmationCancel
60+
action: handleConfirmationCancelTap
6161
)
6262
},
6363
message: { details in
@@ -71,21 +71,37 @@ public struct NavigationCoverLayoutView<
7171
.navigationBarBackButtonHidden(isNavigationBarBackButtonHidden)
7272
}
7373

74-
private func onTapBackButton() {
74+
private func handleBackButtonTap() {
7575
if backConfirmation == nil {
7676
navigator.back()
7777
} else {
78-
isPresentBackConfirmation = true
78+
isBackConfirmationPresented = true
7979
}
8080
}
8181

82-
private func onTapConfirmationBack() {
83-
isPresentBackConfirmation = false
82+
private func handleConfirmationBackTap() {
83+
isBackConfirmationPresented = false
8484
navigator.back()
8585
}
8686

87+
private func handleConfirmationCancelTap() {
88+
isBackConfirmationPresented = false
89+
}
90+
91+
// MARK: - Deprecated methods for backward compatibility
92+
@available(*, deprecated, renamed: "handleBackButtonTap")
93+
private func onTapBackButton() {
94+
handleBackButtonTap()
95+
}
96+
97+
@available(*, deprecated, renamed: "handleConfirmationBackTap")
98+
private func onTapConfirmationBack() {
99+
handleConfirmationBackTap()
100+
}
101+
102+
@available(*, deprecated, renamed: "handleConfirmationCancelTap")
87103
private func onTapConfirmationCancel() {
88-
isPresentBackConfirmation = false
104+
handleConfirmationCancelTap()
89105
}
90106

91107
private var isInteractiveBackDisabled: Bool {

Sources/OversizeNavigation/NavigationCoverLayout/NavigationCoverLayoutViewModifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Copyright © 2025 Alexander Romanov
3-
// NavigationCoverPageViewModifier.swift, created on 07.06.2025
3+
// NavigationCoverLayoutViewModifier.swift, created on 07.06.2025
44
//
55

66
import OversizeUI

Sources/OversizeNavigation/NavigationLayout/NavigationLayoutView.swift

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Copyright © 2025 Alexander Romanov
3-
// PageView.swift, created on 06.06.2025
3+
// NavigationLayoutView.swift, created on 06.06.2025
44
//
55

66
import NavigatorUI
@@ -21,7 +21,7 @@ public struct NavigationLayoutView<
2121
var backConfirmation: BackConfirmationContent?
2222
var isBackButtonHidden: Bool?
2323

24-
@State private var isPresentBackConfirmation: Bool = false
24+
@State private var isBackConfirmationPresented: Bool = false
2525

2626
public var body: some View {
2727
LayoutView(
@@ -33,23 +33,23 @@ public struct NavigationLayoutView<
3333
.toolbar {
3434
if isShowBackButton {
3535
ToolbarItem(placement: .cancellationAction) {
36-
Button(action: onTapBackButton) {
36+
Button(action: handleBackButtonTap) {
3737
backImage.icon()
3838
}
3939
.confirmationDialog(
4040
backConfirmation?.title ?? "Are you sure?",
41-
isPresented: $isPresentBackConfirmation,
41+
isPresented: $isBackConfirmationPresented,
4242
titleVisibility: .visible,
4343
presenting: backConfirmation,
4444
actions: { details in
4545
Button(
4646
details.confirmationButtonTitle,
47-
action: onTapConfirmationBack
47+
action: handleConfirmationBackTap
4848
)
4949
Button(
5050
details.cancelButtonTitle ?? "Cancel",
5151
role: .cancel,
52-
action: onTapConfirmationCancel
52+
action: handleConfirmationCancelTap
5353
)
5454
},
5555
message: { details in
@@ -63,21 +63,37 @@ public struct NavigationLayoutView<
6363
.navigationBarBackButtonHidden(isNavigationBarBackButtonHidden)
6464
}
6565

66-
private func onTapBackButton() {
66+
private func handleBackButtonTap() {
6767
if backConfirmation == nil {
6868
navigator.back()
6969
} else {
70-
isPresentBackConfirmation = true
70+
isBackConfirmationPresented = true
7171
}
7272
}
7373

74-
private func onTapConfirmationBack() {
75-
isPresentBackConfirmation = false
74+
private func handleConfirmationBackTap() {
75+
isBackConfirmationPresented = false
7676
navigator.back()
7777
}
7878

79+
private func handleConfirmationCancelTap() {
80+
isBackConfirmationPresented = false
81+
}
82+
83+
// MARK: - Deprecated methods for backward compatibility
84+
@available(*, deprecated, renamed: "handleBackButtonTap")
85+
private func onTapBackButton() {
86+
handleBackButtonTap()
87+
}
88+
89+
@available(*, deprecated, renamed: "handleConfirmationBackTap")
90+
private func onTapConfirmationBack() {
91+
handleConfirmationBackTap()
92+
}
93+
94+
@available(*, deprecated, renamed: "handleConfirmationCancelTap")
7995
private func onTapConfirmationCancel() {
80-
isPresentBackConfirmation = false
96+
handleConfirmationCancelTap()
8197
}
8298

8399
private var isInteractiveBackDisabled: Bool {

Sources/OversizeNavigation/NavigationLayout/NavigationLayoutViewModifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Copyright © 2025 Alexander Romanov
3-
// NavigationPageViewModifier.swift, created on 07.06.2025
3+
// NavigationLayoutViewModifier.swift, created on 07.06.2025
44
//
55

66
import SwiftUI

Sources/OversizeNavigation/NavigationListLayout/NavigationListLayoutView.swift

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Copyright © 2025 Alexander Romanov
3-
// PageView.swift, created on 06.06.2025
3+
// NavigationListLayoutView.swift, created on 06.06.2025
44
//
55

66
import NavigatorUI
@@ -20,7 +20,7 @@ public struct NavigationListLayoutView<
2020
var backConfirmation: BackConfirmationContent?
2121
var isBackButtonHidden: Bool?
2222

23-
@State private var isPresentBackConfirmation: Bool = false
23+
@State private var isBackConfirmationPresented: Bool = false
2424

2525
public var body: some View {
2626
ListLayoutView(
@@ -31,23 +31,23 @@ public struct NavigationListLayoutView<
3131
.toolbar {
3232
if isShowBackButton {
3333
ToolbarItem(placement: .cancellationAction) {
34-
Button(action: onTapBackButton) {
34+
Button(action: handleBackButtonTap) {
3535
backImage.icon()
3636
}
3737
.confirmationDialog(
3838
backConfirmation?.title ?? "Are you sure?",
39-
isPresented: $isPresentBackConfirmation,
39+
isPresented: $isBackConfirmationPresented,
4040
titleVisibility: .visible,
4141
presenting: backConfirmation,
4242
actions: { details in
4343
Button(
4444
details.confirmationButtonTitle,
45-
action: onTapConfirmationBack
45+
action: handleConfirmationBackTap
4646
)
4747
Button(
4848
details.cancelButtonTitle ?? "Cancel",
4949
role: .cancel,
50-
action: onTapConfirmationCancel
50+
action: handleConfirmationCancelTap
5151
)
5252
},
5353
message: { details in
@@ -61,21 +61,37 @@ public struct NavigationListLayoutView<
6161
.navigationBarBackButtonHidden(isNavigationBarBackButtonHidden)
6262
}
6363

64-
private func onTapBackButton() {
64+
private func handleBackButtonTap() {
6565
if backConfirmation == nil {
6666
navigator.back()
6767
} else {
68-
isPresentBackConfirmation = true
68+
isBackConfirmationPresented = true
6969
}
7070
}
7171

72-
private func onTapConfirmationBack() {
73-
isPresentBackConfirmation = false
72+
private func handleConfirmationBackTap() {
73+
isBackConfirmationPresented = false
7474
navigator.back()
7575
}
7676

77+
private func handleConfirmationCancelTap() {
78+
isBackConfirmationPresented = false
79+
}
80+
81+
// MARK: - Deprecated methods for backward compatibility
82+
@available(*, deprecated, renamed: "handleBackButtonTap")
83+
private func onTapBackButton() {
84+
handleBackButtonTap()
85+
}
86+
87+
@available(*, deprecated, renamed: "handleConfirmationBackTap")
88+
private func onTapConfirmationBack() {
89+
handleConfirmationBackTap()
90+
}
91+
92+
@available(*, deprecated, renamed: "handleConfirmationCancelTap")
7793
private func onTapConfirmationCancel() {
78-
isPresentBackConfirmation = false
94+
handleConfirmationCancelTap()
7995
}
8096

8197
private var isInteractiveBackDisabled: Bool {

Sources/OversizeNavigation/NavigationListLayout/NavigationListLayoutViewModifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Copyright © 2025 Alexander Romanov
3-
// NavigationPageViewModifier.swift, created on 07.06.2025
3+
// NavigationListLayoutViewModifier.swift, created on 07.06.2025
44
//
55

66
import SwiftUI

Sources/OversizeNavigation/ViewModifier/NavigationBarStyle.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Copyright © 2025 Alexander Romanov
3-
// NavigationBarAppearenceColor.swift, created on 05.06.2025
3+
// NavigationBarStyle.swift, created on 05.06.2025
44
//
55

66
import OversizeUI
@@ -9,7 +9,7 @@ import SwiftUI
99
import UIKit
1010
#endif
1111

12-
public struct NavigationBarAppearence: ViewModifier {
12+
public struct NavigationBarAppearance: ViewModifier {
1313
public init() {
1414
#if os(iOS)
1515
if #unavailable(iOS 26.0) {
@@ -56,9 +56,14 @@ public struct NavigationBarAppearence: ViewModifier {
5656
}
5757

5858
public extension View {
59-
func naviagtionBarAppearenceConfiguration() -> some View {
59+
func navigationBarAppearanceConfiguration() -> some View {
6060
modifier(
61-
NavigationBarAppearence()
61+
NavigationBarAppearance()
6262
)
6363
}
64+
65+
@available(*, deprecated, renamed: "navigationBarAppearanceConfiguration")
66+
func naviagtionBarAppearenceConfiguration() -> some View {
67+
navigationBarAppearanceConfiguration()
68+
}
6469
}

Sources/OversizeNavigation/ViewModifier/NavigationDestinationModifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Copyright © 2025 Alexander Romanov
3-
// NavigationDestinationValueModifier.swift, created on 09.06.2025
3+
// NavigationDestinationModifier.swift, created on 09.06.2025
44
//
55

66
import NavigatorUI

Sources/OversizeNavigation/ViewModifier/NavigationSendValueModifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Copyright © 2025 Alexander Romanov
3-
// NavigationDestinationValueModifier.swift, created on 09.06.2025
3+
// NavigationSendValueModifier.swift, created on 09.06.2025
44
//
55

66
import NavigatorUI

0 commit comments

Comments
 (0)