pmusolino / Wormholy

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

Xcode beta 3 runtime issue #51

Closed graham-perks-snap closed 5 years ago

graham-perks-snap commented 5 years ago

Launching an app containing Wormholy results in an immediate abort with this message:

| Swift class extensions and categories on Swift classes are not allowed to have +load methods

pmusolino commented 5 years ago

Hi there. Are you using Swift 5?

I have not yet tested Wormholy with Swift 5, it will be converted as soon as it is officially released.

graham-perks-snap commented 5 years ago

The error occurs in both a new template project created with Xcode beta, and in an existing project simply built with the beta. So Swift 4 and 5. The OS' loader generates the error and the app fails to even load, let alone run. The Swift version is immaterial.

I've not been able to trace down the load giving grief.

I generated a Single View app from the template, close Xcode, pod init, added Wormholy to the Podfile. pod install, load the xcworkspace, run.

maeisdev commented 5 years ago

Any news on this?

Coeur commented 5 years ago

I was able to reproduce @graham-perks-snap steps with Xcode 10.2. Code builds fine, but running the app will cause an immediate issue.

Same issue whether using use_frameworks! or not.

Obviously related to both load functions of the framework:

Adding a +load in either Wormholy (private) or NSURLSessionConfiguration (Wormholy) is forbidden. If you want a +load, you're only allowed to have it in Wormholy.swift.

kealdishx commented 5 years ago

@graham-perks-snap hey, I just submit a PR https://github.com/pmusolino/Wormholy/pull/52 that can fix this issue. You can have a try.