Skip to content

Commit f1f921c

Browse files
97chosinteractord
authored andcommitted
fix: TabLinkNavigator - Removed targetTabPath parameter method
1 parent 25a7be4 commit f1f921c

2 files changed

Lines changed: 0 additions & 75 deletions

File tree

Sources/LinkNavigator/Core/Core/TabLinkNavigator/TabPartialNavigator.swift

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,10 @@ extension TabPartialNavigator: TabLinkNavigatorProtocol {
9191
isAnimated: isAnimated)
9292
}
9393

94-
public func rootNext(linkItem: LinkItem, targetTabPath: String, isAnimated: Bool) {
95-
rootNavigator?.targetController(targetTabPath: targetTabPath)?
96-
.merge(
97-
new: navigationBuilder.build(item: linkItem),
98-
isAnimated: isAnimated)
99-
}
100-
10194
public func back(isAnimated: Bool) {
10295
currentController?.back(isAnimated: isAnimated)
10396
}
10497

105-
public func back(targetTabPath: String, isAnimated: Bool) {
106-
rootNavigator?.targetController(targetTabPath: targetTabPath)?.back(isAnimated: isAnimated)
107-
}
108-
10998
public func rootBack(isAnimated: Bool) {
11099
rootController.back(isAnimated: isAnimated)
111100
}
@@ -132,18 +121,6 @@ extension TabPartialNavigator: TabLinkNavigatorProtocol {
132121
rootController.popToViewController(pick, animated: isAnimated)
133122
}
134123

135-
public func rootBackOrNext(linkItem: LinkItem, targetTabPath: String, isAnimated: Bool) {
136-
guard
137-
let pick = navigationBuilder.firstPick(
138-
controller: currentController,
139-
item: linkItem)
140-
else {
141-
return
142-
}
143-
144-
rootNavigator?.targetController(targetTabPath: targetTabPath)?.popToViewController(pick, animated: isAnimated)
145-
}
146-
147124
public func replace(linkItem: LinkItem, isAnimated: Bool) {
148125
let viewControllers = navigationBuilder.build(item: linkItem)
149126
guard !viewControllers.isEmpty else { return }
@@ -166,18 +143,6 @@ extension TabPartialNavigator: TabLinkNavigatorProtocol {
166143
}
167144
}
168145

169-
public func rootReplace(linkItem: LinkItem, targetTabPath: String, isAnimated: Bool, closeAll: Bool) {
170-
let viewControllers = navigationBuilder.build(item: linkItem)
171-
guard !viewControllers.isEmpty else { return }
172-
173-
rootNavigator?.targetController(targetTabPath: targetTabPath)?
174-
.replace(viewController: viewControllers, isAnimated: isAnimated)
175-
176-
if closeAll {
177-
rootNavigator?.closeAll(isAnimated: isAnimated, completion: { })
178-
}
179-
}
180-
181146
public func remove(pathList: [String]) {
182147
currentController?.setViewControllers(
183148
navigationBuilder.exceptFilter(
@@ -194,15 +159,6 @@ extension TabPartialNavigator: TabLinkNavigatorProtocol {
194159
animated: false)
195160
}
196161

197-
public func rootRemove(pathList: [String], targetTabPath: String) {
198-
rootNavigator?.targetController(targetTabPath: targetTabPath)?
199-
.setViewControllers(
200-
navigationBuilder.exceptFilter(
201-
controller: rootController,
202-
item: .init(pathList: pathList)),
203-
animated: false)
204-
}
205-
206162
public func backToLast(path: String, isAnimated: Bool) {
207163
currentController?.popTo(
208164
viewController: navigationBuilder.lastPick(
@@ -252,29 +208,6 @@ extension TabPartialNavigator: TabLinkNavigatorProtocol {
252208
rootNavigator?.closeAll(isAnimated: isAnimated, completion: completion)
253209
}
254210

255-
public func rootBackToLast(path: String, targetTabPath: String, isAnimated: Bool) {
256-
rootNavigator?.targetController(targetTabPath: targetTabPath)?
257-
.popTo(
258-
viewController: navigationBuilder.lastPick(
259-
controller: rootController,
260-
item: .init(path: path)),
261-
isAnimated: isAnimated)
262-
}
263-
264-
public func rootReloadLast(items: LinkItem, targetTabPath: String, isAnimated: Bool) {
265-
let viewControllers = navigationBuilder.build(item: items)
266-
guard !viewControllers.isEmpty else { return }
267-
268-
let reloadedVC = viewControllers.reduce(rootController.viewControllers) { current, next in
269-
guard let idx = current.firstIndex(of: next) else { return current }
270-
var variableCurrentVC = current
271-
variableCurrentVC[idx] = next
272-
return variableCurrentVC
273-
}
274-
275-
rootNavigator?.targetController(targetTabPath: targetTabPath)?.setViewControllers(reloadedVC, animated: isAnimated)
276-
}
277-
278211
public func sheet(linkItem: LinkItem, isAnimated: Bool) {
279212
sheetOpen(item: linkItem, isAnimated: isAnimated, type: .automatic)
280213
}

Sources/LinkNavigator/Core/Protocol/TabLinkNavigatorProtocol.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public protocol TabLinkNavigatorProtocol {
1616
/// - linkItem: The link item to navigate to at the root level.
1717
/// - isAnimated: A Boolean value that determines whether the navigation is animated.
1818
func rootNext(linkItem: LinkItem, isAnimated: Bool)
19-
func rootNext(linkItem: LinkItem, targetTabPath: String, isAnimated: Bool)
2019

2120
/// Presents a sheet with the given link item.
2221
///
@@ -57,8 +56,6 @@ public protocol TabLinkNavigatorProtocol {
5756

5857
func rootReplace(linkItem: LinkItem, isAnimated: Bool, closeAll: Bool)
5958

60-
func rootReplace(linkItem: LinkItem, targetTabPath: String, isAnimated: Bool, closeAll: Bool)
61-
6259
/// Navigates either back or to the next link item based on the current state.
6360
///
6461
/// - Parameters:
@@ -72,13 +69,11 @@ public protocol TabLinkNavigatorProtocol {
7269
/// - linkItem: The link item to navigate to or back from at the root level.
7370
/// - isAnimated: A Boolean value that determines whether the navigation is animated.
7471
func rootBackOrNext(linkItem: LinkItem, isAnimated: Bool)
75-
func rootBackOrNext(linkItem: LinkItem, targetTabPath: String, isAnimated: Bool)
7672

7773
/// Navigates back in the navigation stack.
7874
///
7975
/// - Parameter isAnimated: A Boolean value that determines whether the navigation is animated.
8076
func back(isAnimated: Bool)
81-
func back(targetTabPath: String, isAnimated: Bool)
8277

8378
/// Removes the specified paths from the navigation stack.
8479
///
@@ -89,7 +84,6 @@ public protocol TabLinkNavigatorProtocol {
8984
///
9085
/// - Parameter pathList: A list of paths to remove from the root of the navigation stack.
9186
func rootRemove(pathList: [String])
92-
func rootRemove(pathList: [String], targetTabPath: String)
9387

9488
/// Navigates back to the last specified path.
9589
///
@@ -104,7 +98,6 @@ public protocol TabLinkNavigatorProtocol {
10498
/// - path: The root path to navigate back to.
10599
/// - isAnimated: A Boolean value indicating whether the navigation should be animated.
106100
func rootBackToLast(path: String, isAnimated: Bool)
107-
func rootBackToLast(path: String, targetTabPath: String, isAnimated: Bool)
108101

109102
/// Closes the navigation interface.
110103
///
@@ -125,7 +118,6 @@ public protocol TabLinkNavigatorProtocol {
125118
/// - items: A string representing the raw QueryString for the items to reload.
126119
/// - isAnimated: A Boolean value indicating whether the reload should be animated.
127120
func rootReloadLast(items: LinkItem, isAnimated: Bool)
128-
func rootReloadLast(items: LinkItem, targetTabPath: String, isAnimated: Bool)
129121

130122
/// Displays an alert with the specified target and model. Depending on the target parameter,
131123
/// the alert is displayed either on the root or the sub-controller.

0 commit comments

Comments
 (0)