UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

PDF Viewer

Forums > SwiftUI

Good morning everyone,

I'm trying to implement a PDF Viewer inside my app from a remote URL. I am not finding much that describes how to do this is SwiftUI. I know I can use Link, but the problem there is I don't want to move away from the app.

Can anyone show me some code on how to do this? Just not getting anywhere searching online. Seems like theres lots of stuff for UIKit but nothing really for SwiftUI.

Thanks, Taz

2      

@Taz wonders if PDF viewer exists. While I've not done this, the first place I'd start is with a framework introduced with iOS 11.

See -> Apple's PDFKit

And, yes, this has UIKit code. This means it's (highly probable) on Apple's back burner to make it Swifty. Until then, you'll probably need to wrap in a UIViewRepresentable. Lucky for you, @twoStraws has some great tutorials how to do this, plus you've completed the 100 Day's course! Nice!

Looking forward to you sharing some code here with the rest of us on how you solved this.

2      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.