U๐—ฝ๐—ฑ๐—ฎ๐˜๐—ฒ your view at runtime on the simulator using LLDB

Herlandro Hermogenes - Aug 9 - - Dev Community

How to use LLDB (XCode) to change the view background color at runtime and update view UI on the simulator (for projects without SwiftUI)?
Image description

  • Set a breakpoint in the same line that you want do change/update in runtime.
  • Run the app on the simulator. When the execution is paused, type this expression on the main thread in the XCode console:

e DispatchQueue.main.async { self.view.backgroundColor = UIColor.blue }

  • Hit Enter and release the execution. You will see the background changing from green to blue on the simulator.

This is a good UI solution for UIKit projects without SwiftUI Preview

.
Terabox Video Player