Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
301 views
in Technique[技术] by (71.8m points)

swift - iOS 14 Widgets with greater configuration capabilities

I want to add more advanced configuration options to my iOS 14 Widgets. This is what I've been working with:

struct WidgetConfig {
    let id: UUID
    let name: String
    let backgroundColor: Color?
    let backgroundImage: Data?
    let fontColor: Color
    let fontStyle: Font.Design
    let accentColor: Color
}

The user can create Configurations in the App.

I experimented with storing the Configurations in CoreData, but fetching them in the IntentHandler is very slow and unreliable. Widgets often just render black.

What would be a better strategy to implement this?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...