Last active
June 20, 2022 03:29
-
-
Save jenox/15d3bac5f66009c0349dda8df2f22681 to your computer and use it in GitHub Desktop.
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
import Swift | |
extension UIApplication { | |
@discardableResult | |
public static func launch(with delegateClass: UIApplicationDelegate.Type) -> Int32 { | |
let type = UnsafeMutablePointer<Int8>.self | |
let count = Int(CommandLine.argc) | |
let principalClassName = NSStringFromClass(self) | |
let delegateClassName = NSStringFromClass(delegateClass) | |
return CommandLine.unsafeArgv.withMemoryRebound(to: type, capacity: count, { | |
UIApplicationMain(Int32(count), $0, principalClassName, delegateClassName) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment