Created
July 11, 2019 17:49
-
-
Save Yerazhas/0f97e96f29d30f636fbb2bda2c96b5f0 to your computer and use it in GitHub Desktop.
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
| class Car { | |
| var mark: String? | |
| var wheels: Int? | |
| var maxSpeed: Double? | |
| var oil: String? | |
| convenience init(mark: String) { | |
| self.init(mark: mark, wheels: nil, maxSpeed: nil, oil: nil) | |
| } | |
| convenience init(wheels: Int) { | |
| self.init(mark: nil, wheels: wheels, maxSpeed: nil, oil: nil) | |
| } | |
| convenience init(maxSpeed: Double, oil: String) { | |
| self.init(mark: nil, wheels: nil, maxSpeed: maxSpeed, oil: oil) | |
| } | |
| convenience init(oil: String) { | |
| self.init(mark: nil, wheels: nil, maxSpeed: nil, oil: oil) | |
| } | |
| init(mark: String?, wheels: Int?, maxSpeed: Double?, oil: String?) { | |
| self.mark = mark | |
| self.wheels = wheels | |
| self.maxSpeed = maxSpeed | |
| self.oil = oil | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment