-
-
Save fitomad/2257d2ae2e3675d9af5613f1d62cf588 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
private func loadTemplate(ofType type: TemplateType) -> String? | |
{ | |
guard let template_url = Bundle(for: ReportEngine.self).url(forResource: type.rawValue, withExtension: "html"), | |
let template_data = try? Data(contentsOf: template_url), | |
let template = String(data: template_data, encoding: .utf8) | |
else | |
{ | |
return nil | |
} | |
return template as String | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment