Wednesday, July 15, 2026
HomeiOS Developmentios - I need to discard the initially empty values ​in 'shopData'...

ios – I need to discard the initially empty values ​in ‘shopData’ and use solely non-empty values. What logic ought to I write?

[ad_1]

func getShopData(idx: Int, categoryIdx: String) -> DestiSearchResponseData {
    var filterShopData = DestiSearchResponseData(space: "", imgUrl: "", handle: "", title: "", idx: 0, class: "", content material: "")
    
        if destiSearchResponse[idx].class == categoryIdx{
           
            filterShopData = destiSearchResponse[idx]
            print("destiSearchResponse[idx]", destiSearchResponse[idx])
    }
    
   
     return filterShopData
}

// name technique

let shopData = destiSearchViewModel.getShopData(idx: indexPath.row, categoryIdx: “1”)

I need to discard the initially empty values ​​in ‘shopData’ and use solely non-empty values.
What logic ought to I write?

An error happens as a result of the empty worth that was repeatedly initialized is handed.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments