Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSyndeo committed Feb 7, 2024
1 parent 3dbe4ee commit bf3ccd4
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions Sources/GreenAlert/UIAlertController+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -240,22 +240,7 @@ public extension UIAlertController {
}
}

// TODO: either import EZSE or migrate away
public extension UIApplication {
/// EZSE: Run a block in background after app resigns activity
func runInBackground(_ closure: @escaping () -> Void, expirationHandler: (() -> Void)? = nil) {
DispatchQueue.main.async {
let taskID: UIBackgroundTaskIdentifier
if let expirationHandler = expirationHandler {
taskID = self.beginBackgroundTask(expirationHandler: expirationHandler)
} else {
taskID = self.beginBackgroundTask(expirationHandler: { })
}
closure()
self.endBackgroundTask(taskID)
}
}

fileprivate extension UIApplication {
/// EZSE: Get the top most view controller from the base view controller; default param is UIWindow's rootViewController
class func topViewController(_ base: UIViewController? = UIApplication.shared.keyWindow?.rootViewController) -> UIViewController? {
if let nav = base as? UINavigationController {
Expand Down

0 comments on commit bf3ccd4

Please sign in to comment.