WEBVTT 00:06.060 --> 00:12.320 In this video you're going to learn new iOS 6 features which you can use with objects liberals. 00:12.630 --> 00:23.790 So let's start by creating an objects the is five away so let's call its phone and let's say that our 00:23.790 --> 00:29.400 objects has got only a method called ring. 00:29.490 --> 00:34.470 So this is how we used to create the method. 00:34.490 --> 00:38.300 So let's say that it's just gonna log. 00:39.390 --> 00:39.840 Beep 00:43.230 --> 00:43.910 like this. 00:44.030 --> 00:48.910 Uh let's say that we pass into this function a parameter I 00:51.920 --> 00:54.370 and we're going to log. 00:54.650 --> 01:07.340 Beep multiple times using the repeat method which will repeat the string many times there is tri phone 01:08.870 --> 01:13.600 that ring off too and it gets beep beep. 01:13.900 --> 01:14.150 All right. 01:14.150 --> 01:24.170 So now in E6 there is a new way of creating methods inside your objects so you can just use a ring like 01:24.170 --> 01:27.600 that's without function. 01:27.610 --> 01:29.730 All right. 01:29.780 --> 01:31.510 This will work perfectly. 01:33.200 --> 01:36.830 All right so now let's move to computed property keys. 01:37.190 --> 01:43.610 So let's create another objects phone to let's use concepts 01:51.310 --> 01:52.140 all right. 01:52.460 --> 01:56.940 And let's say that it's called also a property. 01:57.200 --> 01:57.590 Make 02:01.640 --> 02:04.900 there's a property and a method. 02:05.010 --> 02:09.410 Now in iOS 6 you can use computed property keys. 02:09.450 --> 02:12.960 So this means that your keys can be computed. 02:12.960 --> 02:22.320 So for example instead of using make like that you can define a variable X set it to make and then use 02:22.320 --> 02:29.380 the value of X instead of make and you places inside brackets like this all right. 02:29.440 --> 02:30.460 So now if you try 02:33.650 --> 02:44.200 console that log of phone to you can see that you can't make us a property. 02:44.220 --> 02:48.760 Now the same thing applies to the methods. 02:48.770 --> 02:49.650 All right. 02:49.750 --> 02:55.810 So we can have the method as the return value or the return value of a function. 02:55.810 --> 03:08.140 So if you create a function G for example which returns the string ring like this instead of ring you 03:08.140 --> 03:13.430 can just use g called g like this. 03:13.430 --> 03:17.560 And if you log on to you soon get the same results. 03:19.070 --> 03:19.250 Right. 03:19.260 --> 03:28.550 So let's try phone two dots ring four times and it gets beep beep four times. 03:28.630 --> 03:28.890 All right. 03:28.890 --> 03:35.720 So now let's move to the assigned method of the objects objects. 03:36.090 --> 03:43.720 So this method can be used with the objects objects. 03:43.720 --> 03:44.410 All right. 03:44.530 --> 03:51.630 And we'll just assign new properties with their values to your objects. 03:52.030 --> 03:55.480 So let's say that we want to assign to phone to 03:58.700 --> 04:00.140 new properties. 04:00.440 --> 04:05.440 So let's add a warranty like that. 04:05.460 --> 04:14.150 So what's gonna happen now is that this objects or this list of properties and methods is going to be 04:14.540 --> 04:16.430 added to your phone too. 04:16.550 --> 04:23.410 So if you log phone to like this you can see that the warranty has been added to it. 04:23.420 --> 04:31.910 So these are really interesting new methods or new features you can use with objects liberals in E6 04:34.060 --> 04:40.320 in this video you're going to learn new iOS 6 features which you can use with objects liberals. 04:40.630 --> 04:43.480 So let's start by creating 04:46.490 --> 04:54.650 objects the year five away so let's call its phone and let's say that's our objects has got only a method 04:54.950 --> 04:57.450 called a ring. 04:57.500 --> 05:02.470 So this is how we used to create the method. 05:02.480 --> 05:03.920 So let's say that it's just gonna log 05:07.380 --> 05:07.830 beep 05:11.230 --> 05:12.170 like this. 05:12.270 --> 05:16.900 Let's say that we pass into this function a parameter I 05:19.920 --> 05:32.020 and we're going to log beep multiple times using the repeat method which will repeat the string many 05:32.040 --> 05:40.130 times there is dry phone that ring off too any gate. 05:40.230 --> 05:41.670 Beep beep. 05:41.900 --> 05:42.150 All right. 05:42.150 --> 05:52.170 So now in E6 there is a new way of creating methods inside your objects so you can just use a ring like 05:52.170 --> 05:55.610 that's without function. 05:55.620 --> 05:57.730 All right. 05:57.780 --> 05:59.700 This will work perfectly. 06:01.200 --> 06:04.810 All right so now let's move to computed property keys. 06:05.160 --> 06:19.820 So let's create another objects phone to let's use concepts. 06:20.450 --> 06:25.580 And let's say that it's got also a property make 06:29.640 --> 06:32.910 there's a property and a method. 06:33.010 --> 06:37.410 Now in iOS 6 you can use computed property keys. 06:37.450 --> 06:40.960 So this means that your keys can be computed. 06:40.960 --> 06:50.320 So for example instead of using make like that you can define a variable X set it to make and then use 06:50.320 --> 06:57.380 the value of X instead of make and you places inside brackets like this all right. 06:57.440 --> 06:58.460 So now if you try 07:01.650 --> 07:12.220 console that log of phone to you can see that you can't make us a property. 07:12.220 --> 07:16.760 Now the same thing applies to the methods. 07:16.780 --> 07:17.650 All right. 07:17.750 --> 07:23.810 So we can have the method as the return value or the return value of a function. 07:23.810 --> 07:36.140 So if you create a function G for example which returns the string ring like this instead of ring you 07:36.140 --> 07:41.230 can just use g called g like this. 07:41.420 --> 07:45.560 And if you log on to you soon get the same results. 07:47.060 --> 07:47.250 Right. 07:47.260 --> 07:51.120 So let's try phone two dots. 07:51.430 --> 07:56.680 Ring four times and it gets beep beep four times. 07:56.680 --> 07:56.890 All right. 07:56.890 --> 08:03.700 So now let's move to the assigned method of the objects objects. 08:04.090 --> 08:11.730 So this method can be used with the objects objects. 08:11.730 --> 08:12.150 All right. 08:12.540 --> 08:19.900 And we'll just assign new properties with their values to your objects. 08:20.040 --> 08:23.460 So let's say that we want to assign to phone to 08:26.710 --> 08:28.140 new properties. 08:28.450 --> 08:33.040 So let's add a warranty like that. 08:33.070 --> 08:42.130 So what's gonna happen now is that this objects on this list of properties and methods is going to be 08:42.550 --> 08:44.440 added to your phone too. 08:44.560 --> 08:50.860 So if you log phone to like this you can see that the warranty has been added to it. 08:51.400 --> 08:59.870 So these are really interesting new methods on your features you can use with objects liberals in E6.