Open buguibu opened 5 years ago
Make a type expresable as a literal by conformin any of the existing literal convertibles protocols
E.g.:
extension CGRect: ExpressibleByArrayLiteral { public init(arrayLiteral elements: CGFloat...) { assert(elements.count == 4) let numbers = clip(elements, to: 4, defaultValue: 0) self.init(x: numbers[0], y: numbers[1], width:numbers[2], height:numbers[3]) } } let rect: CGRect = [0, 0, 20, 20]
Make a type expresable as a literal by conformin any of the existing literal convertibles protocols
E.g.: