Here is a literal protocol example via playground, you can see how to implement these swift literal protocol:
- ExpressibleByNilLiteral
- ExpressibleByIntegerLiteral
- ExpressibleByFloatLiteral
- ExpressibleByBooleanLiteral
- ExpressibleByStringLiteral
- ExpressibleByArrayLiteral
- ExpressibleByDictionaryLiteral