title: How to print() to Xcode console in SwiftUI?
body: <p>So I tried to put a print statement while debugging in a SwiftUI View.</p>
  
  <pre><code>print("landmark: \(landmark)")
  </code></pre>
  
  <p>In the following body.</p>
  
  <pre><code>var body: some View {
      NavigationView {
          List {
              Toggle(isOn: $userData.showFavoritesOnly) {
                  Text("Favorite only")
              }
              ForEach(landmarkData) { landmark in
                  print("landmark: \(landmark)")
                  if !self.userData.showFavoritesOnly || landmark.isFavorite {
                      NavigationButton(destination: LandmarkDetail(landmark: landmark)) {
                          LandmarkRow(landmark: landmark)
                      }
                  }
              }
          }
         .navigationBarTitle(Text("Landmarks"))            
      }
  }
  </code></pre>
  
  <p>Compiler errors out:
  <a href="https://i.stack.imgur.com/iZNEy.png" rel="noreferrer"><img src="https://i.stack.imgur.com/iZNEy.png" alt="Xcode compiler error"></a></p>
  
  <p>So, what is the proper way to print to console in SwiftUI?</p>
  
  <p>EDIT:
  I made Landmark conform to <em>CustomStringConvertible</em>:</p>
  
  <pre><code>struct Landmark: Hashable, Codable, Identifiable, CustomStringConvertible {
  
  var description: String { name+"\(id)" }
  
  var id: Int
  var name: String
  .....
  </code></pre>
  
  <p>I still get the "String is not convertible to any" error. Should it work now?</p>