Я столкнулся с проблемой в моем проекте, в основном я хочу использовать uicollectionview внутри uitableview, но он всегда показывает 0 массивов .count в numberOfItemsInSection collectionview вот код представления коллекции внутри ячейки tableview
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section:
Int) -> Int {
print(experience_array_skill.count)// always show 0
return experience_array_skill.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath:
IndexPath) -> UICollectionViewCell {
let cell = collects.dequeueReusableCell(withReuseIdentifier: "shorlist_exp_cell",
for: indexPath as IndexPath) as! shorlist_exp_cell
cell.btn1.text = self.experience_array_skill[indexPath.row].experience_in
cell.layer.cornerRadius = 15.0
cell.clipsToBounds = true
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath:
IndexPath) {
}
my JSON
{
"message": "candidate job listing",
"status": true,
"data": [
{
"id": 1,
"company_name_shown_job": "xyz company",
"job_title": "Android Developer",
"job_description": null,
"experience_tags": [
{
"id": 2,
"employer_job_post_id": 1,
"experience_in": "Android"
},
{
"id": 3,
"employer_job_post_id": 1,
"experience_in": "Php"
}
]
},
{
"id": 2,
"company_name_shown_job": "Abc company",
"job_title": "Web Developer",
"job_description": "<p>Lorem ipsum dolor sit amet,laborum.</p>",
"experience_tags": [
{
"id": 4,
"employer_job_post_id": 2,
"experience_in": "Swift"
},
{
"id": 5,
"employer_job_post_id": 2,
"experience_in": "Java"
}
]
}
]
}
в приведенных выше данных JSON - это массив моего uitableview, тогда как