Created
April 15, 2016 17:18
-
-
Save masters3d/b443fe9def6d1da02a6f503d1dd083a4 to your computer and use it in GitHub Desktop.
Default initializer from protocol/mix in swift
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
protocol Trying{ | |
var uno:Int {get set} | |
var name:String{get set} | |
} | |
extension Trying{ | |
init(unit:Int){ | |
self.init() | |
self.name = "" | |
self.uno = unit; | |
} | |
init(name:String = "", uno:Int = 0){ | |
self.init() | |
self.name = name | |
self.uno = uno | |
} | |
} | |
struct Concrete:Trying{ | |
var uno:Int | |
var name:String | |
} | |
let foo = Concrete(uno: <#T##Int#>, name: <#T##String#>) | |
let bar = Concrete(unit: <#T##Int#>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment