Post

Replies

Boosts

Views

Activity

Create an Image from PDFPage in SwiftUI
Im trying to duplicate the display of the built in Files app for documents in my app. How do I convert a page in a PDFDocument to an Image to display as an icon like seen here (from Files App) with SwiftUI. SOLVED: Image(uiImage: (document.page(at: 0)?.thumbnail(of: CGSize(width: 100, height: 100), for: .cropBox))!)
0
0
870
Mar ’24
PDF string output differs between simulator & device.
if I get the string contents of a PDF and print to the console in Xcode . when run on simulator it’s fine but on device some words are missing. same PDF, same code. only difference is simulator and physical device. its only a word or two missing from the page. anyone have any experience or suggestions with PDFKit to explain why a string would be missing the odd word ?
0
0
670
Apr ’24
Is this a SwiftData migration ?
I know if i change existing properties in a @Model it’s a migration. However if I add a new @Model class(es) that has no relationships to any existing is that still a migration or am i free to add? if free to add, should i create a new model container or can I just add the new Model classes ?
0
0
510
May ’24