Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Sometimes we need to manage multiple timers in UICollectionView so if we recreate multiple timers then it will show wrong value so for this, we need to create a single Timer class for every single Cell, and also manage every refresh cell in UICollectionView.
for manage recreating or refreshing cell we need to follow some steps:
1: Create a dictionary of timers:
var timerLatestProduct = [Int:Timer]()
var timerCount:NSMutableArray = [100,100,100,100,100,100,100,100,100]
2: Now its time to add the timer in cell’s label.
here I have taken an array of value which contains a value.
Here we are checking whether the timer is created or not and if we scroll the cell then “cellForItemAt” is called then we are re-creating the timer object by invalidating the previous one .
Note:
Here userinfo: we are sending the cell label or you can send cell also
Now its time to define the timer class:
Now we are handling the array of timer separately for every timer object.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Webkul is a truly trusted and supported IT Company to develop business ideas for e-commerce. They provide professional support after deploying the solution to production and be responsible to act for fixing the reported issues or system errors. We highly encourage to deal with Webkul for business development.
Hussein Zawia
Co-founder, 24Dokan
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.