Skip to content

Instantly share code, notes, and snippets.

Last active Jun 8, 2016
What would you like to do?
[swift-evolution] custom attribute in userland.
// Example of custom attribute
struct Route {
var route: String
var name: String?
init(route: String) {
self.route = route
struct Method {
var verb: String
init(verb: String) {
self.verb = verb
struct CourseController {
@route("/courses/", name="toto")
func listAction(request: Request) -> Response {
return Response(200, "Hello World")
let app = Application()
// other example of custom attribute
class ArticleEntity {
var id: Int
var name: String
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment