WEBVTT 00:06.070 --> 00:10.120 In this video you're going to learn the syntax of iOS 6 classes. 00:10.810 --> 00:13.070 So let's build our first example. 00:13.660 --> 00:18.970 So you need to use the class keyword followed by the name of your class. 00:18.980 --> 00:19.990 So I'm going to name its phone. 00:20.050 --> 00:26.930 6 and then inside curly brackets you define the different methods of the class. 00:27.060 --> 00:35.180 So the first one is called the constructor and that's where you store the constructor function that 00:35.260 --> 00:38.680 you use to create instances of the class. 00:38.760 --> 00:43.550 So this is very similar to the S5 constructor. 00:43.550 --> 00:52.700 So it just copy paste this code. 00:52.820 --> 00:53.980 All right. 00:54.030 --> 00:55.420 And then you can add other methods. 00:55.430 --> 01:03.770 So let's say that you want to have the extend warranty method which takes a parameter X and owns it 01:03.770 --> 01:11.500 to the warranty property like That's right. 01:11.600 --> 01:11.830 All right. 01:11.830 --> 01:14.210 So now to create an instance of the class 01:17.160 --> 01:18.210 you just need to 01:24.650 --> 01:30.950 use the new keyword like you did with the iOS 5 constructors and then you use the name of the class 01:31.550 --> 01:36.920 and you pass promises to it as if you were using the constructor. 01:36.920 --> 01:38.510 So let's give it a make 01:41.890 --> 01:42.430 model 01:45.560 --> 01:47.780 a warranty and 01:50.980 --> 01:52.030 let's go for 01:56.970 --> 01:58.760 a color. 01:58.780 --> 02:00.090 So now if we log 02:02.760 --> 02:11.100 my iPhone 6 this is what we gonna get right now. 02:11.290 --> 02:19.770 IOS 6 classes are not really something new actually they just provide a simpler syntax compared to iOS 02:19.770 --> 02:20.950 wife. 02:21.060 --> 02:32.360 And to prove this you can just log the type of your class Phone 6 and you will get a function. 02:32.360 --> 02:33.050 All right. 02:33.070 --> 02:41.660 So it's still a function like we used to use functions before in year five for constructors so. 02:41.910 --> 02:43.770 So a phone 6 or there is a class. 02:43.780 --> 02:45.310 It's still a function.