Home > OS >  How to print out console in Swift Package Manager project xcode
How to print out console in Swift Package Manager project xcode

Time:11-15

I'm creating a SPM project and I need to check if the data I get from an API is correct. How can I print out this data?

I tried to create a view inside the SPM and adding it to an App project and it works, but it doesn't exist an easier alternative?

Console doesn't show anything, no print no logs...

image with code

CodePudding user response:

If you are looking to get output from within a view, try using something along the lines of

let _ = print("your data here")

CodePudding user response:

I solved the problem. I still have to add the package to an app project to use the console and debugger.

But my problem was not calling the function inside @main struct app. Now it displays prints and it's all OK.

Thank you all

  • Related