Just in case anyone else stumbles upon the same issue I was able to fix it by replacing the last 5 lines in the previewController func with:
return fileUrl as QLPreviewItem
Topic:
Programming Languages
SubTopic:
Swift
Tags: