Skip to content

Instantly share code, notes, and snippets.

View msuleman0100's full-sized avatar

Muhammad Suleman msuleman0100

View GitHub Profile
@derickito
derickito / PDFViewController.swift
Last active October 29, 2024 04:32
iOS PDFKit: How to add a highlight annotation
override func viewDidLoad() {
createMenu()
}
private func createMenu() {
let highlightItem = UIMenuItem(title: "Highlight", action: #selector(highlight(_:)))
UIMenuController.shared.menuItems = [highlightItem]
}
@objc private func highlight(_ sender: UIMenuController?) {