Skip to content

Instantly share code, notes, and snippets.

@fitomad
Created September 2, 2018 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitomad/2257d2ae2e3675d9af5613f1d62cf588 to your computer and use it in GitHub Desktop.
Save fitomad/2257d2ae2e3675d9af5613f1d62cf588 to your computer and use it in GitHub Desktop.
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