Skip to content

Commit 55f06c6

Browse files
97chosinteractord
authored andcommitted
fixed: Unified 'LinkItem' parameter name in TabLinkNavigatorProtocol.
items, item -> linkItem
1 parent f1f921c commit 55f06c6

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ extension TabPartialNavigator: TabLinkNavigatorProtocol {
227227
sheetOpen(item: linkItem, isAnimated: isAnimated, type: type)
228228
}
229229

230-
public func rootReloadLast(items: LinkItem, isAnimated: Bool) {
231-
let viewControllers = navigationBuilder.build(item: items)
230+
public func rootReloadLast(linkItem: LinkItem, isAnimated: Bool) {
231+
let viewControllers = navigationBuilder.build(item: linkItem)
232232
guard !viewControllers.isEmpty else { return }
233233

234234
let reloadedVC = viewControllers.reduce(rootController.viewControllers) { current, next in
@@ -245,46 +245,46 @@ extension TabPartialNavigator: TabLinkNavigatorProtocol {
245245
currentController?.present(model.build(), animated: true)
246246
}
247247

248-
public func send(item: LinkItem) {
248+
public func send(linkItem: LinkItem) {
249249
rootNavigator?.tabRootNavigators
250250
.flatMap(\.navigationController.viewControllers)
251251
.compactMap { $0 as? MatchPathUsable }
252-
.filter { item.pathList.contains($0.matchPath) }
252+
.filter { linkItem.pathList.contains($0.matchPath) }
253253
.forEach {
254-
$0.eventSubscriber?.receive(encodedItemString: item.encodedItemString)
254+
$0.eventSubscriber?.receive(encodedItemString: linkItem.encodedItemString)
255255
}
256256
}
257257

258-
public func rootSend(item: LinkItem) {
258+
public func rootSend(linkItem: LinkItem) {
259259
rootController.viewControllers
260260
.compactMap { $0 as? MatchPathUsable }
261-
.filter { item.pathList.contains($0.matchPath) }
261+
.filter { linkItem.pathList.contains($0.matchPath) }
262262
.forEach {
263-
$0.eventSubscriber?.receive(encodedItemString: item.encodedItemString)
263+
$0.eventSubscriber?.receive(encodedItemString: linkItem.encodedItemString)
264264
}
265265
}
266266

267-
public func mainSend(item: LinkItem) {
267+
public func mainSend(linkItem: LinkItem) {
268268
guard let owner else { return }
269269
DispatchQueue.main.async {
270-
owner.receive(encodedItemString: item.encodedItemString)
270+
owner.receive(encodedItemString: linkItem.encodedItemString)
271271
}
272272
}
273273

274-
public func allSend(item: LinkItem) {
274+
public func allSend(linkItem: LinkItem) {
275275
rootNavigator?.tabRootNavigators
276276
.flatMap(\.navigationController.viewControllers)
277277
.compactMap { $0 as? MatchPathUsable }
278278
.forEach {
279-
$0.eventSubscriber?.receive(encodedItemString: item.encodedItemString)
279+
$0.eventSubscriber?.receive(encodedItemString: linkItem.encodedItemString)
280280
}
281281
}
282282

283-
public func allRootSend(item: LinkItem) {
283+
public func allRootSend(linkItem: LinkItem) {
284284
rootController.viewControllers
285285
.compactMap { ($0 as? MatchPathUsable)?.eventSubscriber }
286286
.forEach {
287-
$0.receive(encodedItemString: item.encodedItemString)
287+
$0.receive(encodedItemString: linkItem.encodedItemString)
288288
}
289289
}
290290

Sources/LinkNavigator/Core/Protocol/TabLinkNavigatorProtocol.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public protocol TabLinkNavigatorProtocol {
117117
/// - Parameters:
118118
/// - items: A string representing the raw QueryString for the items to reload.
119119
/// - isAnimated: A Boolean value indicating whether the reload should be animated.
120-
func rootReloadLast(items: LinkItem, isAnimated: Bool)
120+
func rootReloadLast(linkItem: LinkItem, isAnimated: Bool)
121121

122122
/// Displays an alert with the specified target and model. Depending on the target parameter,
123123
/// the alert is displayed either on the root or the sub-controller.
@@ -133,27 +133,27 @@ public protocol TabLinkNavigatorProtocol {
133133
/// This method facilitates communication between pages, allowing data to be transferred to a specific 'sub' or page sheet as defined in the link item.
134134
///
135135
/// - Parameter item: The link item encapsulating the data and the target path to be sent.
136-
func send(item: LinkItem)
136+
func send(linkItem: LinkItem)
137137

138138
/// Sends the specified link item to the root controller which governs the page sheets (sub). This method is mainly used for communications directly involving the root controller which has overarching control over page sheets.
139139
///
140140
/// - Parameter item: The link item to be sent to the root controller.
141-
func rootSend(item: LinkItem)
141+
func rootSend(linkItem: LinkItem)
142142

143143
/// Sends the main items directly to the appMain, which is a NavigationController that wraps around the link navigator. This method allows for data communication directly with the appMain, facilitating broad-reaching communications within the app.
144144
///
145145
/// - Parameter item: The main items to be sent, often containing key-value pairs of data to be communicated to the appMain.
146-
func mainSend(item: LinkItem)
146+
func mainSend(linkItem: LinkItem)
147147

148148
/// Sends the specified items to all designated receivers, including both the 'sub' page sheets and the root controllers, within the current navigation stack. This allows for a widespread dissemination of data across various levels of the navigation stack.
149149
///
150150
/// - Parameter item: The items to be sent to all receivers, encapsulating data that may be relevant across multiple page sheets and root controllers.
151-
func allSend(item: LinkItem)
151+
func allSend(linkItem: LinkItem)
152152

153153
/// Sends the specified items to all root controllers in the navigation stack. This method is instrumental in disseminating information broadly at the root level, which governs the behaviors and states of the 'sub' page sheets.
154154
///
155155
/// - Parameter item: The items to be sent to all root controllers, typically containing information pertinent across all root level pages.
156-
func allRootSend(item: LinkItem)
156+
func allRootSend(linkItem: LinkItem)
157157

158158
func moveTab(path: String)
159159
}

0 commit comments

Comments
 (0)