Post

Replies

Boosts

Views

Activity

Memory Footprint of SwiftUI custom Font in WidgetKit
I am building a widget for my app. Everything works as expected when using system fonts. When I try to use the custom font for my app in the Text instances in my widget, the system shots down my WidgetKit extension because it runs against the 30MB memory limit for Widgets. I have about 20 Text instances on my Widget. I initialize my font as a fileprivate global: let dinFont = Font.custom("AlteDIN1451Mittelschrift", size: 18) Then I use Text("blah blah").font(dinFont) when I setup my labels. When I only style a few text labels the widget renders fine. But when I try to use the font on all of them the widget extension is killed because of 30MB memory limit. This sounds like, .font(dinFont) is creating a copy of the font instance. Is this the expected behavior?
5
0
2.2k
Jul ’20
URLSession Requests from a Widget
My widget needs to get that from an API to generate its timeline. In the 3rd video of the Widget Code-Along the presenter says that the in-process foreground URLSessions should work as expected. My widget gets stuck at placeholder view and never shows the real data. Everything works fine and the widget renders as expected when I use some dummy data to generate the timeline. Anybody, any success with fetching data from the Internet in a widget?
2
0
2.9k
Jul ’20
Cocoapods on DTK
I'm having trouble installing the pods in the Podfile for my project. cocoapods installs without any issues on the system ruby but running pod install crashes out badly. Did anybody succeed in getting cocoapods to run on the DTK?
5
0
2.3k
Jun ’20