Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5463261

Browse files
committed
[RepositoryDetail] Change Back Button Implementation
1 parent1a3dbd5 commit5463261

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

‎SwiftFlowGitHubBrowser/ViewControllers/RepositoryDetailViewController.swift‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ class RepositoryDetailViewController: UIViewController, StoreSubscriber {
1818

1919
varrepository:Repository?
2020

21+
overridefunc didMoveToParentViewController(parent:UIViewController?){
22+
if parent==nil{
23+
// Required to update the route, when this VC was dismissed through back button from
24+
// NavigationController, since we can't intercept the back button
25+
if store.state.navigationState.route==[mainViewRoute, repositoryDetailRoute]{
26+
store.dispatch(SetRouteAction([mainViewRoute]))
27+
}
28+
}
29+
}
30+
2131
overridefunc viewWillAppear(animated:Bool){
2232
super.viewWillAppear(animated)
2333

@@ -33,12 +43,6 @@ class RepositoryDetailViewController: UIViewController, StoreSubscriber {
3343
super.viewWillDisappear(animated)
3444

3545
store.unsubscribe(self)
36-
37-
// Required to update the route, when this VC was dismissed through back button from
38-
// NavigationController, since we can't intercept the back button
39-
if store.state.navigationState.route==[mainViewRoute, repositoryDetailRoute]{
40-
store.dispatch(SetRouteAction([mainViewRoute]))
41-
}
4246
}
4347

4448
func newState(state:(selectedRepository:Repository?, bookmarks:[Bookmark])){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp