Created
September 19, 2016 22:58
-
-
Save kingreza/edd1b449ee3e34c4a9588e678af6d2c6 to your computer and use it in GitHub Desktop.
struct and class 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
public struct TestStruct { | |
var name: String | |
var lastName: String | |
} | |
let structTest = TestStruct(name: "Foo", lastName: "Bar") | |
print(structTest.name + " " + structTest.lastName) | |
public class TestClass { | |
var name: String | |
var lastName: String | |
} | |
let classTest = TestClass(name: "Foo", lastName: "Bar") | |
print(classTest.name + " " + classTest.lastName) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment