0

I got data in a form of array from server at viewDidLoad want to show it into collectionView according to its indexPath .

I have a collectionView but its cells are full length of collectionView frame so that cells work as a scrolling pages. at button click, next cell will show with its data array index values.

Lets assume data array are 3. First time its shows correct data array but after button click event in place of caliing cellForRowAt method single time , it call 2 times but at willDisplayCell method it run only one time. due to which the values of willDisplay and cellForRawAt are diffrent.

It occur when collectionView scroll

i except the flow of collectionView as

cellForItemAt Optional(“value of array index 1 ”) willDisplay Optional(“value of array index 1 ”) UIDisplay of 1 array index

cellForItemAt Optional(“value of array index 2 ”) willDisplay Optional(“value of array index 2 ”) UIDisplay of 3 array index

cellForItemAt Optional(“value of array index 3 ”) willDisplay Optional(“value of array index 3 ”) UIDisplay of 3 array index

but i get

cellForItemAt Optional(“value of array index 1 ”) willDisplay Optional(“value of array index 1 ”) UIDisplay of 1 array index

cellForItemAt Optional(“value of array index 2 ”) willDisplay Optional(“value of array index 2 ”)

cellForItemAt Optional(“value of array index 3 ”) UIDisplay of 3 array index

vandana
  • 11
  • 4

0 Answers0