Localize iOS 14 Dynamic Widget Configuration

How to style table view for Widget configuration dynamic values?

In your IntentHandler, you return a collection of INObjects (actually you’ll use your project’s generated subclass of INObject, but look at INObject for the API). When you create those objects, you can pass in an image and/or subtitle, which is what you’re seeing in that screenshot.

iOS 14 Widget auto-refresh every day

Actually, it seems to be I overlooked it, the widget actually refreshes, it was me, who didn't refresh the data itself. (I'm using UserDefaults to share data between my app and the widget, and even though the widget refreshed properly, as the data in UserDefaults was not updated, the same was shown over and over again.)

iOS 14 Medium Widget Size Background Image Refuses to Fill

Here is fixed variant - as image in the background you have to expand VStack to full screen.

Note: edgesIgnoringSafeArea allows to go beyond safe area when content is wider, but not make content wide.

var body: some View {
VStack(alignment: .leading){
Spacer()
Text("Aardvark Exactlywhat")
.font(.largeTitle)
.bold()
.padding(.bottom, 20)
.padding(.leading, 20)
.padding(.trailing, 20)
.minimumScaleFactor(0.5)
.foregroundColor(.white)
.shadow(
color: Color.black,
radius: 1.0,
x: CGFloat(4),
y: CGFloat(4))
}
.frame(maxWidth: .infinity, maxHeight: .infinity) // << this one !!
.edgesIgnoringSafeArea(.all)
.background(
Image("plant")
.resizable()
.scaledToFill()
)
}


Related Topics



Leave a reply



Submit