How to print into the console in SwiftUI?

Hi guys! Can you help me about this? Thanks

You'll need to turn on Debug Preview: right-click on the live preview play button and select "Debug Preview" from the popup.

1 Like

Thanks Amritpan, I have Xcode 12.1 and this feature don´t work. It seems is a Xcode bug.

How to print () to Xcode console in SwiftUI ?, Try right-clicking on the live preview play button and selecting 'Debug Preview from the popup. The print function prints messages in the Xcode console when debugging apps.

There are a Xcode bug when I try this... :neutral_face:

Debug preview doesn't show print in console. I run in the simulator or device.

This might be helpful:

1 Like


Thanks this works for me


Terms of Service

Privacy Policy

Cookie Policy