WWDC 2025 - iOS 26 백그라운드 API 변경 사항 요약

카테고리

프로그래밍/소프트웨어 개발

서브카테고리

앱 개발

대상자

iOS 앱 개발자 (중급~고급)

핵심 요약

  • BGContinuedProcessingTask 도입 : 사용자 명시적 작업을 위한 백그라운드 처리 API로, BGTaskSchedulerBGContinuedProcessingTaskRequest 사용 필수
  • 시스템 리소스 최적화 : 배터리 절약, 네트워크 사용 제한, Low Power ModeBackground App Refresh 설정 존중
  • 작업 설계 원칙 : atomic operations, progress transparency, graceful degradation 적용

섹션별 세부 요약

1. iOS 26 백그라운드 처리 아키텍처

  • Foreground/Background 상태: 앱의 CPU, GPU, 네트워크 사용량에 따라 배터리 소모율 증가
  • Suspended State: 백그라운드에서 실행 중인 프로세스는 시스템이 자동으로 일시 중지
  • Energy Conservation: 모든 작업의 배터리 비용 최소화를 위한 Coalesced Work 전략 적용

2. `BGContinuedProcessingTask` 핵심 기능

  • App Refresh: 자주 사용되는 앱의 콘텐츠 업데이트를 위한 시스템 정책 기반 스케줄링
  • Push-based Updates: 서버에서 트리거되는 업데이트로, discretionary 처리 필수
  • Complex Processing: ML 모델, DB 유지보수 등 리소스 소모가 큰 작업에 적합

3. `BGContinuedProcessingTask` 구현 패턴

  • Info.plist 설정:

```swift

BGTaskSchedulerPermittedIdentifiers: ["com.yourapp.bundleid.userTask", "com.yourapp.bundleid.export.*"]

```

  • Dynamic Handler Registration:

```swift

BGTaskScheduler.shared.register(forTaskWithIdentifier: "bundleID.processing", using: nil) { task in

handleProcessingTask(task as! BGProcessingTask)

}

```

  • Task Submission Strategy:

```swift

let request = BGContinuedProcessingTaskRequest(identifier: "com.yourapp.userTask", title: "Exporting Photos")

request.strategy = .queue // 또는 .fail

try? BGTaskScheduler.shared.submit(request)

```

4. 백그라운드 GPU 접근 및 QoS 관리

  • Background GPU Capability: Xcode 프로젝트 설정에서 활성화 필요
  • QoS Management: 백그라운드 작업은 lower QoS 적용, 포그라운드로 전환 시 자동 우선순위 상승

5. 작업 설계 고려사항

  • Atomic Operations: 단일 작업 단위로 설계, 중단 시 복구 가능
  • Resource Awareness: BGTaskScheduler.shared.supportedResources 런타임 확인 필수
  • Progress Reporting: 사용자 페이스 작업에는 task.progress.completedUnitCount 정기 업데이트

결론

  • BGContinuedProcessingTask를 활용하여 사용자 명시적 작업을 효율적으로 처리하고, system throttlingexpiration signals에 대응해야 함.
  • Info.plist 설정과 BGTaskScheduler 사용을 통해 리소스 최적화 및 배터리 절약을 달성하며, progress transparency를 통해 사용자 경험 향상.