backgroundTask
1.0.0
이것은 객관적인 c http://hayageek.com/ios-long-running-background-task/ Infinite Task는 빈 오디오 파일 재생을 기반으로 한 무한 실행 배경 작업의 예제의 업데이트 된 신속한 버전입니다. 내 버전은 배경에서 작업을 영원히 실행하기 위해 Minumum으로 단순화됩니다. 또한 작업을 중지 할 때까지 영원히 재생 될 빈 WAV 파일도 포함했습니다. *참고 : 배터리 소비는 24 시간 동안 10%입니다.
#youtube 자습서 및 개요 https://www.youtube.com/watch?v=j7B35LFCMQM
수동으로 BackgroundTask.swift 를 프로젝트에 복사하십시오.
앱을 앱 스토어로 푸시하려는 경우 #Warning 내 구현을 사용하려고하지 않습니다. 애플은 그러한 행동을 100% 거부 할 것이다. 이 프로젝트는 연구 목적이나 개인 용도를 위해 설계되었습니다.
var backgroundTask = BackgroundTask ( )
//Start playing blank audio file.
//You can run NSTimer() or whatever you need and it will continue executing in the background.
backgroundTask . startBackgroundTask ( )
//Stop the task when you don't need it
backgroundTask . stopBackgroundTask ( )