everybody
I am writing an app that makes use of DeviceReportActivity to point out the app utilization of customers. I adopted Apple’s System Report Exercise Documentation
and adopted the WWDC movies nevertheless it’s not sufficient to assist me repair it.
If I put a hard and fast top dimension, for instance .body(top: 1000), it really works. But when I depart the view to calculate its dimension primarily based on the content material, it doesn’t work.
That is my TotalReportActivityView:
var physique: some View {
VStack(spacing: 5) {
ForEach(configuration.totalUsageByCategory.filter { $0.totalAppUsage > 60 }) { appContent in
HStack {
Label(appContent.token)
.imageScale(.medium)
.labelStyle(.iconOnly)
.scaleEffect(1.5)
Textual content(appContent.identify)
.font(ZFont.default)
Spacer()
Textual content(self.formatter.string(from: appContent.totalAppUsage) ?? "No knowledge")
.font(ZFont.default)
.foregroundStyle(Shade(hex: "#7E7B93"))
}
.padding(.horizontal, 8)
.padding(.vertical, 4)
.contentShape(RoundedRectangle(cornerRadius: 8))
}
}
}
And that is the place I name this view in the principle App
DeviceActivityReportView()
.body(top: 800)
However I do not need a fastened dimension, I need the view on the app extension to know its dimension primarily based on the variety of configuration.totalUsageByCategory
and match. Do anybody had an identical subject?
Thanks!