-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from 87kangsw/feature/75-build-warning-fix
빌드 Warning 수정
- Loading branch information
Showing
6 changed files
with
48 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
GitTime/Sources/Utils/Extensions/UIApplication+Extensions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// UIApplication+Extensions.swift | ||
// GitTime | ||
// | ||
// Created by Kanz on 2022/04/26. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIApplication { | ||
static var keyWindow: UIWindow? { | ||
if #available(iOS 15.0, *) { | ||
return UIApplication.shared.connectedScenes | ||
.filter { $0.activationState == .foregroundActive } | ||
.first(where: { $0 is UIWindowScene }) | ||
.flatMap { $0 as? UIWindowScene }?.windows | ||
.first(where: \.isKeyWindow) | ||
} else { | ||
return UIApplication.shared.windows.first(where: { $0.isKeyWindow }) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters