Created
April 30, 2015 17:18
-
-
Save mzaks/5b73f5ad2340e7279a9c 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
| typealias TPerson = (name:String, age:Int, male:Bool) | |
| struct SPerson{ | |
| let name : String | |
| let age : Int | |
| let male : Bool | |
| } | |
| enum EPerson { | |
| case Male(name: String, age : Int) | |
| case Female(name : String, age : Int) | |
| func name()->String{ | |
| switch self { | |
| case let Male(name, _): | |
| return name | |
| case let Female(name, _): | |
| return name | |
| } | |
| } | |
| } | |
| class CPerson{ | |
| let name : String | |
| let age : Int | |
| let male : Bool | |
| init(name : String, age : Int, male : Bool){ | |
| self.name = name | |
| self.age = age | |
| self.male = male | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment