Tag Archive for init

Swift Classes – Part 1

Creating a class To create a new class use the class keyword followed by the class name and a pair of braces. Inside the braces we can declare the class properties. class Point { var x = 0.0 // sets the default value of x to 0 var y = 0.0 // sets the default value of x to 0 } //…

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading...
Subscribe
We send about one email per week with our latest tutorials and updates
Never display this again :)