TemplateFactory

The Brady SDK TemplateFactory is the only way for a user to get a Template object.

getTemplate(template: InputStream) -> Template?

getTemplate returns a nullable Template object.

  • template: an InputStream object from the user-chosen template in their local directory. (See Example below).
//"selection" is a String representing the template's file name.
let filePath = URL(fileReferenceLiteralResourceName: selection)
let templateData: Data = try Data(contentsOf: filePath)
let iStream: InputStream = InputStream(data: templateData)