Thursday, June 4, 2026
HomeiOS Developmentios - Swift Alamofire multi picture add downside

ios – Swift Alamofire multi picture add downside

[ad_1]

I am importing photographs utilizing Alamofire.
However when I attempt to add a number of photographs it does not load the most recent picture.
I see it as profitable within the logs.

 func imageupload(veri: UIImage){
       
        imgname =  String(Date().millisecondsSince1970)+"_"+self.username+".jpg"
        let picture = resizeimage(picture: veri  , withSize: CGSize(width:1920, top: 1080))
        
        let imgData = picture.jpegData(compressionQuality: 1.5)!
        
             
        Alamofire.add(multipartFormData: { multipartFormData in
             multipartFormData.append(imgData, withName: "file",fileName: self.imgname , mimeType: "picture/jpg")
           
        },
    
        to: URLString )
        { (outcome) in
            change outcome {
            case .success(let add, _, _):
                
                add.uploadProgress(closure: { (progressa) in
                    print("Add Progress: (progressa.fractionCompleted)")
                 
                
                    self.progressbar.progress += Float(progressa.fractionCompleted)
                   
                })
          
                    add.responseJSON { response in
                        
                        print(veri)
                        print("picture uploadd",response)
                  }
                
            case .failure(let encodingError):
                
                ToastView.shared.quick(self.view, txt_msg: "Errorr")
                print("error" ,encodingError)
                
            }
        }
    }

Please Assist me

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments