Reputation: 19592
I am building an iOS app using Firebase as the backend. Firebase has "observeStatus(.Progress)" code that is used for image storage.
I have 2 questions:
I will let users upload pictures which will be held in Firebase Storage, once a user decides to submit a picture, do they need to see a progress status bar indicator/progress status alert screen showing the image upload status?
If not, what is the purpose of the observe Status code below if there's no need to display a progress indicator to the user?
Code:
let storageRef = FIRStorage.reference().child("folderName/file.jpg");
let localFile: NSURL = // get a file;
// Upload the file to the path "folderName/file.jpg"
let uploadTask = storageRef.putFile(localFile, metadata: nil)
let observer = uploadTask.observeStatus(.Progress) { snapshot in
print(snapshot.progress) // NSProgress object
}
Upvotes: 2
Views: 1929
Reputation: 599041
Whether your users should be shown a progress bar is really up to you and the needs of your app.
If the user can continue using the app while the file is uploading, then probably the most you'll need is a completion listener to show them when it's done.
But if you're blocking the user from using the app while the file is uploading, it is very important to show them the progress. That way they'll have some idea of how much longer the operation will take.
Upvotes: 2