This file contains hidden or 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
import Foundation | |
import Fluent | |
protocol DynamicQueryable { | |
static func dynamicMapping<DB: Database, QB: QueryBuilder<DB, Self>>() -> [String: (DynamicFilter, QB) throws -> QB] | |
} | |
protocol DynamicSortable { | |
static var dynamicFieldMapping: [String: FluentProperty] { get } | |
} |
This file contains hidden or 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
import LeafKit | |
final class JSONifyTag: UnsafeUnescapedLeafTag { | |
func render(_ ctx: LeafContext) throws -> LeafData { | |
guard let param = ctx.parameters.first else { | |
throw "no parameter provided to JSONify" | |
} | |
return LeafData.string(param.jsonString) | |
} |
This file contains hidden or 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
//Import Javascript core | |
import JavaScriptCore | |
//[...] | |
//Get the JS Context | |
let context = JSContext()! | |
//write your function in javascript and feed it to context | |
context.evaluateScript(#""" |
This file contains hidden or 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
let label = UILabel() | |
label.text = "Swift is a modern, intuitive programming language crafted for all Apple platforms." | |
label.setValue(true, forKey: "marqueeEnabled") | |
label.setValue(true, forKey: "marqueeRunning") | |
label.setValue(0, forKey: "marqueeRepeatCount") |
This file contains hidden or 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
let label = UILabel() | |
label.text = "Swift is a modern, intuitive programming language crafted for all Apple platforms." | |
label.setValue(true, forKey: "marqueeEnabled") | |
label.setValue(true, forKey: "marqueeRunning") | |
label.setValue(0, forKey: "marqueeRepeatCount") |
OlderNewer