Skip to content

How to make the present VC display normally. #566

@RisingSSR

Description

@RisingSSR

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

Image

so how can i works

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions