WidgetKit: How to make print statements appear in the console?
Asked Answered
P

1

8

I am trying to find out why my Widget does not reload. I want to print entries array from inside func getTimeline to the console.
However the print statements do not appear in the console.

How to make print statements appear in the console?

Pinter answered 21/5, 2022 at 18:15 Comment(4)
Did you check with a Breakpoint that your statement gets hit?Depreciatory
Even when I add a print statement at the beginning of the func getTimeline, it does not appear in the console.Pinter
And it seems to ignore the breakpoints.Pinter
Please make sure you are not filtering anything in the console, in that case, you won't see anything that doesn't match.Missy
C
0

You will need to run the widget for that, instead of the main target.

In Xcode, on the top bar, click on the name of the project, then select your widget extension.

Choice of the target in Xcode

Your breakpoints will now work, and your print statements will now appear in the console.

Cockerel answered 19/12, 2023 at 10:22 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.