Reputation: 386
I'm trying to do a simple console log (the simplest that can possibly be) and I'm not even able to do that. I'm starting to lose my mind over the simplest thing. Here is my code :
struct ContentView: View {
var body: some View {
Text("Hello, world!")
.onAppear {
// ApiClient().getParams()
print("log")
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
I'm running a debug preview and nothing is showing in console. I'm already sorry for this question. Is there anything I'm doing wrong or not doing ?
Thank you in advance.
Upvotes: 5
Views: 4314
Reputation: 386
The answer was that you can't print in live preview mode (even in debugging mode). You have to build and run the simulator to show the console logs.
Sorry for the more-than-novice question.
Upvotes: 1