Vamsi Anguluru

iOS Engineer

Swift Engineer

Games Developer

Vamsi Anguluru

iOS Engineer

Swift Engineer

Games Developer

Blog Post

NSOperations Vs GCD

September 12, 2016 Uncategorized

NSOperations

+ Fine control over handing network connections, you can cancel URL request operation or any other operation while it is operating.

GCD

+ Easy to implement, as easy as writing a small function.

+ Requires less time to understand the code base, might be even more easier with swift 3 GCD syntax.

+ Dependencies are the most famous reason for developers to choose NSOperations over GCD.

+ Easy to implement, as easy as writing a small function.

+ App can be architectured around the functional flow. WWDC 2015 got a fantastic talk on Advanced NSOperations explaining how WWDC 2015 app is completely developed using NSOperations.

+ less code.

+ Better place to start learning about asynchronous communications.

+ Your app behaviours will sit tight and neatly separated.

+ Definitely lot easier to implement.

– Lots of boiler plate code.

– Less control while making asynchronous calls, cannot cancel the connections once kicked off. 

Conclusion:

It all comes to what your app wants to do and how much control you need while making asynchronous connections, will your app benefit from having control to cancel and resume connections or do you prefer short and quick implementation. In the end both of them does same job in different ways.

1 Comment
  • A WordPress Commenter 1:48 pm January 4, 2019 Reply

    Hi, this is a comment.
    To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
    Commenter avatars come from Gravatar.

Write a comment