PDFReader
✏️ IOS 11 | PDFKit | IFiles | ICloud
Install / Use
/learn @ivankholod/PDFReaderREADME
PDFReader - Smart PDF Reader and Editor

Description
- Now it work only for all IPads, because i used UIPopovers. (You can change it, if you want)
- User can open PDFDocuments from native iOS application "Files"
- PDFDocument automatically saved and synchronizes in ICloud.
- User can highlighted annotation for selected area which finger determined.
- If you want delete annotations - turn on "Pencil Mode" and tap to area!
How it works?
-
I used native PDFKit:
- https://developer.apple.com/documentation/pdfkit
-
For work with documents: UIDocumentPickerViewController:
- https://developer.apple.com/documentation/uikit/uidocumentpickerviewcontroller
-
Highlighted text: UITouch and PDFSelection:
- UITouch dont called when PDFDocument is open.
- I solved this problem. (Read the text below)
-
Handle UITouchDelegate:
- Put subview on PDFView when user turn on "Pencil Mode"
- Subiew removed from super view when called method: UITouchEnded
- Use property:
@property (assign, nonatomic) CGPoint startPoint; @property (assign, nonatomic) CGPoint currentMovePoint; @property (assign, nonatomic) CGPoint endPoint; -
In touchesBegan: method we will get the coordinates of the first point.
-
❗️ Dont forget! PDFPage and UIVew - different coordinate systems
- Call this method for convert points from UIView to PDFView page.
[PDFView* view convertPoint:point toPage:self.readerPDF.currentPage]
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[super touchesBegan:touches withEvent:event];
UITouch *touch = [touches anyObject];
CGPoint point = [touch locationInView:self.viewForTouch];
self.startPoint = [self.readerPDF convertPoint:point toPage:self.readerPDF.currentPage];
}
- In touchesMoved: method we will get the coordinates of the moved point.
-(void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[super touchesMoved:touches withEvent:event];
UITouch *touch = [touches anyObject];
CGPoint point = [touch locationInView:self.viewForTouch];
self.endPoint = [self.readerPDF convertPoint:point toPage:self.readerPDF.currentPage];
self.currentMovePoint = [self.readerPDF convertPoint:point toPage:self.readerPDF.currentPage];
PDFSelection* selection = [self.readerPDF.currentPage selectionFromPoint:self.startPoint toPoint:self.currentMovePoint];
NSArray* arraySelections = [selection selectionsByLine];
[self.readerPDF setHighlightedSelections:arraySelections];
[self.readerPDF setCurrentSelection: selection];
}
- In touchesEnded: method:
-(void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[super touchesEnded:touches withEvent:event];
UITouch *touch = [touches anyObject];
CGPoint point = [touch locationInView:self.viewForTouch];
self.endPoint = [self.readerPDF convertPoint:point toPage:self.readerPDF.currentPage];
PDFSelection* selection = [self.readerPDF.currentPage selectionFromPoint:self.startPoint toPoint:self.endPoint];
NSArray* array = [selection selectionsByLine];
for (PDFSelection* select in array) {
PDFAnnotation* annotation = [[PDFAnnotation alloc] initWithBounds:[select boundsForPage:self.readerPDF.currentPage] forType:PDFAnnotationSubtypeHighlight withProperties:nil];
[self.readerPDF.currentPage addAnnotation:annotation];
}
}
- Well done! After this we get perfect PDFSelection. And add annotation to selections coordinats.
Examples:
Just select and autohighlight:
![]()
Also you can use colors from beautiful pallet color:
![]()
Look and navigate on all annotations:
![]()
Just Tap and Remove annotations! :
![]()
It's look so nice:

Related Skills
node-connect
342.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.7kCommit, push, and open a PR
