Skip to content

Commit

Permalink
appendNewWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
songwentong committed Dec 25, 2019
1 parent e78f83f commit 0a0e93f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/WTKit/UIKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public extension UITabBarController{

public extension UIApplication{
@available(iOS 13.0, *)
static func appendNewWindow() -> UIWindow? {
static func appendNewWindow<T:UIWindow>() -> T? {
let sceneList = UIApplication.shared.connectedScenes.compactMap { (s:UIScene) -> UIWindowScene? in
if let s2 = s as? UIWindowScene{
return s2
Expand All @@ -443,7 +443,7 @@ public extension UIApplication{
guard let first = sceneList.first else{
return nil
}
let win = UIWindow.init(windowScene: first)
let win = T.init(windowScene: first)
win.windowLevel = UIWindow.Level.statusBar + 1
win.backgroundColor = UIColor.clear
win.frame = UIScreen.mainScreenBounds
Expand Down

0 comments on commit 0a0e93f

Please sign in to comment.