Skip to content

Conversation

@naan
Copy link

@naan naan commented Jul 8, 2014

I added observation to MAKVONotification so that I can remove observation from a block like this:

    course.addObserver(nil, keyPath:["progress", "contentDownloaded"], options:nil, block: {(note:MAKVONotification!) in
      switch note.keyPath! {
      case "progress":
        println("progress \(course.progress)")
      case "contentDownloaded":
        note.observation.remove()
      default:
        println(note.keyPath)
      }
      })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant