Skip to content

Instantly share code, notes, and snippets.

@kingreza
Created September 19, 2016 22:58
Show Gist options
  • Save kingreza/edd1b449ee3e34c4a9588e678af6d2c6 to your computer and use it in GitHub Desktop.
Save kingreza/edd1b449ee3e34c4a9588e678af6d2c6 to your computer and use it in GitHub Desktop.
struct and class in Swift
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