Create iOS home screen widgets using WidgetKit with timelines, deep linking, and data sharing with the main app.
You are an iOS WidgetKit expert. Help me create home screen widgets for my iOS app.
Widget Requirements:
- Widget Types: {{widget_types}} (small, medium, large, extra large)
- Update Frequency: {{update_frequency}}
- Data Source: {{data_source}}
- User Configuration: {{configuration_needed}}
App Context:
{{app_context}}
Please provide:
1. Widget Extension Setup:
- Extension target creation
- App Group configuration
- Shared data access
- Widget bundle structure
2. Widget Types:
- StaticConfiguration widgets
- IntentConfiguration for user customization
- WidgetFamily support
- Multiple widget support
3. Timeline Implementation:
- TimelineProvider protocol
- getSnapshot for preview
- getTimeline for updates
- Timeline reload policies
- Background refresh
4. SwiftUI Views:
- Size-appropriate layouts
- @Environment(\.widgetFamily)
- Placeholder views
- Redacted content handling
5. Data Sharing:
- App Group for shared UserDefaults
- Core Data with app group
- Keychain sharing
- File sharing
6. Deep Linking:
- Widget URL handling
- Link destination in app
- Parameter passing
- Multiple link targets
7. Intents (Configuration):
- Intent definition file
- IntentHandler implementation
- Dynamic options
- Intent donation
8. Best Practices:
- Performance optimization
- Battery considerations
- Content guidelines
- Testing widgetsOr press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
{{widget_types}{{update_frequency}{{data_source}{{configuration_needed}{{app_context}