Skip to content

Commit

Permalink
修复因 interactivePopGestureRecognizer?.delegate 丢失造成应用可能卡住的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
klaus01 committed Mar 10, 2018
1 parent 0ac8f5f commit 6295ebe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ruby-china-ios/Controllers/TopicDetailsViewController.swift
Expand Up @@ -14,7 +14,7 @@ class TopicDetailsViewController: WebViewController {
fileprivate var followButton: UIButton!
fileprivate var likeButton: UIButton!
fileprivate var favorited: Bool = false

fileprivate var interactivePopDelegate: UIGestureRecognizerDelegate?

convenience init(topicID: Int, topicPath: String? = nil) {
self.init(path: topicPath ?? "/topics/\(topicID)")
Expand All @@ -33,13 +33,15 @@ class TopicDetailsViewController: WebViewController {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(true, animated: animated)
navigationController?.setToolbarHidden(false, animated: animated)
interactivePopDelegate = navigationController?.interactivePopGestureRecognizer?.delegate
navigationController?.interactivePopGestureRecognizer?.delegate = nil
}

override func viewWillDisappear(_ animated: Bool) {
super.viewDidAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: animated)
navigationController?.setToolbarHidden(true, animated: animated)
navigationController?.interactivePopGestureRecognizer?.delegate = interactivePopDelegate
}

func setToolbars() {
Expand Down

0 comments on commit 6295ebe

Please sign in to comment.