Skip to content

Commit

Permalink
🐛 :: [#496] Swift expression 문법 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
baekteun committed Apr 23, 2024
1 parent dd215d5 commit 86df09f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Projects/App/Sources/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,22 +110,24 @@ private extension AppDelegate {
super.motionEnded(motion, with: event)
switch motion {
case .motionShake:
guard let topViewController = if #available(iOS 15.0, *) {
UIApplication.shared.connectedScenes
let topViewController: UIViewController?
if #available(iOS 15.0, *) {
topViewController = UIApplication.shared.connectedScenes
.compactMap { $0 as? UIWindowScene }
.filter { $0.activationState == .foregroundActive }
.first?
.keyWindow?
.rootViewController
} else {
UIApplication.shared.connectedScenes
topViewController = UIApplication.shared.connectedScenes
.compactMap { $0 as? UIWindowScene }
.filter { $0.activationState == .foregroundActive }
.first?
.windows
.first(where: \.isKeyWindow)?
.rootViewController
} else { break }
}
guard let topViewController else { break }
if let nav = topViewController as? UINavigationController {
nav.visibleViewController?.present(LogHistoryViewController(), animated: true)
} else {
Expand Down

0 comments on commit 86df09f

Please sign in to comment.