This content originally appeared on DEV Community and was authored by Herlandro Hermogenes
How to use LLDB (XCode) to change the view background color at runtime and update view UI on the simulator (for projects without SwiftUI)?
- 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
This content originally appeared on DEV Community and was authored by Herlandro Hermogenes
Herlandro Hermogenes | Sciencx (2024-08-09T21:13:15+00:00) U๐ฝ๐ฑ๐ฎ๐๐ฒ your view at runtime on the simulator using LLDB. Retrieved from https://www.scien.cx/2024/08/09/u%f0%9d%97%bd%f0%9d%97%b1%f0%9d%97%ae%f0%9d%98%81%f0%9d%97%b2-your-view-at-runtime-on-the-simulator-using-lldb/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.