Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions iBox/Sources/BoxList/BoxListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ class BoxListViewController: BaseViewController<BoxListView>, BaseViewController
var shouldPresentModalAutomatically: Bool = false {
didSet {
if shouldPresentModalAutomatically {
// shouldPresentModalAutomatically가 true로 설정될 때 함수 호출
if findAddBookmarkView() == nil {
if findAddBookmarkViewController() == false {
dismiss(animated: false)
self.addButtonTapped()
}
// 함수 호출 후 shouldPresentModalAutomatically를 false로 설정
shouldPresentModalAutomatically = false
}
}
Expand Down
15 changes: 5 additions & 10 deletions iBox/Sources/Extension/UIViewController+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,11 @@ extension UIViewController {
return nil
}

func findAddBookmarkView() -> Bool? {
var responder: UIResponder? = self
while let nextResponder = responder?.next {
if let viewController = nextResponder as? AddBookmarkView {
return true
}
responder = nextResponder
func findAddBookmarkViewController() -> Bool {
if let navigationController = presentedViewController as? UINavigationController,
let _ = navigationController.topViewController as? AddBookmarkViewController {
return true
}
return nil
return false
}


}