@@ -40,6 +40,21 @@ class NativeFlowController {
40
40
return item
41
41
} ( )
42
42
43
+ private lazy var navigationBarSkipBarButtonItem : UIBarButtonItem = {
44
+ let item = UIBarButtonItem (
45
+ title: STPLocalizedString ( " Skip " , " Title of a button that allows users to skip the current screen. " ) ,
46
+ style: . plain,
47
+ target: self ,
48
+ action: #selector( didSelectNavigationBarSkipButton)
49
+ )
50
+ let attributes : [ NSAttributedString . Key : Any ] = [
51
+ . font: FinancialConnectionsFont . label ( . large) . uiFont,
52
+ . foregroundColor: UIColor . textDefault,
53
+ ]
54
+ item. setTitleTextAttributes ( attributes, for: . normal)
55
+ return item
56
+ } ( )
57
+
43
58
init (
44
59
dataManager: NativeFlowDataManager ,
45
60
navigationController: FinancialConnectionsNavigationController
@@ -82,7 +97,11 @@ class NativeFlowController {
82
97
// then also handle "custom manual entry mode"
83
98
closeAuthFlow ( customManualEntry: true )
84
99
} else {
85
- setNavigationControllerViewControllers ( [ viewController] , animated: false )
100
+ setNavigationControllerViewControllers (
101
+ [ viewController] ,
102
+ pane: pane,
103
+ animated: false
104
+ )
86
105
}
87
106
}
88
107
@@ -117,6 +136,16 @@ class NativeFlowController {
117
136
}
118
137
}
119
138
139
+ @objc private func didSelectNavigationBarSkipButton( ) {
140
+ FeedbackGeneratorAdapter . buttonTapped ( )
141
+ dataManager. analyticsClient. log (
142
+ eventName: " click.nav_bar.skip " ,
143
+ pane: FinancialConnectionsAnalyticsClient
144
+ . paneFromViewController ( navigationController. topViewController)
145
+ )
146
+ pushPane ( . success, animated: true )
147
+ }
148
+
120
149
@objc private func applicationWillEnterForeground( ) {
121
150
dataManager
122
151
. analyticsClient
@@ -136,6 +165,13 @@ class NativeFlowController {
136
165
. paneFromViewController ( navigationController. topViewController)
137
166
)
138
167
}
168
+
169
+ private func trailingItem( forPane pane: FinancialConnectionsSessionManifest . NextPane ) -> UIBarButtonItem {
170
+ switch pane {
171
+ case . networkingLinkSignupPane: navigationBarSkipBarButtonItem
172
+ default : navigationBarCloseBarButtonItem
173
+ }
174
+ }
139
175
}
140
176
141
177
// MARK: - Core Navigation Helpers
@@ -144,14 +180,15 @@ extension NativeFlowController {
144
180
145
181
private func setNavigationControllerViewControllers(
146
182
_ viewControllers: [ UIViewController ] ,
183
+ pane: FinancialConnectionsSessionManifest . NextPane ,
147
184
animated: Bool = true
148
185
) {
149
186
dismissVisibleSheetsIfNeeded { [ weak self] in
150
187
guard let self else { return }
151
188
viewControllers. forEach { viewController in
152
189
FinancialConnectionsNavigationController . configureNavigationItemForNative (
153
190
viewController. navigationItem,
154
- closeItem : self . navigationBarCloseBarButtonItem ,
191
+ trailingItem : self . trailingItem ( forPane : pane ) ,
155
192
shouldHideLogo: ShouldHideLogoInNavigationBar (
156
193
forViewController: viewController,
157
194
reducedBranding: self . dataManager. reducedBranding,
@@ -187,20 +224,32 @@ extension NativeFlowController {
187
224
dataManager: dataManager
188
225
)
189
226
if clearNavigationStack, let paneViewController = paneViewController {
190
- setNavigationControllerViewControllers ( [ paneViewController] , animated: animated)
227
+ setNavigationControllerViewControllers (
228
+ [ paneViewController] ,
229
+ pane: pane,
230
+ animated: animated
231
+ )
191
232
} else {
192
- pushViewController ( paneViewController, animated: animated)
233
+ pushViewController (
234
+ paneViewController,
235
+ pane: pane,
236
+ animated: animated
237
+ )
193
238
}
194
239
}
195
240
}
196
241
197
- private func pushViewController( _ viewController: UIViewController ? , animated: Bool ) {
242
+ private func pushViewController(
243
+ _ viewController: UIViewController ? ,
244
+ pane: FinancialConnectionsSessionManifest . NextPane ,
245
+ animated: Bool
246
+ ) {
198
247
dismissVisibleSheetsIfNeeded { [ weak self] in
199
248
guard let self else { return }
200
249
if let viewController = viewController {
201
250
FinancialConnectionsNavigationController . configureNavigationItemForNative (
202
251
viewController. navigationItem,
203
- closeItem : self . navigationBarCloseBarButtonItem ,
252
+ trailingItem : self . trailingItem ( forPane : pane ) ,
204
253
shouldHideLogo: ShouldHideLogoInNavigationBar (
205
254
forViewController: viewController,
206
255
reducedBranding: self . dataManager. reducedBranding,
@@ -283,9 +332,10 @@ extension NativeFlowController {
283
332
}
284
333
285
334
private func startResetFlow( ) {
335
+ let pane : FinancialConnectionsSessionManifest . NextPane = . resetFlow
286
336
guard
287
337
let resetFlowViewController = CreatePaneViewController (
288
- pane: . resetFlow ,
338
+ pane: pane ,
289
339
nativeFlowController: self ,
290
340
dataManager: dataManager
291
341
)
@@ -303,7 +353,11 @@ extension NativeFlowController {
303
353
}
304
354
viewControllers. append ( resetFlowViewController)
305
355
306
- setNavigationControllerViewControllers ( viewControllers, animated: true )
356
+ setNavigationControllerViewControllers (
357
+ viewControllers,
358
+ pane: pane,
359
+ animated: true
360
+ )
307
361
}
308
362
309
363
private func showTerminalError( _ error: Error ? = nil ) {
@@ -331,7 +385,11 @@ extension NativeFlowController {
331
385
closeAuthFlow ( error: terminalError)
332
386
return
333
387
}
334
- setNavigationControllerViewControllers ( [ terminalErrorViewController] , animated: false )
388
+ setNavigationControllerViewControllers (
389
+ [ terminalErrorViewController] ,
390
+ pane: . terminalError,
391
+ animated: false
392
+ )
335
393
}
336
394
337
395
// There's at least four types of close cases:
0 commit comments