Please see the attached screenshot, we need the loading in this manner while uploading image or video in IOS Swift
Can you please suggest any one Thankyou
Please see the attached screenshot, we need the loading in this manner while uploading image or video in IOS Swift
Can you please suggest any one Thankyou
So do your upload using an URLSession
and create an URLSessionUploadTask
, set yourself as the delegate of the session, and implement the didSendBodyData
delegate method.
Full method signature:
connection(_:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:)
See this thread for more info:
NSURLSession, upload task - Get actual bytes transferred
In each call to that method, take totalBytesWritten, format it into a string, and through a call to the main thread, update your label text.
(Disclaimer: I haven't done this myself.)