skip to Main Content

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

2

Answers


  1. Chosen as BEST ANSWER

    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


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

    let _ = print("your data here")

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search