johnno1962 / HotReloading

Hot reloading as a Swift Package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Updates overlap in UI

mattgabor opened this issue · comments

I have created a sample project to test this package out - the only custom code is pictured below. Whenever I make a change to the text both the previous and new text overlap each other - the old view is not being cleaned up properly

I am using the following to force a reload:

extension UIViewController {
    @objc func injected() {
        viewDidLoad()
    }
}

image

Version 4.9.6
MacOS Ventura 13.1 (22C65)
Xcode 14.2.0

Hi, You probably need to restructure your code into a separate confirgureView() method which is called from the injected() method that removes all subViews before adding the label again otherwise they will accumulate.