Skip to content

The playground file as to why we need Async NSOperation and how to create one

Notifications You must be signed in to change notification settings

mr-fixit/NSOperation-Swift

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

This playground was created to be a companion playground to explain how to create an Asynchronous NSOperation. Below is the list of the different playground files and the Swift logic:

  • First playground page provides a simple GCD example.
  • Second playground page provides the basic scenario in which NSOperation is used.
  • Third playground page explains why provided NSOperation API does not work for executing asynchronous logic.
  • Fourth playground provides one of the ways to implement an asynchronous NSOperation API that can be subclassed to execute asynchronous logic.

The playground also has global Sources file. Here I have created a key-value observer in order to demo the KVO notifications that NSOperation fires. It is by the print statements in these notifications that I demo the different NSOperation behaviors

There is a lots of inline text explaining what the demo is about and a high level overview of the API in use.

About

The playground file as to why we need Async NSOperation and how to create one

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%