MAKVONotificationCenter icon indicating copy to clipboard operation
MAKVONotificationCenter copied to clipboard

Add observation to MAKVONotification

Open naan opened this issue 10 years ago • 0 comments

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)
      }
      })

naan avatar Jul 08 '14 04:07 naan