Post

Replies

Boosts

Views

Activity

Reply to Timeline refresh issue for widget on ios 18.2
This is not how widgets work. The timeline is a series of snapshots of data, i.e. what should appear at the first date, then the second date, then the third etc. Your widget doesn't really run any code. You do not need a .init() method in your Entry struct, and I suspect your issue with it immediately flashing to the next timeline entry is because your Entry struct sets the date to .now for every entry. That struct should look something like this: struct EventEntry: TimelineEntry { public let date: Date let configuration: DynamicIntentWidgetPersonIntent let person: Person let type: FriendType } Then in the timeline you create a series of entries that reflect what should happen at various times. And note that you're limited to about 72 updates per day, and widgets aren't really deigned to update every few seconds, so adding 3 or 6 seconds to a date isn't going to guarantee that your widget gets updated when you think it will. Once you have a timeline set up you can see it in the preview in Xcode with something like this: #Preview(as: .systemSmall) { WidgetExtension() } timeline: { let person = //some Person object let currentDate: Date = Date.now for minuteOffset in stride(from: 0, to: (24 * 60), by: 20) { // every 20 mins for one day = 72 entries let entryDate = Calendar.current.date(byAdding: .minute, value: minuteOffset, to: currentDate, wrappingComponents: false)! EventEntry(date: entryDate, configuration: configuration, person: person, type: .whatever)) } } Scroll through the timeline at the bottom of the preview window to see how your widget changes over time. I have no idea how you're using the .init method and this whole FriendType thing, but I don't think it's working how you think it's working.
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’24
Reply to App Start Crashed
Is this an app you're developing? If so, you should probably just debug it rather than reporting here every crash you experience, as we really can't help you with every little thing that happens while you develop an app. However, given this looks like a banking app, I'd say you're trying to report that your banking app has crashed. You're in the wrong place. You need to report this crash to your bank, not us. If you already share crash reports with app developers then they will have received this crash report already. (You can enable/disable this in Settings > Privacy & Security > Analytics & Improvements > Share With App Developers.)
Dec ’24
Reply to Inscription
You should probably tell us why you can't use your iCloud account. Do you receive an error when you try to enrol? Vous devriez probablement nous dire pourquoi vous ne pouvez pas utiliser votre compte iCloud. Recevez-vous une erreur lorsque vous essayez de vous inscrire ?
Dec ’24
Reply to Converting iPad app to an iPhone app
I would write the iPhone app in Swift and SwiftUI, and fall back to UIKit if there's something you cannot do in SwiftUI. You may then find it's very easy to extend the SwiftUI stuff to the iPad, and you'd end up with a more modern app altogether. I would avoid using storyboards, they're old and difficult to use and maintain. But, it's up to you.
Topic: Design SubTopic: General Tags:
Dec ’24
Reply to Is there a way to detect when Apple Watch Ultra is in Night mode?
Isn't it just WidgetRenderingMode.vibrant? https://developer.apple.com/documentation/widgetkit/widgetrenderingmode/vibrant It makes it monochrome then makes it red, so all you need to do is check that the mode is .vibrant and deal with it that way. If you're already doing that, and it doesn't look good, let us see how it looks and we might be able to recommend something else.
Topic: Design SubTopic: General Tags:
Dec ’24
Reply to Timeline refresh issue for widget on ios 18.2
This is not how widgets work. The timeline is a series of snapshots of data, i.e. what should appear at the first date, then the second date, then the third etc. Your widget doesn't really run any code. You do not need a .init() method in your Entry struct, and I suspect your issue with it immediately flashing to the next timeline entry is because your Entry struct sets the date to .now for every entry. That struct should look something like this: struct EventEntry: TimelineEntry { public let date: Date let configuration: DynamicIntentWidgetPersonIntent let person: Person let type: FriendType } Then in the timeline you create a series of entries that reflect what should happen at various times. And note that you're limited to about 72 updates per day, and widgets aren't really deigned to update every few seconds, so adding 3 or 6 seconds to a date isn't going to guarantee that your widget gets updated when you think it will. Once you have a timeline set up you can see it in the preview in Xcode with something like this: #Preview(as: .systemSmall) { WidgetExtension() } timeline: { let person = //some Person object let currentDate: Date = Date.now for minuteOffset in stride(from: 0, to: (24 * 60), by: 20) { // every 20 mins for one day = 72 entries let entryDate = Calendar.current.date(byAdding: .minute, value: minuteOffset, to: currentDate, wrappingComponents: false)! EventEntry(date: entryDate, configuration: configuration, person: person, type: .whatever)) } } Scroll through the timeline at the bottom of the preview window to see how your widget changes over time. I have no idea how you're using the .init method and this whole FriendType thing, but I don't think it's working how you think it's working.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to App Start Crashed
Is this an app you're developing? If so, you should probably just debug it rather than reporting here every crash you experience, as we really can't help you with every little thing that happens while you develop an app. However, given this looks like a banking app, I'd say you're trying to report that your banking app has crashed. You're in the wrong place. You need to report this crash to your bank, not us. If you already share crash reports with app developers then they will have received this crash report already. (You can enable/disable this in Settings > Privacy & Security > Analytics & Improvements > Share With App Developers.)
Replies
Boosts
Views
Activity
Dec ’24
Reply to Inscription
You should probably tell us why you can't use your iCloud account. Do you receive an error when you try to enrol? Vous devriez probablement nous dire pourquoi vous ne pouvez pas utiliser votre compte iCloud. Recevez-vous une erreur lorsque vous essayez de vous inscrire ?
Replies
Boosts
Views
Activity
Dec ’24
Reply to Converting iPad app to an iPhone app
I would write the iPhone app in Swift and SwiftUI, and fall back to UIKit if there's something you cannot do in SwiftUI. You may then find it's very easy to extend the SwiftUI stuff to the iPad, and you'd end up with a more modern app altogether. I would avoid using storyboards, they're old and difficult to use and maintain. But, it's up to you.
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to Is there a way to detect when Apple Watch Ultra is in Night mode?
Isn't it just WidgetRenderingMode.vibrant? https://developer.apple.com/documentation/widgetkit/widgetrenderingmode/vibrant It makes it monochrome then makes it red, so all you need to do is check that the mode is .vibrant and deal with it that way. If you're already doing that, and it doesn't look good, let us see how it looks and we might be able to recommend something else.
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’24