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

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. Whe…


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)?
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


This content originally appeared on DEV Community and was authored by Herlandro Hermogenes


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » U๐—ฝ๐—ฑ๐—ฎ๐˜๐—ฒ your view at runtime on the simulator using LLDB." Herlandro Hermogenes | Sciencx - Friday August 9, 2024, 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/
HARVARD
Herlandro Hermogenes | Sciencx Friday August 9, 2024 » U๐—ฝ๐—ฑ๐—ฎ๐˜๐—ฒ your view at runtime on the simulator using LLDB., viewed ,<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/>
VANCOUVER
Herlandro Hermogenes | Sciencx - » U๐—ฝ๐—ฑ๐—ฎ๐˜๐—ฒ your view at runtime on the simulator using LLDB. [Internet]. [Accessed ]. Available 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/
CHICAGO
" » U๐—ฝ๐—ฑ๐—ฎ๐˜๐—ฒ your view at runtime on the simulator using LLDB." Herlandro Hermogenes | Sciencx - Accessed . 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/
IEEE
" » U๐—ฝ๐—ฑ๐—ฎ๐˜๐—ฒ your view at runtime on the simulator using LLDB." Herlandro Hermogenes | Sciencx [Online]. Available: 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/. [Accessed: ]
rf:citation
» U๐—ฝ๐—ฑ๐—ฎ๐˜๐—ฒ your view at runtime on the simulator using LLDB | Herlandro Hermogenes | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.