How to print() to Xcode console in SwiftUI?

后端 未结 9 1926
刺人心
刺人心 2020-12-14 00:24

So I tried to put a print statement while debugging in a SwiftUI View.

print(\"landmark: \\(landmark)\")

In the following body.

<         


        
9条回答
  •  渐次进展
    2020-12-14 01:09

    Very easy way to debug your Preview:

    1. Open your Swift project in Xcode 11.
    2. Right-click (or Control-click) on the Live Preview button in the bottom right corner of the preview.
    3. Select Debug Preview.

    How to debug your SwiftUI previews in Xcode

提交回复
热议问题