Here is the code where the crash occurs
var body: some WidgetConfiguration {
IntentConfiguration(kind: WidgetKind, intent: ConfigurationIntent.self, provider: provider) { entry in
// Parse config
if let config = entry.configuration {
if let fg = config.foreground,
let fgColorId = fg.identifier, <----
let fgColors = AppSettings.sharedInstance()?.object(forKey: kWidgetForeground) as? [String:String],
let fgColor = fgColors[fgColorId] {
theme.textColor = Color.init(UIColor.fromHex(fgColor))
theme.iconColor = Color.init(UIColor.fromHex(fgColor))
} else {
theme.textColor = .white//Color.primary
theme.iconColor = .white//Color.primary
}
configuration
is INIntent
with foreground var which is INObject
but some times it seems its not... and instead its NSTaggedPointerString
unless I'm missing something here.