0001 /** 0002 * Classes conforming to the `RenderDriver` protocol 0003 * may be set as the `View`'s renderer for given file extensions. 0004 * 0005 * When a file with the given extension is loaded into the `View` 0006 * class, it will be passed through the supplied `RenderDriver` along 0007 * with any context information given by the user. 0008 */ 0009 public protocol RenderDriver{ 0010 /** 0011 * Renders a template string with a given context. 0012 * 0013 * - parameter template: The template string loaded from the file. 0014 * - parameter context: Information from the user to fill into the template. 0015 * 0016 * - returns: The rendered template with inserted context information. 0017 */ 0018 func render
View.swift:5 public static var renderers: [String: RenderDriver] = [:](template template: String, context: [String: Any]) throws -> String 0019 }
View.swift:36 let rendered = try renderer.render(template: template, context: context)