No Console output in Xcode 11 and iOS 13? Here's the solution

For XCode 11 users, not getting any output in their console and believe this is an XCode bug, I got you! Assuming that you have the console active (view > debug area > activate console), you’ll have to right-click the live preview and select debug preview, as follows:

right-click to select debug preview

After that, you’ll start getting output in your console!

the output in the console

The output above is the following source code, that you can create as a view let’s say TestView.swift and copy/paste:

import SwiftUI

struct TestView: View {
    var body: some View {
        Button(action: { print("Hello world!") }) {
            Text("Click me!")
        }
    }
}

struct TestView_Previews: PreviewProvider {
    static var previews: some View {
        TestView()
    }
}

It is that simple, hope this helped ;)

comments powered by Disqus