Created
October 10, 2019 16:45
-
-
Save robertmryan/20facda08e063dc3461e073f7c87206d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func removeAllAnnotations() { | |
guard let document = document else { return } | |
for i in 0..<document.pageCount { | |
if let page = document.page(at: i) { | |
while page.annotations.count > 0 { | |
page.removeAnnotation(page.annotations.last!) | |
} | |
} | |
} | |
} | |
func removeAllAnnotations2() { | |
guard let document = document else { return } | |
for i in 0..<document.pageCount { | |
if let page = document.page(at: i) { | |
for j in (0..<page.annotations.count).reversed() { | |
page.removeAnnotation(page.annotations[j]) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment