Multithreading in iOS| Difference between GCD and NSOperation

Basics of concurrency in iOS.

override func viewDidLoad() {super.viewDidLoad()doSomeTimeConsumingTask() // takes 5 seconds to respond
override func viewDidLoad() {super.viewDidLoad() {
self.doSomeTimeConsumingTask() // takes 5 seconds to respond
DispatchQueue.main.async {

NSOperation and Grand Central Dispatch

Benefits of NSOperation

“ when you want more control over queue (all above mentioned) use NSOperation and for simple cases where you want less overhead (you just want to do some work "into the background" with very little additional work) use GCD.

If you enjoyed reading this post, please share and give some clapps so others can find it 👏👏👏👏👏 !!!!

iOS and tvOS developer, dreamer, photographer 🤨