2016-07-05 3 views
2

사용할 수 없습니다 다운로드 API를 관리, 다시 시작하고 여기에 설명되어 API 취소중포 기지 내가 일시 중지를 사용하여 중포 기지 스토리지에서 다운로드를 관리하기 위해 노력하고

https://firebase.google.com/docs/storage/ios/download-files#manage_downloads

내 다운로드 완벽하게 작업을하지만 난 액세스 할 수 없습니다 이 기능들 중 어느 것에 대해서도, 누구도 이것들에 접근하는 방법을 알고 있습니까?

enter image description here

var storageRef: FIRStorageReference? = nil 
var pathReference: FIRStorageReference? = nil 

func downloadImage(imageLocation: String) { 

    let saveLocation = NSURL(fileURLWithPath: String(HelperFunctions.getDocumentsDirectory()) + "/" + imageLocation) 

    storageRef = FIRStorage.storage().reference() 

    pathReference = storageRef!.child(imageLocation) 

    pathReference!.writeToFile(saveLocation) { (URL, error) -> Void in 

} 
+0

완벽한 'pathReference' 초기화를 붙여 넣을 수 있습니까? –

+0

감사합니다. 업데이트 된 질문 –

답변

3

일시 정지 또는 방법이 경우에, 그래서 writeToFile method에 의해 반환되는 FIRStorageDownloadTask 클래스위한 것입니다 재개, 취소 :

let task = pathReference!.writeToFile(saveLocatio.... task.pause() task.cancel() task.resume()

작동합니다

행운을 빈다.

+0

고마워요! 내가 생각했던 문서의 이전 부분을 읽었어야했다. –