pmusolino / Wormholy

iOS network debugging, like a wizard 🧙‍♂️
MIT License
2.31k stars 184 forks source link

WormHoly does not build under Xcode 13.0 beta 3 (13A5192i) #104

Closed rmirabelli closed 2 years ago

rmirabelli commented 2 years ago

WormHoly does not compile properly under Xcode 13.0 beta 3; specifically, the call to UIApplication.shared in WHBaseViewController.swift is causing the issue.

<PACKAGE>/Wormholy/Sources/Subclasses/WHBaseViewController.swift:44:91: 'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.

This can be bypassed by placing an @available in front of this function definition:

    @available (iOSApplicationExtension, unavailable)
    static func currentViewController(_ viewController: UIViewController? = UIApplication.shared.keyWindow?.rootViewController) -> UIViewController? {
        guard let viewController = viewController else { return nil }
        ...
    }

There are other methods inside WormHoly.swift that would need similar bypassing.

I'm not certain if this would cause other issues; I'm happy to submit a PR if desired.

rmirabelli commented 2 years ago

This seems to be a problem with SPM, and I'll resolve it at that point. Thanks.