Cancel task in Grand Central Dispatch GCD with DispatchWorkItem in Swift Hindi tutorial
DispatchWorkItem class in swift can be used when you want to cancel a task queued in grand central dispatch GCD. Mostly a question which is asked in interviews is if you can cancel a task in GCD and we say no and prefer to use Operation queues for that but you can actually allocate your task in DispatchWorkItem class and based on your logical or business condition cancel it whenever you see fit.
In this video, we will be seeing a real project scenario where you can use DispatchWorkItem to cancel and task and to optimize an existing module. We will learn how we can use the debounce technique and improve our code with DispatchWorkItem and DispatchQueue.
Given are the chapters covered in this video
0:00 introduction
0:14 prerequisite
0:48 complain about gcd
1:16 dispatchWorkItem class
1:23 codecat15 example
2:03 Pseudocode dispatchWorkItem
2:24 dispatchWorkItem example
4:45 dispatchWorkItem cancel example
8:51 real project scenario for using dispatchWorkItem
10:25 issue with the current implementation
11:02 debounce explanation
11:40 implementing debounce approach
12:48 need for work item reference explained
13:26 creating a work item reference
13:59 code explanation
14:36 debounce in action
16:00 conclusion
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
✅ Subscribe to the channel and stay ahead of everyone by following the right way for writing clean code in swift. 🔥🔥🔥🔥🔥
🔗Click on the link to subscribe: https://www.youtube.com/c/codecat?sub_confirmation=1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Introduction to threading video link: https://youtu.be/OKfv_0FvEf0
-----------------------------------------------------------------------------------------------------------------------
📥 Download the source code from
Note: The playground code shown in the video is also included
Github: https://github.com/codecat15/Youtube-tutorial/tree/master/DispatchWorkItemDemo
Google Drive: https://drive.google.com/file/d/1Z5goc3pFUUTUHR5p3bsJ4glWkWBaloKu/view?usp=sharing
-----------------------------------------------------------------------------------------------------------------------
############################################
Connect with me on social media
📷:: https://www.instagram.com/codecat15/
📧: codecat15@gmail.com
🐦: https://twitter.com/codecat15
Facebook: https://www.facebook.com/code.cat.792
Github: https://github.com/codecat15
###########################################
#dispatchWorkItem #gcd #threadingInSwift
Видео Cancel task in Grand Central Dispatch GCD with DispatchWorkItem in Swift Hindi tutorial канала Code Cat
In this video, we will be seeing a real project scenario where you can use DispatchWorkItem to cancel and task and to optimize an existing module. We will learn how we can use the debounce technique and improve our code with DispatchWorkItem and DispatchQueue.
Given are the chapters covered in this video
0:00 introduction
0:14 prerequisite
0:48 complain about gcd
1:16 dispatchWorkItem class
1:23 codecat15 example
2:03 Pseudocode dispatchWorkItem
2:24 dispatchWorkItem example
4:45 dispatchWorkItem cancel example
8:51 real project scenario for using dispatchWorkItem
10:25 issue with the current implementation
11:02 debounce explanation
11:40 implementing debounce approach
12:48 need for work item reference explained
13:26 creating a work item reference
13:59 code explanation
14:36 debounce in action
16:00 conclusion
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
✅ Subscribe to the channel and stay ahead of everyone by following the right way for writing clean code in swift. 🔥🔥🔥🔥🔥
🔗Click on the link to subscribe: https://www.youtube.com/c/codecat?sub_confirmation=1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Introduction to threading video link: https://youtu.be/OKfv_0FvEf0
-----------------------------------------------------------------------------------------------------------------------
📥 Download the source code from
Note: The playground code shown in the video is also included
Github: https://github.com/codecat15/Youtube-tutorial/tree/master/DispatchWorkItemDemo
Google Drive: https://drive.google.com/file/d/1Z5goc3pFUUTUHR5p3bsJ4glWkWBaloKu/view?usp=sharing
-----------------------------------------------------------------------------------------------------------------------
############################################
Connect with me on social media
📷:: https://www.instagram.com/codecat15/
📧: codecat15@gmail.com
🐦: https://twitter.com/codecat15
Facebook: https://www.facebook.com/code.cat.792
Github: https://github.com/codecat15
###########################################
#dispatchWorkItem #gcd #threadingInSwift
Видео Cancel task in Grand Central Dispatch GCD with DispatchWorkItem in Swift Hindi tutorial канала Code Cat
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Threads in iOS Swift Tutorial in Hindi | Concurrency and Threading concepts for beginnersWhat is Operation queue | Operation queue vs dispatch (GCD) in swift | Hindi tutorialNative vs hybrid vs cross platform mobile app development in HindiCustom Toggle Styling in SwiftUILazy loading & image caching with UITableView swift 5 Hindi tutorialMultithreading & Async in iOS | A Basic IntroductionThreads and Grand Central Dispatch in SwiftDispatch semaphore and race conditions in Swift Hindi tutorialWhen to Semaphore vs Dispatch Group! Careful Multithreaded Shared ResourceMultiple API calls with Dispatch Group in Swift iOS Hindi tutorialWhy do we need test case in swift | xctest | unit testing | code coverageWhat is Any and AnyObject in swift iOS Hindi TutorialRetain Cycles: How to Detect with Instruments Profiler!Method Dispatch in Swift | Static | Dynamic | MessageiOS Interview Questions and Answers 2021 - Part 1 | Objective-C and Swift | iGatiTechMap in swift Higher order function Hindi tutorialHow to create widgets for existing iOS app | iOS 14 Widgets tutorial in HindiGetting Started With Unit Testing | XCTest | SwiftHindi Swift Intro Memory Management Swift Fundamental Interview Preparatio HDBasics of MVVM architecture pattern in iOS swift for beginners in hindi