InjectionIII
InjectionIII copied to clipboard
How to make the present VC display normally.
Device: real device - iPhone 15 Xcode: 16.2 Code:
@_exported import InjectHotReload
class MMWindow: UIWindow {
override var rootViewController: UIViewController? {
get { super.rootViewController }
set {
if let newValue {
// super.rootViewController = newValue
super.rootViewController = InjectHotReload.ViewControllerHost(newValue)
} else {
super.rootViewController = nil
}
}
}
override func makeKeyAndVisible() {
super.makeKeyAndVisible()
do {
// simulatorBundle
// let simulatorBundle = Bundle.init(path: "/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle")
// if let bundle = simulatorBundle {
// try bundle.loadAndReturnError()
// debugPrint("Injection simulator Bundle成功")
// } else {
// debugPrint("Injection simulator 注入失败,未能检测到Injection")
// }
// realDeviceBundlePath
if let realDeviceBundlePath = Bundle.main.path(forResource: "iOSInjection", ofType: "bundle"), let realDeviceBundle = Bundle(path: realDeviceBundlePath) {
try realDeviceBundle.loadAndReturnError()
debugPrint("Injection RealDevice Bundle成功")
} else {
debugPrint("Injection RealDevice 注失败,未能检测到Injection")
}
} catch {
debugPrint("Injection注入失败\(error)")
}
}
}
then, when i present another vc, it cannot works
I think it's the UITransitionView that's causing the problem
so how can i works
@krzysztofzablocki, is this more of an Inject question?
This is never going to work properly, hosts are set-up with auto closure per documentation, if you set it up via value you simply re-assign existing instance and not re-initialize it