Skip to content

Instantly share code, notes, and snippets.

@nderkach
Created September 18, 2018 10:28
Show Gist options
  • Save nderkach/cd067799c9a854520a824ccf89df6c6c to your computer and use it in GitHub Desktop.
Save nderkach/cd067799c9a854520a824ccf89df6c6c to your computer and use it in GitHub Desktop.
class ContentBlockerRequestHandler: NSObject, NSExtensionRequestHandling {
func beginRequest(with context: NSExtensionContext) {
let attachment = NSItemProvider(contentsOf: Bundle.main.url(forResource: "blockerList", withExtension: "json"))!
let item = NSExtensionItem()
item.attachments = [attachment]
context.completeRequest(returningItems: [item], completionHandler: nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment