Community-maintained Agent Skills for complete Swift and Apple-platform app delivery.
72
90%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Medium
Suggest reviewing before use
Register, schedule, and execute background tasks on iOS using BackgroundTasks (BGTaskScheduler), background URLSession, and background push notifications. Targets Swift 6.3 / iOS 26+.
Every task identifier must be declared in Info.plist under BGTaskSchedulerPermittedIdentifiers, or submit(_:) throws BGTaskScheduler.Error.Code.notPermitted.
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>com.example.app.refresh</string>
<string>com.example.app.db-cleanup</string>
<string>com.example.app.export.*</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>fetch</string> <!-- Required for BGAppRefreshTask -->
<string>processing</string> <!-- Required for BGProcessingTask -->
<string>remote-notification</string> <!-- Required for silent push -->
</array>In Xcode: Target > Signing & Capabilities > Background Modes > enable Background fetch, Background processing, or Remote notifications.
| Task Type | Max Duration | Trigger | Requires Power/Network | Use Case |
|---|---|---|---|---|
BGAppRefreshTask | ~30 seconds | System opportunistic | Configurable hint | Light feed/state updates |
BGProcessingTask | Several minutes | Device idle | External power / network optional | Database cleanup, maintenance, ML indexing |
BGContinuedProcessingTask | User bounded | Foreground user action | Live Activity progress | Exporting large media, offline bundle generation |
URLSession.background | Managed out-of-process | Network completion | Cellular/WiFi policy | Large file downloads and uploads |
| Silent Remote Push | ~30 seconds | APNs trigger (content-available: 1) | Network required | Server-driven data invalidation hint |
application(_:didFinishLaunchingWithOptions:) (UIKit) or App.init() (SwiftUI). Submitting an unregistered identifier throws runtime exceptions.expirationHandler: The system can revoke background execution time at any moment. The expiration handler must cancel active tasks and call setTaskCompleted(success: false).setTaskCompleted(success:) exactly once: Failing to call completion causes the system to penalize future execution allocations.earliestBeginDate as a lower bound: iOS determines actual launch time based on battery status, power state, and user interaction patterns._simulateLaunchForTaskWithIdentifier:), read Debugging Background Tasks.handleEventsForBackgroundURLSession, read Background URLSession Extended Patterns.ProgressReporting, read BGContinuedProcessingTask Patterns.BGTaskSchedulerPermittedIdentifiers (throws .notPermitted).task.setTaskCompleted(success:) on all execution and failure paths.task.expirationHandler, leading to watchdog termination when background time expires.URLSession (requires delegate).BGTaskSchedulerPermittedIdentifiersUIBackgroundModes enabled (fetch, processing, remote-notification)expirationHandler cancels active tasks and reports failuresetTaskCompleted(success:) called exactly once on all code pathsURLSession uses delegate and preserves background completion handlerurlSession(_:downloadTask:didFinishDownloadingTo:) before returncontent-available: 1, apns-push-type: background, and priority 5.tessl-plugin
skills
accessorysetupkit
references
activitykit
adattributionkit
references
alarmkit
references
app-clips
app-intents
app-store-optimization
app-store-review
apple-on-device-ai
appmigrationkit
audioaccessorykit
references
authentication
references
avfoundation-audio
references
avkit
background-processing
references
browserenginekit
callkit
references
carplay
cloudkit
contacts-framework
references
core-bluetooth
references
core-data
core-haptics
references
core-motion
references
core-nfc
references
coreml
references
cryptokit
cryptotokenkit
debugging-instruments
device-integrity
references
energykit
references
eventkit
family-controls
references
financekit
focus-engine
gamekit
git-branching-workflow
references
healthkit
references
homekit
references
ios-accessibility
ios-app-workflow
references
ios-ettrace-performance
ios-localization
ios-memgraph-analysis
ios-networking
ios-simulator
references
metrickit
references
musickit
references
natural-language
paperkit
references
passkit
references
pdfkit
pencilkit
references
permissionkit
references
photokit
push-notifications
quicklook
references
realitykit
references
relevancekit
references
scenekit
sensorkit
shazamkit
references
speech-recognition
references
spritekit
storekit
swift-api-design-guidelines
swift-architecture
references
swift-charts
swift-codable
references
swift-code-review
swift-concurrency
swift-formatstyle
references
swift-language
swift-security
references
swift-testing
swiftdata
swiftlint
swiftui-animation
swiftui-gestures
references
swiftui-layout-components
swiftui-liquid-glass
references
swiftui-patterns
swiftui-performance
swiftui-responsive-layout
swiftui-uikit-interop
swiftui-webkit
tabletopkit
tipkit
vision-framework
weatherkit
references