How to add/insert element in array one after another like stack swift 5

前端 未结 2 904
情书的邮戳
情书的邮戳 2021-01-24 06:02

I get String from api response and stored in an array.

     for customParams in custom_attributes! {
         if(customParams[\"attribute_code\"] as! String == \         


        
2条回答
  •  一整个雨季
    2021-01-24 06:28

    var myArray :[String] = []
    
    for customParams in custom_attributes! {    
        if(customParams["attribute_code"] as! String == "small_image") {
             var myString = customParams["value"] as! String
             myArray.append(myString)
        }
    }
    

提交回复
热议问题