 Probably the message was not passed properly the classes were supposed to the class was supposed to start at 10 But I you know asked you to come before Anyway, so why am I doing this? workshop and what is the kind of As in the behind today's lesson, right? So if some of you Don't know then we started this study group called Swift study group So it's part of the iOS community and The reason I started this group is because I saw that more and more people are learning sweet picking up sweet But they don't have either direction or resources to kind of do something meaningful Out of this learning, right? So initially my intention was hey, let's start this study group Where? People who are already learning sweet or already doing something with sweet they can come together and discuss about Their problems or their findings and do something together But then what happened in the study group is that the people who came are the people who want to learn sweet rather than the other We're all of the people who are learning sweet they came now We did it. We did few lessons and then Some of you are who are here today are from the study group also So that maybe I'll do two full-day workshop It might not be a lot But we'll do two full-day works up to get you started with sweet and then the study group will make more sense you know if you want to continue and If few of you want to kind of stop after learning the lessons here, that is also fine So Yep So today's agenda is basically this is a brief kind of it and some of the things that I want to touch up On we'll see how much you can cover but the idea is to talk a little bit about the tool And then we'll go through some basics of Swift You will have a lot of hands-on exercise in between but at the end we will build one app Like we'll build several last but one main app. I'll show you what the what is the app that we're going to build So It is called as the food recipe foods, whatever you want to call it So it's a simple app. No back-end integration. There are some list of popular Foods that you have in Singapore and you kind of click on that and we kind of read something more about That particular Food so this is what you'll be able to build By the end of today with all the knowledge that we will be learning So first of all, let's start with Xcode right and the way I'm going to conduct today's lesson is I'll have a little bit of slides that I'll walk you through and then I'll have some demos Hands-on that I'll do then I'll give you exercises that you'll try So Xcode is the the tool that you need to use to build Apps using Swift you can also like earlier. We are using another programming language called objective C You can use objective C and slip together as well in Xcode But Xcode is basically a set of tools that helps you build application for iOS for Mac OS for Apple Wars and for Apple TV so it's like watch OS and TV OS so you can use the single tool to build apps for all these platforms and A lot of time you can have a single code base that you can kind of say it's some iOS platform Mac OS and watch OS you can reuse a lot of this code together Now If you haven't used Xcode, this is the first thing that kind of it's a little bit confusing for people who are coming from other text editor or other, you know You know programming interface like IDs So Xcode has few sections you kind of need to first one hour will just spend some time Making ourselves familiar with the different section of Xcode and what are the things there how to navigate around this tool So earlier like a few years ago, there are a bunch of tools which were separate and you can use all these tools Together to build iOS apps now What Apple did is over the years they combined everything into this one Interface single window interface. So you'll have everything here. You can write code. You can create the UIs for your application You can you know debug The while you are running the Application you can see what is going right or wrong with the application you can run your test You can check the performance of your application So there are these are the few things that you will get you have testing tools You have debugging debugging again as I mentioned while you are running your program or your application you can You know see how the program is behaving or if something is going right or wrong You can put log messages and things like that asset management is something that you can put all your assets or images And you can manage them And then you have obviously code editing And there is something called Assisted source code editing we'll see what that means, but this is also part of export This is what you will use a lot into this lesson which is storyboard we will create a lot of user interface using storyboard And it's a great And he is a great tool to kind of Dragon draw a few things change the attributes or properties of the things that you are interacting with and See things on the simulator Debugging a lot of touch up on as we progress in the lesson testing again you can run your you know unit test or The UI test within the Xcode itself and you can see the coverage how much you are How much coverage you have for the test? let's see I'm going to run my Xcode right, you can Find Xcode if you just installed you can find within the applications Folder there is Xcode app you can double click and launch it or you can just Launch a spotlight search for Xcode and open it. I usually have it in my dock and I kind of just open it from here So There's this file many on the top and you go to new and There are few awesome see a workspace project file of playground. We'll talk about playground also And see how playground helps in learning and how we can quickly try out different things on playground But for now what we'll do is we'll create a project Now as I was mentioning you can build project or apps in All these platforms you have iOS here. You have watch OS TV OS and OS X is for Mac You have all these templates if you click on application and again, you have various different kind of templates that you have That will create a bunch of sample file that will create a structure for your application So that you can get started on top of that But usually on a complex application you kind of will mix and match multiple things but What we're going to start with is a single View application, which is basically it will have just one single page one view and we click on next and The next comes is This bunch of things that will ask is the product name You can call it hello world Organization name you can name whatever you want Can name if you have a your own startup you can put the name of the startup there Or if you are working for a company you can put the name of the company here Organization identifier is something that kind of Apple uses to uniquely identify In together with the application name of the product name And the combination of these kind of gives a unique identify for each application So usually the organization identifier is the river in the reverse domain name format so you can kind of put calm dot Paypal if you want and for learning you don't need to Pay for the Apple developer license, which is like we used to have the $99 USD It's like I think hundred thirty forty SGD You don't no longer need to pay for that to build even on your app even on your device However, if you want to put your app on App Store, you'd need to go through on the Apple license The language as I mentioned you can either choose Swift or Objective-C because today's lesson is about Objective-C then we can just keep it as Swift Devices You can select iPhone or iPad or Universal if you want to build an app that will run both on iPhone and iPad We'll just keep it to iPhone and there are a few options that you can kind of Check to do additional stuff. We'll just keep them unchecked for now Click on next Select a directory where you want to save this project and if you see Then if you see you have a bunch of files that got created You have this File called main.storyboard that is your storyboard to get started with And there is this launch screen.storyboard. The launch screen is used We call it a splash screen. It's basically Main to show something before your application starts So you can put just an image there or you can put some other messages if you want But some of the applications if you would have seen They allow you to kind of quickly go through you know swipe through When you launch the application and see what this application is all about the teach little bit about the application to users you can For that I think that the best way is you can kind of probably either do in launch screen and delay your application launch or You can do it in the main.storyboard. That is the launch screen is just kind of a placeholder But anyway, we'll talk through all this in details in a way This section here it shows a list of simulators you can Run this app on We can say select less iPhone 6 and if I press this the play button here Click on this then it's going to Run the application on that particular simulator and this is not an actual device. Although you can connect your iPhones to the Mac through USB cable and then you can Run it. Now if you see it just Launched my sample application. Hello world and it just has One interface which is just This white screen now, let me So this section here it is the View that that gets displayed in a in your application and if you click anywhere on the storyboard and the right-hand section Okay, let me go to the slide again to kind of help you visualize this The top section is your toolbar where you have the The start button the stop button you can run your application you can stop the simulator and You have bunch of other things like the targets. What are the? Different simulators you can run this application on and then a few other buttons You'll see what what those are But on the left-hand side you have the navigator area which helps you to navigate between your code between your Images between all the files that you have in your application. There's a little Little search or the filter option here where I can kind of Search between different classes that I have or I also have a search here Here I can search for Specific keywords. Let's say I want to search for Controller Then it tells what are all the files that has a particular keyword Okay moving ahead You have the debug area at the bottom usually it will be it will be hidden the debug area and To show the debug area what you need to do is on on on the toolbar you just Click on this middle button which is hide and so the debug area So what this means is let's say you want to you're running an application and you are putting a Log message that this is working fine and Then when this application kind of runs It print this message that this is working This is working fine So I kind of all of this is not an useful kind of message console message But you can kind of put different logs or different messages to help you Identify different parts of your course and see whether things are working properly or not And the extreme right side is your utilities area Now the utilities area It this section It allows you to do a bunch of things first of all it is really helpful When you are working with storyboard, for example, whatever component you clicked or whatever Element you click it shows the attributes of that particular Component for example, I selected this middle section, which is the view of my application Now it tells me what is the background color of this view? I can just change the background color of this view to something else Right there and then if I run the application now it is going to display that color There's some different colors coming because I have some transparency here. I can just choose a solid color. Let's say and it kind of Does that so and in the navigation section again You have the filter bar as I mentioned the navigation navigator bar where there are a few options One of them is you kind of go to your project. You can search within your project. You can go to specific things like you can see You can see what are the breakpoints you've put in your application you can see the Different taste and you can see You can you can search it will see all these things in a while So with this I'll ask you to start the first exercise Who's this? The same thing that I did but you kind of try it on your own create a simple application Just with the hello or click on the storyboard file And try to You know so and hide different section of your next code try to so and hide the assistant editor Try to so and hide the navigation or debug or utility area Change the background color of your view And here you have a bunch of other options you can search for let's say label So label is just A component where you can display a string you can just drag and drop In your application and let's say I change the color because there's two kind of And you can just write something here and now if you run it is going to Okay, it's a little bit off because I am not using the auto layout But anyway, so let me change the size to Four specific iPhone six. So Now if you run It's going to look properly in the center But again, as I mentioned, whatever, uh element you click It is going to display the property of that particular component or element If you click this label, it is going to now display the attributes or property of that particular label You can change the text here also. Let's say I say hello world, but the size is not enough to fit this text You can increase the size You can change the background color of the label if you want You can change the text color of the label You can you know increase or decrease the fonts right So Try this Come to this You Quickly go through for some of the folks who came in late. Um, so they're kind of um, sorry for folks who are listening already But just a quick one So what we are trying to do is building an iphone application. I can just go to new and project And then you have a bunch of templates. Um that helps you to get started We are selecting the single view application. It is going to present a single, um view And then you fill in all the Details And this is the organization name whatever you want to put here The identifier is normally in the reverse domain name format language select devices you select And the storyboard is where you kind of create your e y of your application you get started with this And if you select the storyboard In the middle section You have this view controller. We'll talk about what the view controller is but the The part in between the the thing in the center Is going to display the view for your application. Now if you just run as it is you can select whatever you know Target, you want to run it on um, here the iphone 6 or 6 s plus or whatever Then isn't just going to run this This empty view which is just white right and if you tap on this section on the right hand section Um, again, you have few options you need to tap on the attribute inspector Which is going to show the attribute of this particular view So if you have selected this then you can see all the properties are attributes related related to this view You can change the background color um to whatever you want. Um, you can write And then the thing that I wanted you to try is Put a label or label is just to display a Text In your application, you can just align it to center Adjust the with the guidelines you can kind of um Adjust the height and width of this label And now if you click the label you can see the properties related to the label on the right hand section and you can Align it to center it can change the background color of the label to white and If you run now It's going a little bit off that is because um now in ios we have this thing called auto layout because we have so many devices And you need to think about all the device Regulation of sides and that is I mean we are using something called auto layout that kind of So we specify a bunch of rules And this needs to be center vertically aligned or horizontally aligned and those rules we need to define But for this lesson, what you're going to do is we can probably touch upon auto layout in the next lesson But for this lesson we'll disable auto layout. So the way we do it is click on this thing And um tap on the the file inspector And you have this huge auto layout checkbox Just uncheck that it asks do you want to disable size classes? You'll click on this Right And then go to the Attribute inspector while clicking on this. Um The yellow thing Sorry and here in the size section you select iPhone 4.7 inch iphone 4.7 inch for um iphone 6 iphone 5.5 is for the 6 plus or 6s plus And then you Adjust accordingly now what we are going to do is we are doing everything for iphone 6 And in the target you select iphone 6 instead of 6s plus Now whatever you do because auto layout is disabled and you are doing for only one screen it is going to Display it properly and align it properly Try to put few more Drag and drop few few more components to your Storyboard and see how it works. Uh, you can't drag and drop things like Anything that has controller like table view controller and all this thing you can drag and drop but you can Drag things like slider you can drag and put There is Switch you can drag and Put here And there are a bunch of other things like Anything which is like gesture recognizer and all those things you can't really simply Drag and drop and see something to happen. But a lot of um Other things like For example segmented controller is something you can drag and drop here Image view you can put and then something just make yourself familiar with the tool You know how it works and um and while you are here you can kind of Hide and so navigation and the debugging section hide and so the The inspector section or the utility section And see what are the different things you have here just make yourself familiar with the um tool On This is the restaurant. No. This is the one she chose. This one? This one? This is the photo of the man. That is the one. That is the recommendation please. This is the one. This is the machine. This machine is... The one. This is the one. This is the one. Sometimes you will see the similar two sizes. Two smaller two. There is a way you can call... Command one, Command two, Command three. Why not the human? Why not the stupid one? So... Command one, Command two, Command three, Command two, Command one, Command three, Command four. Command five, Command six. Command six. Command seven. I know some of you are already putting images. Let me show you how to... display an image, right? Let me show you how to... display an image, right? The thing that you need to use is image view. you can just put an image view and change the background color so it is not going to display an image but it's going to display something so it's going to display at least some color that is going to display this color but if you want to use an image what you need to do is download any image you want let's say because the main app that I showed you is about food which I should have in the image already let's say you download an image I have okay let me put this chili graph photo and you go to this this thing called asset dot xc asset this is the asset catalog or image catalog in your project and there's a plus icon at the bottom they click on the plus and you select import and you go to the direct you know directly wherever that image is you select that image and open now if you see there is this one x thing here there are different things like 1x 2x 3x that is depending on where this will be displayed and for some of the devices because you have the retina display you need a higher resolution image and if you want to support all the devices then you need to have basically these three images but for this one we can just use the 1x image this is this thing but once you add it into the asset catalog this will be available in storyboard you go to the image view and select that then within this image section you can just start typing whatever the name of the image is and it is going to display but if you see this image is a little bit kind of squished and it's not proper that is because my image size here is 600 cross 800 that is my image view if I see is 240 cross 128 so it is not exact resolution so either I match the ratio so either I you know if it's 600 800 then I can use 300 400 then to look nice proper or I can use 150 200 let's try 150 200 you can this is where kind of the size inspector comes in handy you can just modify the height and weight directly there you can also drag using the the lines here but the size inspector also is useful however sometimes in your complex application you'll have this thing fixed right and then you need to make sure the image looks good irrespective of what the resolution is and that is where once you click on this image and you go to the attribute inspector there is this thing called mode a different mode one is aspect fit so it is going to display a proper evaluation and leave out the extra space that it doesn't need right another aspect fill so it's kind of going to display the proper image but whatever available space it has it is not going to compromise on the the resolution so just play with it and see how you can add an image to your application save for trouble those of you who want to access the Wi-Fi, it is pre-packed, yes, password, age, save payments is S capital P capital it is on the whiteboard it is a parameter for prevention in our system that's it, that's it, that's it that's it that's it that's it that's it if you're done with this we can take a short break for a few minutes and then we can start with the playground that's it that's it that's it that's it that's it that's it that's it that's it that's it that's it that's it that's it I'm a little bit nervous. I can do the eye. She's got it in her mind. Yeah. It smells a bit like a monster. I'm not sure what it is. It's a bit... It's a shuffle. Take a look at today's model. Oh! It's a catchy ball. Yeah. It's a mini model. It's kind of like a mini for kids. I like that. I like that. It sits really well. It's the big one. I'm cool with it. It will be great with the Odyssey. IML's like a mini model. It's got similar歡迎. It's kinda like in a little Minh disabled. Yes, very much the same. It's going to be the opposite. Okay. I'm gonna Suprise it. exported it. You can't do that. Yeah what? You can't do that. I think I can't do that. Oh, you can eat it. Yeah. I think I can eat sparsely. Is it that you don't have any? It sounds like my sparsely. I think you can eat it. It's a sparsely. I always eat sparsely. It's a sparsely. Oh, of course. So those of you who haven't kind of found the toilet is this way but while coming you need somebody to open the door for you so it's easier if you are going along with a friend just ask the friend to wait for you in the door on this side. For those of you who are learning it today how do you find it so far? Is it easy? Is it difficult? Do I need to slow down? It's okay. All right so the last thing I want to kind of show on xcord before moving into the playground there is this thing called view debugger which is really helpful because sometimes you know you have created a view or you want something to happen on the view whereas either some button is not clickable or some component is missing how do you know that that component is there right because something like this is very simple in a complex application you'll have kind of multiple layers of views or components or things like that right how do you know that the thing that you're looking for is there and another view is not coming on top of that but the way you do it is using this view debugging tool again you run the app on the simulator right and while it is running you have this button which is debug view hierarchy you just tap on that and it is going to display this view hierarchy and you can kind of do like this and you can see the different layers that are there and you can see even the internal component of Apple you can see how they are creating this and let's say while you're running there is this button and then you have the adjust view mode you tap on that so it needs to run on the simulator so if the application is running then on the bottom section you'll have this debug view hierarchy and let's say I have this image view and by mistake I added another view on top and now because this this thing is simple but you know imagine my application is really complex and I have so many things and I have this thing on top and I have less I have this color and I'm wondering hey why my image is not appearing you know because I am doing it properly or why my image is not appearing and now if I run the simulator and go to the view debugging mode and I do it and you can kind of twist them like this also and you can see hey this thing is actually behind my view which means you know something is wrong and I need to fix it this is something really nice about the view debugging I'll let you try it for a while then I'll move to the next section maybe add something on top of things that you already have and see how it looks on view debugging so when you'll have this thing on the bottom bottom bar right you have this thing you need to tap on that and then you have the 3d orientation button you tap and it goes to 3d mode you can do like this and you can kind of adjust so okay moving ahead we will talk about this thing called playground now it is a really nice tool that again comes along with Xcode that you can use while learning Swift so you go to file new and then you have this playground click on that and you can choose whatever platform you want we want iOS you can just select iOS you can leave the name is my playground or you know whatever you want hello playground or whatever you click next and you select a location where you want to kind of save it now this is playground what it does is while you are writing code here instantly you can see the output on the right hand side it helps you kind of try out simple snippet of course and see how it is working write a small algorithm and see whether it is efficient enough or things are working as expected and again like Xcode you have also the kind of the console area let's say I write something like print hello it is going to print this the actual print message that you are getting is hello but the thing that is it is sending to the system is hello bex lesson because it kind of prints a new line also it comes to the new line so we will use this a lot in our lesson today without spending much on playground I'll jump to the next section then we'll try all the sample codes in playground so we'll talk about Swift now and this is now we know about Xcode how to navigate into different section will knew about storyboard little and let's see how Swift can help us build applications so there are three like lot of advantages of Swift over the previous language which is Objective-C like first of all for the people who have been coding in Objective-C they will appreciate the syntax of Swift because the syntax of Swift is much easier compared to Objective-C and if you have been planning to pick up iOS few years ago Objective-C was the only way and it was very kind of different from any other languages that you've come across like Objective-C was very different for example if you're coming from a scripting language like JavaScript or Ruby or some other language whereas Swift is very similar to always a full-fledged programming language it is very similar to syntactical languages like JavaScript or Ruby or Python and it is a modern language because it was introduced like you know couple of years ago in 2014 to be exact and then Apple put in all the modern features of the languages into Swift so it's like really powerful really modern and really safe what are the like why we call it safe and powerful we've seen a bit but one of the thing is Swift is very fast like what does it mean is it fast in terms of development effort or is it fast in terms of the time it takes to process a program actually it's both first of all you write much less code in Swift compared to Objective-C because the syntax is easy you kind of things are sometimes a lot obvious in Swift than in Objective-C and it is also fast to run this program internally because Apple has implemented it thinking about Apple has implemented few things before Swift like for example Apple implemented or advanced their compiler or their memory management system again this might kind of sound like a jargon for those who are starting today but then internally Apple have considered the thing that Swift would need before they even launched Swift and then they launched Swift or they published Swift and the most significant part of Swift is it is open source now they made it open source last year so a lot of people from the community they are contributing to make the language better they are contributing to make sure it is modern and it it kind of supports all the needs and I'm not sure if you have heard there are a lot of companies working on the you know Swift to make it compatible or make it work on the back end they can build your web services in the back end also and there was a rumor that Android might be using Swift soon so who knows so so this is what we used to kind of write in you know see if you want to kind of print a hello world you had something like this has input as today or not as and if you have learned see this program might sound familiar to you or look familiar to you however to do the same thing to print a single line and Swift all you need to do is this is a sprint hello world right you don't need to include anything you don't need a main function you don't need to return anything so that itself is a simple program that in a print hello world right then talk about variables and constants so what are variables and why do we need them if you haven't using iPhone applications let's imagine you you're using Facebook application right in Facebook you see your timeline and in timeline you see the name of your friends the details of the things that they post now imagine Facebook is not creating these things for all the people where Facebook is not creating these you know designs specifically for different people well what they have is a template and they are just going to change the name or description of the person on those templates imagine you are creating an UI you have this name field or name component or name label they say and you have this description component and you are changing them dynamically and those things are the things that you can change dynamically are variables and the way you define variables are consign and declare variables in Swift is with this keyword called where followed by the variable name whatever variable name you want to put usually variable names start with lowercase and class name you start with uppercase and if there are multiple words in variable name or class name you basically the next word in make it uppercase and there is this column and you have the type of the variable you can have string you can have integer you can have floating point numbers you can have any other different type of objects basically anything that comes up to this column defines what is the type of this variable and then you have because string in Swift we denoted between two quotes which is basically whatever string name string you want to put whatever value you want to put let's say here I'm using PayPal after the cost so this is how you will kind of declare a variable in Swift but let's see there's something that you won't don't want to change like some pills you don't want to change in your application right let's say there's this fail that you hardly think will be changed then you just declared it as a constant and the way you do it just by changing the var keyword to let and that is how we declare constant in Swift same thing if you want to kind of use a double or integer you basically follow the same syntax it's like variable name a type and the value Boolean is basically true or false right nothing is that is so obvious like for example in this case you know the things that won't change is probably let's say the company name is not going to change the year of establishment is also might of know about that but let's say assuming these don't change how whereas the last year's revenue might change so you make it as a variable and the other things as constants right now the type itself is more Lee so if you look here we are specifying the type of this variable constants now so obvious that in Swift you don't need to specify the type so you just do whatever late the constant name and you specify the value based on the value Swift will automatically determine what is going to be the type of this you know constant or variable whereas thinking about a safety feature let's say for certain things you want the variable constant to be specific type then you can specify the type and whereas let's say you want a variable to be string only then you can specify the string and that means if no one can assign a number to it later on later point of time so that is kind of the safety feature of Swift and we know on there are a lot of other safety features but we'll see how those works variable of constant names just you know doesn't need to be a string or it can be a special types you can just put any special characters as variable of constant names for example here I'm putting pi as my constant name you can put this the emojis also as your constant name and use them or in your application now this is something I'm showing in for local come come to for loop in a while but things like this what is it's going to do I have a string it is going to loop through the individual characters of the string and it is going to print that character that is going to print this for me if I fit in Chinese then it's going to again print the specific unicode characters same thing for you know if you are able to read this it visit in Hindi and of course with emojis also so it's like these are individual characters as well now we we tried out different things let me so you hear as you see this is a variable that is declared you can you can do like this right and I can just print string right and I can let's say to let my number is 10 this is a constant and let's say it constant means I cannot assign anything to it later point of time it is going to kind of complain about it similarly if I have a string already and I try to assign a number to it and it's going to complain also because the type is fixed here let's run one of the one of the for loops and see how it works and if you want to play a little bit of the emoji the way you bring in the emoji character is command control and space and that will bring this little enough for you try this out try to see you declare a string which is variable with a specific type try to declare a constant with specific type you know and then try to make it generic and you see how it works and try this the for loops this is now just on my Okay, now that you have already kind of tried out the playground and you know how to kind of declare a variable and constant how to run a simple for look although for look is something I'll see more in details later part of today's lesson our main objective is to build the final app this this app right the SG food app that I showed you initially right and those of you didn't come initially this is what we are aiming to build by the end of this listen right and and we need to kind of incrementally build this so let me show you the next thing which is part of how to let me open the hello world application right this simple application we are not changing anything all the thing that we did is on the storyboard and it's very static it is not changing and whatever we design here is the thing that we are seeing on the simulator and we start it let's say this particular label right let's say initially it was hello world and for whatever reason I kind of want to display hello Singapore when it launches the application right all the my design is hello world there so the way you need possibly need to kind of have a variable name for this label so that you can change it dynamically so by default it will be on the standard editor here you can hide this utility section so that you have more space you can hide the navigator section also by clicking on the show and hide button here all you have is the storyboard here and you click on the assistant editor which is the second thing right by default it is going to display the class that is associated with this various controller and that is if you have the automatic selected sometimes there are some issues with storyboard Xcode it doesn't show up and you can just manually go to that particular class if it doesn't show up but by default like 18 90% of time it should show up and to create a variable or to link this UI label to a variable all you need to do is click on this label press on the control key and without leaving the control key you just drag it to your class and just leave it after the curly braces start and you can name a label to give a name to your label I can name is or maybe better hello label or something right and the variable name needs to start with the lower case and you click on connect it declare a variable for us and I'm going to go to the specific class to see it this part should be familiar to you and there are a few additional things you know IB outlet we can there is this thing at the end just forget about those for now but from this you can identify that this is a variable of type UI label right because that is how we declare string that is how we declare integer and this is a variable of type UI label and this IB outlet basically means that it is coming from storyboard IB stands for interface builder which was the original tool before using storyboard came out and they kind of written the same conventional so this IB outlet means this comes from storyboard um and there is this thing called weak and strong um again this is related to memory management because iphone um is a very small device the memory memory is limited there um you need to take care of the memory management luckily there is this tool called um automatic reference counting which is part of x-code and you don't need to bother about memory management much but just for this thing you have two um two type of uh you know the um there are two ways you can kind of hold reference to an object one is weak and another one is strong and if you declare weak which basically means that the compiler will take care of um managing the memory for this particular label so anything that comes from storyboard usually the compiler takes care of the memory and you don't need to do anything so that is why these two additional keywords are there i'll talk about this exclamation mark towards the second hub of today's lesson but for now you can imagine this is a this is a variable name of your um UI label that we created on storyboard right and by default there is some um some methods or functions some methods let's call it methods um which are there now these are the things that gets called a certain point of time we call them delegate methods um again where delegate is something i won't touch upon today that much into detail but the just for your understanding imagine these are the methods that gets triggered at certain point of time when your application runs and as the name would suggest viewed load is a method that gets triggered when your view finishes loading so your application is um loading the view and by the when the view finishes loading that time did this gets triggered right let's see how it works i'm just going to print something right and let's see that this is actually working and if i run the application now i get this message after my view finishes loading right and this is where i have the opportunity to change this value right and all i will do is hello dot label and the label has a property or attribute called text and it takes a string and string we know we denote by um these quotes double quotes and i just say it might not fit properly with the size i just put hello sg right so although i have hello world here when it is loading the application it is changing the value to hello sg and it is printing this thing i'll just show you one more thing before i assign you something um some give you some assignment i'll just add a button just put the button here i just call it tap me and same way i need to link the button with my code or with my um the the controller class but for this button i don't need a variable name why because i'm not going to change anything um any property of the button unless you want to let's say change the text of the button or the color of the button or any other properties of the button you don't need a variable name all you need is a is an action that will be triggered when you tap the button right so the same way i just control drag to my um view controller but instead of outlet i will choose action i just change this to action instead of outlet i name the method my button tapped right and if i come back to the standard editor this is the method empty method that got tapped again don't worry about the syntax we will see how function and method works and how you pass the parameter but for now this is a method that will get triggered when i tap my button let's test it out i'll just print something button is getting tapped i just run it and when i tap this is getting printed right now what i want to do is instead of changing the text directly when the view loads i need to move it to this method so what is going to happen now initially it will be hello world and only when i tap the button it's going to change the text to right can i change it back to hello world yes if you have you know the logic to kind of handle how many times it happened and that is very kind of let's say you're the segmented button you are using and you can use the segment button to kind of toggle between these two texts right but this is how you will um create a ib outlet and ib action and you'll give a variable name to your view components and you'll create a function or method and that will be triggered when something happens with the buttons or any other controls with this you try this one first of all try the first example that i showed you just give a variable name to your label have a button try to change it when the button is tapped then you try this one you'll have a text field and then you'll have a label then you have a button in a text field you enter something and tap the button it this the label is going to display whatever you tap on the text field right and you don't need to kind of fix your cut between the segments if you think you can create something to um different from this you take the knowledge where you write out your image or change the image of that my experience with dot tanks i was like i was like i was like i was like i was like i was like i was like i was like i was like yeah i think you're doing oh i think actually it's all about the right um the it is like it's like something and i go on your uh background yeah so let me know if you're um It's okay. I'll get higher the water. It's okay. I'm just going to stay here. I'll be away from this. Listen, this is the incident. You know, people have to go to jail. You can tap in the button. It's in the yellow, black, yellow section. Just like this. And this thing is no longer here. So I'm going to find food. I don't know. Don't know, but I asked you. Can you channel? It's true. Now. I'll subscribe. I see. Come. If one project can work on another project, can you say it's worth doing? OK. So I'm showing it to the security. And then I'm going to put my hands up. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. So let me button. No, you can have it on the tutorial. And other things. But here, I'm going to be using the power button. So I'm going to put it here. I'm going to use the power button. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. OK. So like some of your confusions are like when to choose the to the output and going to choose the accent, right? So, outlet you are choosing or you're using where you want a variable name for your component, right? And you need a variable name either to modify a property like the thing we are doing for updating the text of the label, right? Or to fetch the property. Here we are interested to fetch the text property of the texture also. So you need an outlet for the texture. Well, accent is something that you need for things where you want a trigger to happen. Let's say user is tapping on the button. That is where you need the accent. User is going to slide the sliders. That is where you need an accent, right? User is going to tap on the segmented button or anything else. Although user is here typing the text, but this is where you don't need an accent for the texture because the thing that you are interested in is the text of the texture, right? Which is a property and which is not you need an outlet and it's not an accent. But you cannot enter in by entering. Yeah, but that's all. That's the question. No. That's all right. You need to use the app. Yes. I have a store for the database. I use the app. I use the app. I use the app. I use the app. I use the app. I use the app. I just use the app. I use the app. I know this app. It's fine. How long will it take? I don't see it next week. It's been a long time. She's been seeing it for a while. I'm going to be at that meeting tomorrow. That's why I thought it would take a while. That's why I thought it would take a while. That is very important in troubleshooting. I just want to say it's important. Yeah. I think that's all right. Right. I think that's all right. I don't know if you finished the first one, you can try this one, and I think after 5 I think I should take a lunch break We don't know if you finished the first one, you can try this one, and I think after 5 I think after 5 I think after 5 I think after 5 I think after 5 I think after 5 We don't know if you finished the first one, you can try this one, and I think after 5 I think after 5 I think after 5 I think after 5 I think after 5 We don't know if you finished the first one, you can try this one, and I think after 5 I think after 5 I think after 5 I think after 5 We don't know if you finished the first one, you can try this one, and I think after 5 I think after 5 I think after 5 I think after 5 I think after 5 We don't know if you finished the first one, you can try this one, and I think after 5 I think after 5 I think after 5 I think after 5 Okay guys, so this assignment that I asked you to kind of try out with the emoji Some of you had difficulties passing the parameter and some type mismatching was happening We don't have time to go through the entire exercise solution here, but I will share the solution with you But the thing that you need to do is, emoji is just a character, you need to kind of wrap it inside a string to be able to display it So you can't display it as it is, so you need to wrap it inside a string So again string interpolation is something you will see, that will again help you to construct complex strings But for now just imagine, you can put Let me show you, if I just do it like this, it is going to complain that it doesn't understand this character And even if I put string or something, it is going to complain it Let me see if character is going to work There is still a special character that the compiler is unable to understand So you kind of need to wrap it inside the quotes to make it a string And then you can use it Whereas the other way around, you can put it without a double quote Then the variable name itself can be anything The variable name, it doesn't really look for the quotation there Because the name can be anything, it can be a unique quote character Whereas when you put it as a value, then you need to specify it as a string Anyway, I will say the solution with you The thing that I want you to try now, which is a part of this exercise Because this is what we are going to build And you already have enough kind of knowledge on how buttons work And how IB accent works So you build the first part of it, which is this I put few buttons, change the background, image and title of the button And use something called button tags I will show you what the tags mean So let's say you have multiple buttons And let's say you have eight buttons Why? Let's say you have eight buttons Again, this kind of UI, you would usually create using something called collection view The button is just for this first class collection view Something you will see Usually you won't create this kind of UI with just buttons It's very basic and it kind of troubles It doesn't give you much flexibility But for this first lesson, it's for today's solution We are going to use buttons Usually you won't have four accents associated with these four buttons You will have a single accent if you are going to do something You will have a single accent linked to these buttons But then you determine which button is being tapped Or the information about this button Using this thing called tag And then the tag is basically a number that you can specify You can specify tag one for the first button Tag two for the second button Tag three for the third button and so on And the method gets triggered when any of these buttons get tapped But you can find out which button is tapped from the tag So you try it out, it will help you along the way But this is the first step in it to try out Imagine the app that you are going to build at the end Create a few buttons, change the background image and title Use button tags Trigger an accent, a single accent When any of these buttons are pressed And display the tag number When any of these buttons are pressed Display the tag number of that button So if one of these buttons gets tapped Then it will be three years And you will be able to write any words Imagine you need to add the same way in the asset capture And then change the background image And you will be able to write any words Let me know what that's about Like I said, it's about being able to change the background image Because it's the same way in the asset capture And you will be able to write any words But now I want to include the sound But unfortunately I wanted to make sure that the color is compatible And you have to look at it We will try to get the avarice But after I've started everything We need to get the same color And I want to include a nice tropical ripple So I don't have to worry about it So don't worry about it That's fine You can show it to me Let me know what you think And I will be able to use this So let me show you one part of this exercise and you can continue after that which is how do you link a single action to multiple buttons, right? Then you go to the assistant view mode and let's say tap on this button I just create an action which is let's say my button tapped, right? There are various ways I can link again to a method one is I control drag and drop here itself, right and I can select the button that is one way or I can control drag to this itself, right? And there is a third way which is you right click on this one and just connect but here you need to specify what is the event and the event that gets triggered when you tap a button is touch up inside is kind of little confusing. So the easiest way is you kind of drag and drop here or just connect here and then if you see right click you can see all these four buttons are linked to the single method. Now if I just put a print message, right? And the same method will get triggered when I tap on any of the buttons the same thing is getting the same method is getting triggered. Now you can carry on with the exercise. Okay so it's actually very simple to display the tag. All you need to do is on this method signature there is this parameter called sender. Now sender in a method usually means the object that is triggering the method. So in this case it is the button itself. So to get the tag all you need to do is just create a constant instead of variable because this is a fixed thing for each button you can just do sender.tag and you can just. Now I am putting an exclamation mark here because this thing becomes something called optional we will go through optional later on but this is just to undab the value. See why you need it but we just need it here and this will just print the tag. So whatever the tag is so I think my last one the tag is zero or something. Yeah so I can just change it to four. This is the only thing that you need to do which is sender.tag after you link all the buttons. However the UI for mine is very plain. You can put a background image here as I mentioned you can change the title. But if you change the title it's going to be fixed at the center. Now there are ways to kind of move it down but the way I have built the other app is let me show you. If you see here I have a button and on top of the button I have a label. So the button doesn't have any title so I can just let's say I change the background color of the button so that you can visualize it. I change the background color of the button to let's say red. And then I won't put any title here. I'll just drag a label. There are few reasons why you could use label. First thing is that sometimes you might need multiple information than just the name right. Sometimes on the image you need to let's say so the name and you need to show how many people have liked it and you need to show a rating of what people think about this particular item right. Then you can put a label multiple labels or image and having a label kind of give you more control. You can put background color up for that. You can use some kind of transparency so that little bit of the image of the background the image of the button gets displayed whereas your label stays on top. So and once you put an image it's kind of going to look like this guy. So once you have so this is the button image and this is just the label and on tap you kind of display the tag. I'll give you five more minutes to finish this then we'll move to the next section. This is the label right. This is the battle list. This is the battle list. This is the battle list. This is the battle list. This is the battle list. This is the battle list. Okay moving ahead, assuming we have finished this one. We'll see why we need the tag and what is the purpose of the tag right. First of all in this case we have like if you see about the sample up we have eight buttons right. And then when I'm tapping on this I'm getting the value of that particular button in the next screen right. I'll show you a little bit of code and then we'll go into that. So I have what I have is area of things. I have food images, I have food names and area of description. Now this is a really bad way of building your apps. You won't normally have like this. You'll probably have in a JSON file or a page from an API. But this is again for the example let's say I have this list of food names right. And I know chicken rice is at my first index right. And then I have mapped that to the tag right. And the first index I have mapped that all I'm doing here when I'm passing the value is I'm just fetching the value by index. And I'm using the tag as the index right. So we'll come to this in a while and before that I need to kind of walk you through a few of the other things. First of all we saw like characters. You can combine characters to combine characters to form string right. Sometimes while building complex strings right so far we just displayed the tags or display the text that we get. Let's say we want to construct our own string. How do we kind of evaluate the value that we are getting from let's say text file or some other actions right. So let's say I have a 3B5 and I want to display something like this. 3 times 5 is 15. And the way you interpolate string in Swift is by this special you know symbol is like slash. And then within the brackets you put the value put the constant or variable and it will evaluate you can put an expression inside that also. Evaluate that variable or constant or expression and it is going to display that. That it makes sense. So like for example let's say I'm going to go back to my playground. Let's say I have a string is so bright. If I just print string it is going to print that thing right it's going to print my name. But if I do print and print is a method which takes a string value I do my name is and this is what I am just going to do slash. And within brackets I am going to put my variable name and it is going to print. So this is the interesting bit which is going to interpolate the string. Similarly let's say I have a number which is like this is I can do something like I can multiply it by 3 and I can display the result also. So it's basically I am doing an arithmetic expression here and it is going to compute and display also. So we will get a chance to try it out. Let's move ahead. The same thing you know just pass another value and now we are going to talk about array and dictionary. An array is basically a special type of we can sweep it actually a structure where you can have a collection of objects. Here I am just having a collection of strings. I have a collection of names. Again this is where the safety feature of safe comes in. Let's say I have an array of names. And the way you declare is like this. You can start with the square bracket and then all the objects are separated by comma. You don't necessarily need to have a string object there. You can have whatever object you want. Let's say I just put some numbers here. These are not really numbers. These are actually strings because I have the double quotes. Now I can if you start the index from array elements are fetched by index. It starts with 0, 0, 1, 2, 3. Let's say I want to put something at the position 4 and I just do. It happened. This is going to work. And then I will say print array of names is going to print 1, 2, 3, 4, 5. Now let's say I am doing something like this instead of a string I am putting a number. It told that hey you have a string array but you are trying to put a number to the string array. And that is what it is complaining. And if you want something like that then you need to specify that it can't take any object in the array. So this is where the safety feature of safe comes in. It is very strict about what you are trying to do. And it asks you hey is this something that you really want to do or is this something that happened by mistake. This declaration basically means that you are specifying initially that it is going to be an array of string. However, if I let's say I put something like this, this is going to work without any complaint. Because while I am declaring the compiler already knows that this array can have strings as well as it can have integer. Then when you are trying to append integer it doesn't complain. So this other way means it is an array of string and it complains when it sees a number. Or if I just there is this another type called any object. If I change the type to any object then the compiler knows that hey it might expect something other than string. So that is about the array. And in Swift you can again it is kind of useful for people who are coming from objective set background and trying Swift. You can mix and match Objective-C with Swift which means that you can have array of Objective-C types also. Here you can declare the type is in its array and it won't have happened. But then you will have the methods that you have on Objective-C available in Swift also. You will have access to those methods. With this actually before going to dictionary what you can do is you can modify the existing exercise. Now we have this right. You have the name of the food items. What you can create is you can have an array of food names and when you are tapping on any of the buttons try to display the name of the food that you are tapping on. So you are not yet passing to the next screen but you just display the name of the food and maybe try to create two arrays. One for the food names and one for the description and then try to display both. The name is this and the description is this. And while you are kind of going through the exercise there is a Swift programming guide. I think some of you are already referring. You can just display Apple. You can have it on the side to refer because sometimes when I am showing the assignment or the screen, the things that I am not talking about is kind of off the screen. You can go to this Swift language guide, search is on apple.com and you can go through different sections. It takes a lot of information. We won't be talking about a lot but things about arrays and all. You can find it in the collection types and you can see what are the different other methods and things are available there. So just keep it on the side for reference. If you have named your buttons properly, you can have the first button as the tag of the first button as geo. It will help you because the units of the arrays are the geo. If you have the first button style as one, then any kind of subtract one from the direction. I want you to see all the items here. There are two dials. I will stop the video for you. I have a question for you. What is the name of the tool? Is it the name of the tool? Fish. Fish from the... Fish from the tool. Fish from the tool. Fish from the tool. You use one? Yes. You just keep it on the side. Fish from the tool. Fish from the tool. You want to see what is the name of the tool? Fish from the tool. Really? Yes. This is your point. Why were I just really lost here? No, no, no. I think of the computer. I will do it later. I think of the computer. Okay, because it was correct. The name of the chicken is correct. I am not like the one time. I am not like the one time. I am not like the one time. I am not like the one time. I am not like that. Fish from the tool. Fish from the will. Fish from the tool. Fish from the electric. You don't want to forget? No. It is today that you threaten the owner. no, you are the owner? Yes. Mr. ... Mr. ... I'll put the playground, the court that I had with Eric, and how to access, it kind of helps you. Sometimes what is happening is, you accidentally, you are putting bad points, which is, what do you mean by bad points? So it's basically, if you tap somewhere on this side, anywhere here, so that means when a program is running, it will break at that point, and then it will tell you what are the values of your objects at that particular point. It helps you in debugging, but if you put it, and the way you can remove it is just click on it and drag to the center, it will be gone, or if you can just tap it again on top of that, it kind of gets disabled, but the best is just remove it if you don't want. Okay, I'll give you five more minutes to finish it, then we'll move to the next section. I'll give you five more minutes to finish it, then we'll move on to the next section. Okay, I'll give you five more minutes to finish it, then we'll move on to the next section. Okay, I'll give you five more minutes to finish it, then we'll move on to the next section. Okay, I'll give you five more minutes to finish it, then we'll move on to the next section. Okay, I'll give you five more minutes to finish it, then we'll move on to the next section. Okay, I'll give you five more minutes to finish it, then we'll move on to the next section. Okay, I'll give you five more minutes to finish it, then we'll move on to the next section. Okay, I'll give you five more minutes to finish it, then we'll move on to the next section. Okay, I'll give you five more minutes to finish it, then we'll move on to the next section. Okay, I'll give you five more minutes to finish it, then we'll move on to the next section. Okay, I'll give you five more minutes to finish it, then we'll move on to the next section. Okay, so let's move ahead. Okay, so there's another thing, can you get these images as an array also? You can, but you can also do something interesting with it. For me, what I have my image name is just by the food name. But you could have the image named as let's say food underscore the tag itself. Food underscore zero, food underscore one. If you know the image of the food, you can use the tag as part of the food also. So then you don't need to refer them as an array, but what I have here is I have a separate image array where I have the name of the images. So you could create that and then you can display the name of the image. And that is what we're going to do when we link it with the next skin because you need to pass this image to the next skin so that it can get displayed there, the name and the description. So anyway, let's move ahead with this thing called a dictionary. Now dictionary, they're also a kind of collection, but then you have a key and you have a value. And again, the thing with sweep is that the keys need to be of a particular type. Here my keys are strings and then the value here is integer, right? And which basically means that it is a dictionary which the key is a string and the value is an integer. Let's just jump into kind of the demo. So this is basically a dictionary of where the key is also a string and the value is also a string. And if I want to just print the particular thing, what I can do is I can do this and it is going to print the particular thing. But if you see there isn't this optional thing coming in, which again, you can just unwrap it using this. But this thing itself is very dangerous. You should never use it in your code. Although except the place where the compiler kind of adds it by default for you when you link the storyboard. The reason is it is, again, let's wait for that section. I think I have optional after a few slides. I'll tell you why it's going to crash the application if that value is not present. So I think we already did that. But what you can do with the existing app is because now you know about how to use a dictionary and how to face value from a dictionary. Instead of using two arrays, you can have one array where you have the key as the food name and the value as the description. So try that out. That's interesting. I think it works. Because it's a string, so you can have... Now the thing is that in your sample you have the index, right? How do you fetch a value by index from dictionary? The way you do it is you have this thing called keys, right? If you just print, let's say, keys, it's going to print the keys of... So here what you can do is you can get Maya dictionary keys, but this itself, it gives a different... The type of this is a different object. You need to convert it to an array first. So if I just don't put the index, what I get is if you just look the last part, right? Let me comment this out. It is only giving me an array of the keys. And if I don't just force it to be an array, then it is going to give me of this lazy map collection type, right? So you need to kind of convert it into an array and the way you will do it is just array and then... Whatever my dict.keys, right? And then the index will give you the key and you can use the key to get the value from the array. I think it's not in an ordered format. Because array gives the order proper, whereas dictionary is not in the proper order. That's the order. So I will give you the problem. But then you can use the food name as a key and instead of tag, you can look for the labels, title or something. This one is not in proper order, it will get some problems. Then you need to add an array. Instead of an array, you can use the array. Yeah, so this one is a tree. This is an array. This is an array. And if I want to have another name... So, okay. This is so old. there is another way though you can kind of let's say you want to extract some information the key itself can be your tag let's say right let's say assuming this is my full dictionary right the key itself is a tag whereas the value is a dictionary right so you can say I'll just take it to new line so that so now you don't need an index whereas your tag is basically you need to convert into a string but actually you can just use the tag like this also the key can be a number so you can just do so this is going to give you that particular dictionary and then you can you can you can have anything here also description something right so then you can refer to the tags and then display the name and description yeah let you try this for 10 minutes app you need to use this put in the app you need to use this put in the app we can't just okay let's take a 10-minute break then I will be starting at 230 yeah I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom, and I'm going to put it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. I'm just going to lock it in the bathroom. The next section that I have here is actually, I had loops in my slides, but I'm going to skip loops and come back to it later because what you are getting confused so far is, why this exclamation thing we are using in some place and what is really optional and I have been telling you I'll cover that later point of time. So let's see what is optional. We'll look into optional, then we'll come back to loops and some other parts. The thing is we didn't have concept of optionals in Objective C at all. So imagine you have a dictionary like this, and I think this is an example that I'm borrowing from the Apple videos. So it's a dictionary which tells how many legs a particular animal has. We have ant, snake and cheetah, but what about polar bear and leopard? Are we going to get some value? Let's say we want to use this in our code. Are you going to get male? Are you going to get some value? What are you going to get? Let's try it out actually. On the playground, I have this and if I do, it is going to give me obviously six. I'll get it here because I'm not printing it yet. But what am I going to get for this? It is male, right? And what if, you know, I... Another good example will be the previous place where we had the food dictionary, right? And we used to get the value at index 0 and 1 or 2, right? And it says, hey, this is optional and in order to use it, you need to kind of do this thing, the force unwrap, right? However, let's say I'm interested in finding what is the value of 3 because I don't know how many indexes are there. It is going to give me male, but if I do force, try to force unwrap something which is not present, it is going to press. And that is why I said it literally should not use this thing yourself explicitly. Although we have been using it so far, but also you have not to use it and what is the alternative. So basically, optional means that a particular variable or object can have some value or it may not have some value, which basically the value is optional. And it is up to you to decide how to build that particular object or value. So you basically specify the type as an optional. Let's see how to specify. So instead of, let's say I'm creating a constant here. If I do this, this is basically integer, right? It is going to give me an error, but hey, number of legs for, sorry, it is going to give me male. And the way I declare a constant or a variable as an optional is I'll put the type first, whatever the type is, and I put this question mark, which tells my compiler that it can have an integer value if it has value or it can be male, right? That's the whole point. And how do you get the value out of it? You check, hey, if it's male, then you put some, if it's just basic e-fails syntax in Swift. If you notice again, Swift e-fails doesn't have the brackets. The brackets are optional and we'll talk about e-fails later. But you check, basically, if it's male, if it's male, then you print a message or tell the user what's happening. And if it's not male, then basically extract the value by the force exclamation. So especially you have an additional check. But there is another way which is, let's say if it's not male, this is how you get the value. If it's not male, you are storing it in another constant and you are trying to print that constant. However, because I mentioned that you should never use this in your code. Initially in Swift, we started by this thing, which is e-flet, which is a special type of syntax. It does two things. First, it checks if the value is male or not. If it is not male, basically it does both the things, these two lines in the single line. It checks if the value is male or not. If it's not male, then it assigns it to lake count. And then I never had to use the force unwrap. So it will never crash. But this also has some issues. The primary issue was, let's say, if you want to check multiple values, how you check. We had this thing which you can nest, this e-flet. You have one condition that you want to check, put a comma, then you check another condition. But it got the syntax become really... There are so many things going on in the code. You can't really read the code properly. That is why we had this thing called guardlet. I'll tell about this also. But let's try it bit by bit. What we're trying to do is, the first thing is we check if it is present. It's basically not male. Then the option that I said is okay. So this is one way you can kind of do. And if it's, let's say, it's not going to print anything because this value is not present. If I change it to, let's say, and it's going to print this six value. And as I mentioned, we can combine them together. Let me keep it there and I can just write it below so that you can visualize them side by side. I don't need to unwrap this anymore. I can do like this. But let's say there is a complex dictionary. I'll show you again the previous example. I'll just comment this out and show you what is happening here. So this is a dictionary of dictionary, which is a good example actually. Unless I want to find the name from this food dictionary of a particular index. And now if you see, it tells that, hey, this is an optional dictionary, which means I need to unwrap here first. Then I get a dictionary, proper dictionary. Then I'm interested in finding the name of that particular dictionary. Then I just do name. But hey, this is also an optional. So to get the value, I need to unwrap it again. And if I have to do this thing this way, if let, how will I do it? Let's say I can say if let my dictionary is this and then I can say, food name is kind of nested them together by separating them. In those two conditions, you put them and then you print the food name, right? And it's going to print it properly. Makes sense? Now imagine this is a very simple dictionary just to kind of create it ourselves. And when you're dealing with complex applications, you can have objects of, objects of dictionaries, of dictionaries. And this thing can, you know, grow really big. You can have like this, this, it can grow really big, right? You get the point, right? It kind of can't really figure out by reading this what's happening. And that is why we, in Swift 2, they introduced this thing called guardlet. So this is basically, you write this statement and you evaluate it, my dictionary. And there is a else method. It's basically you have an option to exit from the code by putting return. Okay, it won't work because it's not inside a function. But I can show you in the app. So it's basically it will return and if this thing is successful, it's like if it's not nil, then it is going to execute the next line. So the way, although it will not work here, let me show you the way it will work or it will look for the previous example. So this is how, I cannot put inside a function, right? Just an empty function. And if I call this function, it's going to print. Now, the thing is that it is a little bit more code than what you would do here in the iflet. However, it is more reliable because it is only one thing you are doing at a time and it kind of helps you to exit early from the program rather than evaluating all those things, then finally nothing happens. It will exit early from the program and then save the program a little bit of time and it's more readable for developers also. So that is about optional and that is why we have been using the force unwrap. And now you know you could use this, guardlet or iflet and then directly use the variable name instead of kind of force unwrapping. Right? Okay. So with that, I will tell this another thing which is basically, because we are going to complete this app and we have like about one and a half hour remaining. I'm going to tell you about this concept called SegWage. So it's basically, first of all, what we did is we created a single view-based application. It just presents one view. You can't do beyond this one view. And what we want in the app is like at least two views, like one list view and one detail view. And the thing that you need for that is something called navigation controller, on the object panel. Just drag and drop the navigation controller here. The thing is the navigation controller by default comes with something called root view controller, which is what it displays when it loads. And by default, it is a table view. So when you drag, you'll get something like this. So you say, this thing is a table view. You don't need table view now. So what I'm going to do is, I select the table view and I'll delete it. If you see there is this arrow here. This arrow basically means, whenever the application starts, this is the first thing that it is going to load. Or this is the first, if I can click here, it's the initial view controller. I'm going to uncheck it here. There are two ways. I can just drag this arrow and put it here. Or I can uncheck it here and just click it for navigation controller. So I have an empty navigation controller now, but this navigation controller doesn't have anything to display yet. I'm going to change the size to whatever size I'm using here. And what I'm going to do is right click here and there is this thing called root view controller. The navigation controller displays its root view controller when it loads. The navigation controller is nothing but it displays the navigation bar and it will have a bunch of controllers. But the first thing that it shows is the root view controller. And because we deleted the table view, what I'm going to do is, I'm going to drag and drop to this one. With this, our application model have is, just with this, I did few things here and I went a little bit fast. So I have the navigation bar here. Now my application is able to display another view because previously it was just a single-view application. Now with this, my application is able to display another view, although I need to do some modification for that. But try this first. Modify your project so that it can have a navigation controller and it can load your existing view controller when it loads. And you should have this navigation bar here. To test it out, let's do one more thing. In your view controller, what you can do is, the viewDidLoad method which I mentioned is that it gets triggered when your view finishes loading. You can just do self.title and you put some name, let's call it MyApp. And with this, we'll have a navigation bar and we'll have a title on the navigation bar. So just try this. I didn't change anything in the code other than this title here yet. The only thing I modified is, I dragged a navigation controller. I deleted the table view. I changed the initial view controller and I linked it to this. There are a few things. Let's just try it out. What's happening here? The controller thing. The navigation controller. You need to get it to the main controller. This controller. How do I get it? Then I just ask the controller. Oh, how good? Oh, sorry. The uncheck is the entry point. So as I see, the level of dragging is, you know, that level that goes to the main controller. As I see, as I drag on, as I see, as I drag on, as I see, as I drag on, I see that the next video is the next video. So I'm going to go to the next video. Yeah, it's called, it's called, it's called, it's a very, very good video. It's really good video. Yeah, it's a very good video. Thank you. It doesn't look very pleasing in the back. It's just something that I'm saying. She was saying that although the meat is so tender it's just very tender. It's just very tender. It's very tender. It's very tender. It's just very tender. It's just very tender. It's just very tender. It's very tender. It's very tender. Very tender. I guess I will say it but I did it here. I made it here. It has a very tender meat. You have to cook these three on camera. It's very tender. It will taste much better. So, You need him to do the web-based, but yours was three months ago, so you need to meet him there and then... But it's all web-based. I think it's something like... Yeah, but this is online. What's your name? No, your own type. There's no cost, nothing. There's no cash. Oh, the cash is soft. It's not for the company. It's not for the company. It's not for the company. It's very, very fragile. Your own type? Oh, I see. But if you want to get a full stack, so they have statistics to show that most people, before they even complete the cost, they do get a job. Because they've learned more, even before they got a job. They've been pretty long used to selling out digital money, so I thought maybe they could get some sort of money. I believe for like, you guys have this wall. You can skip it still. It's your own target there. There isn't any... Because in order to get it, basically, once you can do the project for the company, you sort of figure out what you want to do. Also, do you want attention? You still don't realize how very good that is? They send you what they require, so you probably should email a client. I believe so. We'll have to wait until we need a stitch. We'll have to wait until they send it. Everything is very guided, right? They are complicated already there. On Github. Github actually means Github. You don't have to say anything. It's a cake cost. How much of a cake? 2,000 or 2,000. 2,000 or 2,000. I see, you're the restructure of this. Is it more because of the camera? I think you're the track of it. We did it. So it's more... I think it's more like... It's more like an additional part. So by the way, can you do it? Do you do it? Okay, okay. I thought you understood it by now. I don't feel that bad. We are the same. You can see I'm making him laugh. Okay. The last time you were here, did you just go stick with him? Yes, yes. Yes, yes. Who is the person that I asked you why do you like him? I don't know. I don't know. I haven't seen him in a while. Right now, too. That's true. I haven't seen him in a while. See, this... I think this is... It was a lot. It was a lot. It was a lot. It was a lot. It was a lot. I don't think about that. It was a lot of fun. It was a lot. I think it was a lot. Thank you. You're doing the same things. Yeah, we tried to take photos. I studied for a while. I was like, Joe, I'm just going to do this one. I'm just going to say everybody. It's hard to make them watch the dictionary. You can have them on the phone. It's hard to make them change. This is for real videos. Maybe for a few hours or so. This is really everything. Okay, quickly go through some of the other slides. Then I will show you something called Segway. Loops is another thing. We saw a few types of for loops, which is basically looking through the characters in a string. This is what we saw in the way we write for character. It's basically called for in loop. The way we write is for character in whatever string.characters. Each character gets assigned to the character variable. Then you print the character. There is this thing called range. Basically, there are two types of ranges. One is the triple dot. If you put triple dot, basically the range starts from one and ends at five. So it's a four number in one, triple dot five. Then it's going to run it five times, and you get the value in the number. And there is something. Okay, I think I am going to escape one. There is this thing, which is basically double dot with a less than symbol. So it's basically, it is going to run for four times. So you put the range from zero to four instead of zero to five. Let's try this thing in the playground and see how it works. From one to five, it just printed to the number. You can just put any other number if you want. Let's say you want 10 to 15. I have never tried the other way. Let's try that if it's going to work. No, it's not. But the point is 10 to 15, including 15. And if you want only until 14, then you just put the change the last dot to a less than symbol. Earlier it was just two dot, but in switch to the change it to make it more obvious and they put the less than symbol. And in arrays you can do four in with area values. And it is going to give the value of each element, tool name or whatever variable you have. And you can use however you want. Same thing with dictionary. In dictionary, however you look into this thing, this is something called tuple, which is there in many other languages. Tuple was there in Python, so you can use that. When you look through a dictionary, you basically have two things. One is the key and one is the value. The same thing you are using for in and you basically assign it to two variables instead of one. The first one is going to hold the key and the second one is going to hold the value. And then you can use it whatever way you want. So that is about four in. Then I'll just quickly go through some of the other things. If else, as you saw, many languages they have the brackets for if. Like you need to put the moon brackets, but in Swift you don't need. And if you have been noticing so far, you didn't need to put semicolons also for any of the statements, which is essential for things like Objective C or many other languages. So you have no semicolons. So this is optional. You don't need to put brackets. You can have nested if else. If this and else, if this and then else. Second thing is that another thing is a switch, which is really, really powerful in Swift compared to many other languages because other languages what they do is they only provide you this. It's basically you have your switching on a particular condition. You're switching on checking basically what is the lake count and if the lake count is zero, then you print this and you can put different cases or different conditions. If the lake count is one, you can do something or this will be a default value. Whereas in Swift, you can actually evaluate an expression in the case itself. So I'll show you. And you can also do things like you can have multiple cases together and do something for, let's say, for odd numbers you want to do something, for even numbers you want to do something. So the point is you can evaluate an expression in the case itself and Swift. So I'll let you try this, but the best way to kind of look into or quickly glance through this is the Swift programming guide again that I was showing. Just quickly go through the if and don't spend too much time and maybe just control flows. This is the foreign loop you have and you have the while. Don't spend too much time, but just look into the different options you have, especially in the switch, because you can do things like this and you can just try out the samples and see how it works. And then we can move to the next section, which is going to be interesting to kind of build the final part of our app. This one is just Google Swift programming guide and you just find the first link from Apple programming guide. And if you have iBooks, you can download on iBooks also and this comes as a iBook for the PDF version here. You know what this is all about? It goes not SWAT in there. It's a really big, really big SMR. You know when we get out of work, we get out of work. Okay, so moving ahead, you can try out some of the switch case examples at home, but what could have been more practical is, you know, you have a switch statement on the tag and based on the tag number, you do something for our example. But moving ahead, because you want to complete the app, let's see what you need to do. So I have this one and what I want to do is when I tap on this button, I want to go to another screen. And for that, I need to drag a view controller. I drag and drop the view controller. I change the size to iPhone 4.7. And I'm going to use this thing called Segway. Now Segway and iOS are ways how you can transition between two different screens or scenes, usually between two view controllers. And you can come from a button or a table view cell. So you can just click on the button and control drag to this view controller, right? And then it'll ask, hey, what type of Segway you want? I'm going to use push, which means when the second view controller comes in, it is going to push to the first one. So with this, let me just change the color so that we can see this happening. I can probably put an orange color here, right? And with this, if I just run, when I tap on this one, the second view is going to come. We haven't written any code. It's just going to come. But what our intention is to pass the value to the details view because we have the food items, the buttons which has information about the food. And we want to pass the image. We want to pass the name and description to the second view. Now, which is kind of a little troublesome if you have more buttons because you need to kind of drag and drop for all the buttons. And that is why this UI is not really the way you should build apps, but for understanding, you just need to do it for all the buttons you have. So now I have all the buttons linked to the... linked to my details view. So irrespective of which button I'm tapping, it is going to come to the details view. Now, I have a view controller in the storyboard for the detail view, whereas I need some code for that. And I don't have a class for it because the template that we created using a single viewer's application only created these two files, where we have a view controller.swift and the app delegate is for managing the state of the apps. And view controller refers to this file, whereas for this one, we need a separate controller. And the way you will create a new file, you just right-click and create a new file. Source use cocotouch class and make it a subclass of UI view controller. Let's name it DetailsViewController. And it is going to create a DetailsViewController class, which is what we are going to use for our DetailsViewController. But we need to link it. So you just click on this storyboard view controller. Go to the Identity Inspector, which is the third tab. And this is where you specify the class. And this is going to type DetailsViewController. So now my class and this file is linked. And whatever I want to do, if I open Assistant Editor, I can just drag and drop like how we used to do. And I'm going to put a label to start with. I have this label here. And I'm going to go to the Assistant Editor mode. Control drag to create a variable name for my label. I just call it FoodNameLabel. And this is the value that I need to change or I need to pass when I tap. I basically want to say pass the tag. So there is a method that gets triggered when you basically the transition happens. And this is the method which is prepare for segue. And this is where I need to pass the value to the DetailsViewController. I need another variable for a variable name to hold the string that I'm passing from my initial view. So I'll just call it, let's say, Variable FoodName. I'll make it as an optional string, which is basically it can have a value or it may not have a value. The way you will get the destinationViewController, is less, I call it, because this is the source. This is the viewController, which is the first string. And I'm interested in finding the destinationViewController. And you just do segue.destinationViewController. It is going to give you the destinationViewController. And it is not going to give you any properties unless you do this. So what I did here is I have a segue.destinationViewController. If I click here, control and click here, I can see this has type UIVController. My DetailsViewController is also type UIVController. But the name of this class is DetailsViewController. So I need to convert it to my specific ViewController class, so that I will have access to this value. Sorry, this food name variable that I have inside the class. So that is why I type pasted it to DetailsViewController like this. And I can do destinationViewController.foodName. I just put some number in a string. It passed the value, but what we need to do is we need to change the text of the label to foodName. And again you need to use iflet instead of the force unwapping. So let's do that. Godlet. Now it is going to print 12 for everything because that is the value we are passing. But try it out first. First of all you need to create a segue for one button first. See it is working fine, transitioning fine to the DetailsViewController. And after that create a segue for all the buttons that you have. Let's write it down the steps. What do you need to do? There are so many things that I just did. We need to break it down. Do it in four steps. And we have about one and a half hour. Actually about one hour to finish this. Then we will see some, you know, how to pass the values of the actual name and image in the next half an hour. So... At the end of this, we have to run one simulation to make sure it is happening properly. Without trying too much. So so it is fine. So if you have the last one, the latest text code, I think the first segue is replicated. You can choose so detail. So... Another thing, you know, just now I noticed that while you are creating a new file, while creating a new file, make sure the iOS source is selected. Because if you have like OSX source selected, you will have something else here. So it needs to be a subclass of Cocoa Touch, which is for iOS. Cocoa class is for OSX. Then... Then we will be back to the top. Remember, if you set the number, right? Or like label of my label. My label, detail of my controller. You know, how to measure. So basically, you are doing like this. You are doing like this. And then they just try to show off. Yeah, when you see that you know... It's the automation. It's automatically the... What's your name? Thank you. I think I will just say a bit about this class. I think it's very interesting. So now we just label what it will be. It's like, it will be a new file. So that will be... There. It will be a new file. So that means we need to copy the object into this file now. Otherwise it won't know what it will be. So if you see the label, it will be the actual string. It will be set to a new controller. Okay. It will be used as a string. And then pass on that to the class. But... Is it... Do we use the standard thing in this class? Sure, sure. Do you want me to ask you? Is that one of them? I'm looking to label... Or do you recommend the label? Or do you recommend the label? I don't know. I don't know. I don't know. I don't know. It's a nice size. It's a nice... So the whole thing... It's a nice... But it has the... It's... Okay. Ah. Is that one of them? I think... I don't know. I don't know. Yeah Do you mind if I ask, like, what sort of problems are we solving now? All right. I'll just dance a little bit. What's the name of it? Oh. Oh. Oh. Oh. Oh. Oh. Oh. This method, you don't need to kind of remember or type on your own. Actually all the delegate methods, you just need to know the name a little bit. You don't need to. So for, you'll just type segue and then see what are the other different methods on segue available. And then press enter to autocomplete. I see my story about this. It tells me what to do. Yes. So I think what you did is you just created a go-go class. This is what you control. That's the first thing you should do it. Because I saw you want to do it. You need to select a new file, right? Yeah. You need to select a go-go class, which is part of OSX. Which is like for Mac. You need to select iOS source and then go-go does class. Okay. So let's delete this one. I think I can do it. No good crash. So how do I connect it? Go to file and go touch class. And the details we control. And then because you have few more options here, you can put the previous one. And just copy the class name. Go to your details we control. Select this, right? Select this. Expand the utility section. And go to the third tab, which is for identity inspector. So this is where you can specify the class of this file. So you need to select on the yellow thing, right? On the details you can select the yellow thing. And then now it is linked. This class is linked with the... Then you need to kind of put the label and then connect. How do I edit the code for this detail? Well, you have this one right? Oh. So you select this again. And then go to this mode. And then it should actually automatically appear. But you can just choose. Okay, then I put the label. Okay. Yes. Here, if we take a break, while you're doing this, we're going to continue this for our next 15 minutes or so. Then we'll see what else we need to do. Okay. There's only people. This is so furious. You're about to do it. This is just for you. I want to change how much you put in. Okay. Now I'm going to switch it off. You can switch it off. Yes. Okay, let me see. Should be that many? It should be that the flash also automatically. That's the first one. It's like this, right? It's like the floating body. Okay. Okay. I don't know why you're talking about eye and kind. I'm kissing you. Now that it's like 5x5x5x5. You never talk to each other. Yeah, this is the beginning. In total, it's something that's really extraordinary. Oh, it's like a texture. It's like a texture. Okay. This is a view control switch. Open the view control switch. There you go. You've got this on your sheet. That's why people want to switch it off. How does it work? Anybody? Anybody? Anybody? Okay. Of course, because I knew that I knew people was something that I was passionate about. I knew people. Oh. People will hear me say it as well. So, just now my mind was in a different place. I could believe anything. Put them side by side so that because some of you need to refer the first one and some of you need to refer the second one. So this one is the view controller here and the right end side is the details view controller. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. So this is the view controller here and the right end side is the view controller here. screen. Again, you should convert into or use E-flat or guard instead of force and wrapping and this is basically the index. Once you have the index, you can pass the actual food name or the description to the next screen and you can also pass the image and then display the image. So just try that out and that would be basically the end of the app. I can show you the actual app code that I have here. So I have this here and let me show the details view controller also on the side. So for the image I have an image view on the detail view controller and I am using this method to display the image. And I am going to share this code with you. And the slide along with all the sample apps. But give me a day or two because I need to kind of polish those. But what's next? You know what are you going to do next? We don't have anything else for today's class. But as I mentioned we started this thinking about the SWIP study group in mind. So there is a SWIP study group that you can join on Facebook if you want to. So the idea behind this group is that we'll have another lesson next Saturday right on 18th and I'll send you a link to register. But what we'll do in that lesson is we will polish this app. We won't use this structure as I was mentioning. The way we did with buttons is kind of really not the recommended way. You should use the table view or collection view to do it. So you will do that. We will try and see if we can use some of the API and web services. So instead of kind of using it or picking it from the hard coded array we actually use the value from somewhere right. So we'll do that. And then we will in today's lesson I didn't touch a lot on methods or closures in SWIP which are really kind of useful features in SWIP. We didn't look much into class and methods and like we didn't pass any parameters or we didn't create any of our custom methods. So we will do that. But so this is the study group. SWIP study group. And then you kind of join this group if you want to learn more about what is happening. But after we finish these two lessons what we're going to do is you need to identify a group. We initially formed groups but I think then some people came and some people didn't come. So you need to form a group of kind of you can do it in the next class depending on who is coming. You can form a group of four to five people and think about an app that your group wants to build. Then we can then the study group can be a forum for discussion about your challenges and then they can help you building the actual app that you can put on App Store. So that's where you can lead. And part again I'm going to share some of the references also but there is this video SWIP introduction video. I kind of use a lot of materials from the slide but this is from 2014 and a lot of syntax has changed. But if you go to introduction to SWIP you can watch this video which is about an hour long video and you can kind of brush up or recap a lot of the things that we discussed today. And I'll say some more links but there are more and more kind of resources that you kind of need to go through if you are serious about learning SWIP programming or iOS programming. But next class we will improve this application and use some of the advanced and intermediate features. So officially this was the end of today's lesson but if you want to hang around for half an hour or so to complete the app and you're still stuck then feel free and we'll help you out. Thank you all for coming today.