Create a machine learning iOS app with SwiftUI as a beginner! | Aaditya Singh | Skillshare

Playback Speed


1.0x


  • 0.5x
  • 0.75x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 1.75x
  • 2x

Create a machine learning iOS app with SwiftUI as a beginner!

teacher avatar Aaditya Singh, IOS Dev, Digital Artist

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

    • 1.

      Introduction

      1:23

    • 2.

      First Step

      4:55

    • 3.

      Finding the right dataset for our ML model

      2:53

    • 4.

      Building the basic project

      1:39

    • 5.

      Adding important properties to our app

      10:10

    • 6.

      Creating Our Picker View

      2:18

    • 7.

      Populating our screen with more views

      3:05

    • 8.

      Finishing up all the UI components of our app

      4:37

    • 9.

      Integrating the ml model in our app

      3:41

    • 10.

      Learning about Alerts in Swift

      4:01

    • 11.

      Finishing up our App

      4:53

    • 12.

      Testing out our app

      3:23

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

72

Students

1

Projects

About This Class

This class will teach you how to make a second-hand car price prediction application that uses machine learning to determine its output, you will learn about lots of different things and strategies inside SwiftUI while making this app

Meet Your Teacher

Teacher Profile Image

Aaditya Singh

IOS Dev, Digital Artist

Teacher
Level: All Levels

Class Ratings

Expectations Met?
    Exceeded!
  • 0%
  • Yes
  • 0%
  • Somewhat
  • 0%
  • Not really
  • 0%

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Introduction : Have you always taught of creating your own application, but in Utah leg, how you should start and where to start from, then this course is exactly for you. I would teach you how you can create an iOS application. We will make use of machine learning to predict US prices for the secondhand cars. And for this purpose, I will show you everything like how to structure your application. It should be a one new app or a CIO contain multiple views. Then we would search on the web to find the right dataset from which we would bring our Machine Learning model. Now I will show you how easy it is to create a machine learning model inside of Xcode itself using open Developer Tools. Lastly, we will just desktop application with corresponding data to see if we have actually accomplished what we started for. Hi, I'm your instructor for this course. My name is Rebecca and I do development. I also make some digital art side-by-side. So I would be like teaching you everything in this class. And if we would be using this laptop only, and this is the Mac with Xcode installed. So yes, that's all you basically need to continue with this class. So see you in the class. 2. First Step: Okay, So welcome to this course where we would turn your idea into an actual iOS application. So we would be using machine learning for this specific project, which I'm going to show you. And I will tell you that how the idea came into my mind. So I saw a lot of websites which are selling like used cars, right? And it's a huge business. So they were just selling cars at like some specified prices, which I think like it could be varying form the different two different websites. So I taught off like using the patch sales records of any of these website. I actually just Googled it out, which I will show you in the next video at this website. And it contains dataset for training your machine learning models. So essentially I just picked one out from here and then I use it inside, create ML to make ML model. So the next thing that I want to tell you all is that let me just create a blank sheet first. Should be easy for us to understand. Yeah. So the next thing that challenge I faced was like, I don't really know everything about iOS development. And that's, oh, okay. Like you don't really need to know all the APIs and stuff in order to create an application. There's always a way out with everything. Also, I wanted to focus only on our one view and a simple application. So yeah, I don't really know how data is being shared. I'm just seeing this as a business point of view, like if you don't really know how data is being shared between different views, than what you can do is just create one view web. Yeah. And yeah, so in that specific view, it would contain everything like the Berlin for the calculation. Then there would be sliders, there would be because step or whatever you want to include, I would go into much more detail in the next videos, like how you use them and like you read and write two values from them. And then how you integrate your machine learning model into that. So you get an output which is like really calculate it and it actually works. So the very first thing, Dad, when the idea of creating an app came to my mind, was this only like the car reselling thing? So I taught all this that I would have. And this is like how you should approach your projects as you should first draw it out like an, a really rough way so you know what you are going to do. So we just create this interface type thing and then you have it in your mind that you would have like selections. Suppose this would be for the models. Then there would be selection for depending on your dataset to like, it should be an automatic or manual transmission car or a semi-automatic car. And there will be a slider for mileage. These are simple things that come into your mind when you go through what I get that I had in mind, which was about Cardi selling price detection. So as exactly I taught that I would learn about all of this. So first thing was that I just searched on the web and I found some really great free resources and like tensile website and don't really want to pick out one, because I actually used apples in Developer Forum itself as well. So there are a couple of websites which comes on the Faustina results are actually really helpful most of the time. So you wouldn't be able to get an answer to your question that you have in mind. So this is how you approach like creating an application. First of all, like you would specifically search for each and every component. I do think you don't know really well. So just searched this thing of like how do I create a picker, how do I create stepper? And then you just go about searching like, how should I integrate my ML model window value that I have in my application? This is one Google search that you should do. And essentially, I did all this and this is how I came to the idea of creating this application and I finally did it. So in the next video we will start by looking for the dataset and then we will train our ML model. And afterwards we would use it inside our application in the affordable videos. So I really hope that you will learn a lot of things with this video. So you should continue with this class. 3. Finding the right dataset for our ML model: Okay, so the very first thing that you need to do is to like search on Google for that dataset you are looking for. And in my case, I'm looking for the used RD car dataset. So the very first result, I decided to go with it. There I am led to this page. And like he really has a lot of information about all the coding needed to create his application. But we really need just CSV file. And there you go. You have it right here. And he, there are a lot of CSV files for all the different models, but we don't really need those. So let's just download this one. Cause we are mainly focusing on RD models only, like saw when we are done with this much less just open Xcode. Yeah, so you just have to move your cursor on the top. And under open developer tool, you would select create ML. Now I'm going to show you how easy it is to actually create a machine learning model. You just have to select a location and click on new document there to select Table regression. And then click on Next. Let's just give it a name that you might find Like relevant. And you can give it a description as well, but it's completely fine if you don't know, just click on Next after you are done with it this much. So here we are presented with this type of interface. Now we just take our file and drag it in the training data idea. Now you would ask us to select a target. Target is the thing that the model good identify and the features is what it would like used for identifying the target. So we're selecting four of these. And No.3, which are like tags and stuff. We just left it for now. Afterwards you are done. You just have to click on green, which is like yeah, up. That would just take few seconds and it's done. So once it's done, you can see the root mean squared error is like $4 thousand and that's quite okay. Now you just have your model ready. You can just click on get and it would ask you for a location where it would save it. So you can just name it whatever you want. And just select a location for where you want to save that thing. And just click on save. And there you go, you have your machine-learning models 3D. And in the next classes we are going to like dive deep into creating our application and then we will use this model ultimately. 4. Building the basic project: So now we will be creating our application. So it's a really simple lag iOS and then you give it a name for the lifecycle select Swift UI app. And you don't really need to check any boxes. You'll just click on Next and it will ask you, where do you want to save your application? And you can just select any location of your own choice and then just click on Create. And then Xcode will give you this basic layout. So first thing you need to do is like a changed as humiliated, I'm using iOS, iPhone 11 simulator for this. You could use any, It's totally up to you. So this is our first basic step. Now once it loads up, you just need to like take your model that you have just cleared it and you will drag it inside your project. And it would ask you some things and make sure that those are checked. You just click on Okay, risky. And now you have your model inside your application. So once you are done with this much, you could just go here and check some details about it. And inside prediction you can say it gives out an output as a prize, which is often be David double and it takes around leg four different parameters. Some of demonstrating and some of them are double. We will deal with demoed in their next videos. 5. Adding important properties to our app: So now we will start building our application. So the first thing is that let's just check out that CSV file that we have used to create our machine learning model. And I accidentally opened a different file. So now let's just opening down main file. Yeah. So you can see that it has a string type in the model. And also we can check that out here resident. So we need to create for the option that we would give our user. We would have exact names as given in the CSV file like manual with the M capital and automatic with a capital and stuff and exact spelling of the petrol and diesel fuel type. Because if we just messed up there, then the model would not be able to calculate the price. So for that, we have to create a lot of data in order to create our pickers and steps as well. For the mileage, we are going to use a stepper. So let's first start by creating an instance for our machine learning model. So our machine learning model name is Adi car. And you just, this is how you create an instance. Now you could use the properties inside present inside this class, which is our ML model, and use it inside our structure. Now, we would create the basic structure for our use that we are going to show to the user. So one of the views would be because in segmented style, you would get a hold of it When I'm actually going to show the UI part. So for now lets us write down the different model names that we need to use that a user would select between and those will act as an input eventually. So these are Dao model names which I'm using for this purpose. Like data are quite a lot of models actually. But it hurt that instead of like including every single one of them, it would be better if I include just the main ones which like had most of the sales inside that file. So it would be better, more efficient, I would say. So now that we have done this for DA model name, then we would proceed with doing the same thing for the transmission type, the fuel type. And also what the year of manufacture. These three things we will also add. And it would be an a for creating the views that we have in mind. Also, one thing is that this notice that while I'm writing those names, these names like petrol and diesel, I just wrote. Then I would go back to the CSV file and look for it. Like, have I written the right name or so? And I'm actually starting out with 2013 models. So let's just first make sure if our file actually has a 2013 model in here. So we can easily do that using Command F in these files. So yeah, there you go. This is 2013 available and we can go till about like 2020, I guess. I just checked it beforehand as well. So yeah. We can go about al 2020. So we would have to include all these years. It's about seven years, I suppose. So this is my personal preference actually. And I tamed that are creating the application display like creating static arrays. And then using them as picker in segmented form is better than using the usual, traditional picker. So this is a bit of personalization you are giving to your application. And when we will be moving more into our Part 2, you will see how I structured this whole thing to look more and really simple, yet powerful way. Now since we have done this much, Let's just move on to the UI partner. So for that, like actually just delete our present quote. We don't really need it. And I was thinking of using a specific image I had already downloaded beforehand. So for that purpose, we are using a stack. As you all know, that stack actually are ingesting a zed axis. So I will just paste the image first. And this is the image and, and I've just given it a simple name as well. So I really like this color and I was trained to use this color directly from the color property, but I was not really getting it. So to make things easier, I'm just importing the image from the assets folder. And it's quite easy, you just have to give it to modifiers and one would be resizable, then ignoring safe area. And it does the job as you will see for yourself too. So let's just do this thing and just see how does it look like. All right, so it looks fine. So for now that we have done this much, Let's just go on about creating some liberals, like just above. Because I'm thinking of like giving it a name. So it makes, it makes sense what a user to, as to what the app is actually asking for. So we're going to use the simple text property. And under that, let's just start with the model name. So let us write model and we would give it some of the modifiers that I feel like are really, really good, like important. So one would be font-weight and let's just give it light. Let's give it a different type of Feel. Do a Drake. So for that purpose, I am using the font weight as light. And then we would use the font style as title. And obviously, just thinking of giving it an ultralight font, Vietnam. I think both are. Okay. It's totally up to you Actually it there. This is where the personalization comes in. I personally feel like the ultralight gives it a mode and a different approach, like not really, a lot of apps use texts in this time. Now that you have done this much less as give it some color. So we would call it black. And I feel like it's really okay. And then let's just give it some theme also. Actually, this was an optional thing for me because I thought I would use the alignment property inside of frame and just align the whole thing Buddha left-hand side. But dad didn't work out. Ultimately, I had to use a spacer inside of a snack. If you don't know what a species is, whenever you put a spacer inside a stack and just takes up all the space. For example, if you like, put it inside an edge jagged after some things. So it would take up all that right-hand space and just push W towards the left. So this is essentially how spacers work. Similarly, if we were to use a spacer inside of estab, then it will just push the things aboard. Most upward area on the downwards area, depending on where you put it. Before W or after the view. So yeah, I think that all of the texting would go on to the left-hand side. And this point, it's actually appearing right in the middle of the application, the beach. And I don't really think it's good, but we would work on that as well. Ultimately, when we will start building more and more of the view, it would come right into fit right into the place. So we don't really need to worry about that for now. And you can just fold it out so that it looks more compact and you understand what all is going on. So now before creating bigger, we actually had to create our state properties. And because of its state properties that beaker won't actually function. We will be using two-way bindings with our state properties to actually read and write data values, which will be further using inside our integrating our ML model output. So it would make a lot more sense in the next two or three videos. But for now, let's just create a state property for each of these eddies that we have created. So obviously the toughest one would go about for the name. So let's just name it simply like names election. And it would hold an integer value. And you all know that integer value corresponds to a position inside the Adi. So for example, if we are giving it a name selection and integer value of one, that means inside the modern name, if we were to use this specific state property with the ammonium, then the one is the E3 modern. And similarly like that, it wouldn't make much more sense when we start writing the code for the picker. But for now, all we need to do is to just clear those steered properties that we will be using further. So we have done three and we're just don't do one more. And once we are done with it, it's actually quite a big names who I talked of like giving it a more compact small name. So I just deleted half of the selection would make sense, I guess. Now we will be moving on to much more things in the next lesson. And how we will be using state properties outright to attach. And they do after this. 6. Creating Our Picker View: Since we have finished making our state properties, so now we can actually use pig. So the syntax order, because it's actually quite simple. You just give it a name in the name as a battery meter you could say. And you separated with a comma and then you give it a selection pedometer. So for the selection better meter, you actually use one of our state properties. And you would see that we are using a dollar sign just before the name, which ensures that there's a two-way binding, which means that it does not just read the value but also write it back. So if we were to change the selected item to be told three, then the name selection would point to value three. And that ultimately, since we are using the modern name, any insider for each loop, which the speaker would show the items from. So it would point to the third item. The fourth item inside a model is numerically same. So you know that areas start from 0 to 0, 1, 2, 3. Then u. This is how essentially you make a beaker. You are looping inside and Eddie, As and displaying its values inside a text label. And then now that we have done this much, we should also give it a segmented style dude up bigger segment HDL is essentially like a horizontal stack of options. And it looks much more presentable. So let's just do it. There's also a modified for it and it's quite easy to do actually. And just write segmented because time. And that's about it. And just give it its own bracket, I guess. Yeah. Now that we have done this much, it essentially means that our picker will show up. So let's just resume our preview area. And we will see that how does it all look like? So we would get an idea about it. Yeah, there you go. So this is essentially how it looks and we can just check it out as well if it's working or not working. So every time we just change the selection, the value of selection also changes due to two-way binding. And we point to data object in diarrhea. 7. Populating our screen with more views: All right, Since we have created the picker view for the model type, so we can just accordingly copy based discord to create the pick of you for the rest of the things as well, which actually need. For example, for mileage, we are going to actually use stepper. So it doesn't really make sense to use because you there. But for the rest of them, we actually need to use this selection style. So now that we have done this much less as for listing out things, it's complete, but for the others, we have to do some minor changes and that just makes them different. So I'm just separating out and doors because you were to one another. So I'm using this mark property. It's essentially youth or this only it just comment out and like separates that code at different stages inside our application. So I just named this first, it refers to a first pick of u, v hat. So now we would change it to fuel type now. And when we do that, we have to change the added at it is a for each loop is running as when we are essentially changing everything inside it actually. And also that our two-way binding, we are using names election there. But we are going to use the fuel selection for this particular one actually. So let's just get going and we will do the similar thing for that transmission also and also for the year by year of manufacture. So let us get going with this. This process doesn't really require much of some different knowledge and just we are putting in different values in place of the things that we had earlier for the very first. Because now that we created. So that's why I'm speeding things up for justice. But since it's quite simple to understand and you could use your own thinking for this, like what tax you need to display hair. It's not really an obligation that you should use the same text that I'm using. Even you could experiment with Dar, selection, our type you are trying to give the user. Maybe you could use text fields to take in input from the user. Or maybe step out if you were to use some things such as Iraq manufacturer on mileage or something. So for now for making the whole thing comes back down, just folding things out so as to understand that how far we are inside our code. So now that we have earned done this much, Let's just mark this thing as rent. And so as we will proceed, we would add the rest of the components which are missing our trauma application. So let us create a new stack that is important in creating this is actually a UI views can contain a maximum of 10 views, only saw we are creating another, we use Dagens out or reception. We can accommodate all w's. 8. Finishing up all the UI components of our app: Okay, so let's just continue building our application. So the very first thing I did was like write down Aspasia just in case like, yeah, everything is now pushed to abort area and we obviously need one more edge stack and bigger combo because you need that added for the year of manufacture. So I just quickly copied one of these and now I will paste it here, and accordingly I will change it again. So phone detects every would have to write here instead. And inside those values are to be binding world, come here, selection. And then inside the area which the foreach loop is going through, it would use edited we created as yard or whatever you have named. It is not an obligation to use specific names on them only. It's completely up to you actually. So let's just get going with it. Now that we have done this much, we need to create another edge stack. And this time I'm not trying to copy the entire thing out because obviously this at stack would be used for the mileage property. The mileage we are not going to use any bigger. We are going to use a step. I think it's not called as Deborah afterall. It's called a slider. My mistake. Yeah, So for that purpose we are just quickly using the modifiers for the text as it does in belting. But now we would create a slider for our use. But there's one thing that I missed out on while creating those state private properties. I actually forgot to mention one for mileage, which would be of the type double as obviously. So yeah, so we need to just go back to change that font. I have done. As you can see, I'm trying to like code this thing out, but obviously I don't have it. So I will just quickly add that property now since I see that. Yeah, it's not there. It sometimes happens that you forget about 1000. One needed to be there. So obviously I'm just copying this thing out and I would quickly just change it into mileage. And we will give it a type double sense if we just eroded equal to 0 or we can write 0 as well. Dad would also indicate that it's a property of the type double. So now that we are then written this much, we can just go back to our slider and now it works perfectly fine. So now we have to give a range to us later. This is how sliders and work. And if you don't really know how sliders work, you could just Google things out as well as I also did by creating this thing. Actually, I don't really remember the exact syntax for stop. So like everyone does distinct. So I just Googled it out and it actually came really handy and someone just posted about it. So I just copied that syntax from there. And now I'm using those properties that I mentioned to you as well. So I'm making this a text view as a separate view as well, which would display what does slider sliders value is at. And making sure that I'm not using two-way binding here and it's just mileage, not return dollar saying since the text move on, change anything in just there to like, sit there and show what miles we have selected inside our mileage slider. So it's quite simple and we're just giving it some simple properties. Basically. Let what should be its color than they would be a font weight and font-style. So just to match the whole team of the application that we have been building up. So now here we have our returns and you can see that those beakers working perfectly fine. So recorded, right? Things actually. So I don't know what was wrong with the preview might be some bug issue or whatever, my laptop's performance issue, but our app works fine for now. So let's just get going. 9. Integrating the ml model in our app: Now that we have done the UI part for our application, here comes to a really important part, which is like creating the function that would actually contained a call for using our machine learning model, which then would provide the daughter like the output for our app, like what it really does. It all depends on that function's output that it gives out. So I'm just going to show you how easy it is to use those machine-learning model. So let's just give it a name. We can just name it anything. I'm just naming it. Calculated price. It's totally up to you like what to name it. And we are creating this function inside our structure and make sure on that. But outside our body property, sinc functions don't adopt though, don't conform to the protocol. So we're doing this inside a do catch block. So let's create constant with the same name as our ML model. And I'm telling you this is important and you just have to attach this thing as well, output. Now, now that you have done this much, now we would write this method which is dry model.predict, which has, which is kind of a structure since it has an initializer of its own. And it's asking us to write down the different values. So like since it's in that string, so we can just use string and inside bracket, we can give out the state property names that we have used, which actually refers to the value. As I may have told you like, since we are using two-way binding. So when we look, select anything inside, the bigger, the value of that state property actually changes toward, is selected inside the beaker, inside our U wave, u and w stores the actual property. So that is why we are using those values inside of this method. Dollar value calculating for this constant. Now, Swift is throwing us and edit and seeing that you are not using a catch block. So obviously let us fix that issue as well. It's not really something even if you leave the gas block completely, MD, it's still fine, like it still works. But we will short add some code in there as well. But for now let's just clear the blog and like we would do something about it. So we can just leave a comment like we will come back to it later or something else. So I hope you understand that how this do let the ADI guard output constant is working. It's actually using that prediction capability of our modern. And then it's taking in inputs that we have created just now using those state properties. And the properties change as the user interacts with our application, it select different options. Then those state properties Gibbs on storing those things. And now we just created a new constant which is of the name price, which actually you saw that when I was writing this code, Swift automatically suggested me the price component from this body output, a constant. That means it holds the value of our output. So now the output is inside the price. We need to find a way to how to show it inside our application that we will do in the next lesson. 10. Learning about Alerts in Swift: So since we have our output stored in this price property, let's just find a way to show it inside of our application. What I'm thinking is that we would use a button which will then lead to an alert wing up. So for that alert, we are actually going to use three new state properties. Yes, three new state properties because they are actually required. I just accidentally removed our Canvas from the mutual. I'm just quickly figuring out that how to correct that thing, demonstrate that I just did. But for dad, while I'm just telling you that For alert, we actually need three properties. And why is that? Because first one would be a Boolean which would like store render the alert is shown or not. I would tell you in more detail like how does it all work? Then there would be an alert title and an alert message sends alert a contains three components. There's a title, then there's a small message, and there's our dismissed burden, which are normally consists of okay. You could actually write any text here, but we generally right. Okay. So her property would be obviously a Boolean as a toluene, which would be used for whether they alert is being shown or not. Show you how easy it is to create analog. So now let's go back to our function and we would just fill in the gaps that we had left from the previous video, which would be about like, yes, we finally found our output, which is inside price. Then what do we do now? So we would change the value of alert message and alert title to this thing. So hold is all inside the string, obviously, since it accepts strings only. And now we would write value, which would be price. And since the price would be in US dollars, when thinking of adding a dollar sign as well. The reason why I did this, why I adapted inside and in disease because price is our double properties. So it would have a lot of decimal places after the actual price. So to round things off, I wrapped it inside the integer value actually. And now we are giving the alert title some texts is totally up to you, like what you would really like to do about this. Here you can get creative and write something really different about some others or whatever you want, maybe you can just leave it blank as well. And inside a catch, Let's just add some things. If things go wrong, what you should display. So yeah, we will display like edit obviously, and then we would use something like there was a problem in displaying the price of the card you asked for or something like that. And that essentially some setup. And now let's add the rest of the stuff. So we have got some things to do. Inside that. We stack the secondary standard nucleating. We have to add some spacer renting because you can see that year of manufacture and between the transmission time, there's a lot of gap, unusual gap. I don't know for what reason actually, but it's there for giving specific size spaces. You could use the frame property. And now, just when I resumed this thing, it's going to be showing me the updated view, which I think is going to work out. And there you go, it now looks better. So in the next video, we're going to add more functionality into our application. 11. Finishing up our App: Now we're going about creating the button. So there's actually like 23 different ways in which you can create a burden. But for this specific purpose, we are using this one. So in the first closure, we would actually write the action it performs. So just calling the function here the calculated brands, which actually does all the major part. When it's called. It actually does the whole thing of assigning the value of price to alert, title and everything. And it also sets the value of showing alert to brew. And now we are going to design the UI for our button, the label inside this closure, we are actually going to write all the things that are important. How should it look like? So let's just create it like a normal button. We would just name it, calculate then let's give it some our foreground color. And I was thinking that I should give it a foreground color of maybe black or green, whatever. Adding any is like anything is fine. It's totally up to your choice and how you want to create it. You could either use a image as well as a button. And that's quite interesting. You could just use some designer and designing app. Suppose you use Illustrator to design that button and then you just import it and use it. So you could have tons of creativity with making art UI really look good. So now I'm just giving up some simple values for this button. And let's just give it some padding as well. And we need to give it some foreground background color as well. It looks really kind of shallow. So for giving background color, we used a background modifier then inside of which we will use color dot or y. I think you could give it any color you like. It's totally up to the combination and stuff. And finally, to make it look like a button, we would give it a clip shape of capsule, which actually most of the burdens in this modern era abs are lexically. You design that only as you can see anywhere. It's totally like that are either you could create a rounded rectangle as well, which gives you more freedom of 2S2, How wide and like how much it only due on top corners to be. So could just experiment with that as well. And you can get really creative and like have a really different UI. Now we're just attaching that alert view at the bottom of our button. And it's inside the second we stack and at the bottom of our button. And to be very honest, it doesn't really matter as long as the alert rule is inside the body property, you can just attach it to any of the SEC. I could actually attach it to the final Zen stack as well. The main thing is that we set the showing alert property to true when the button was tapped here in our topmost level, that two lines that we wrote for us is calling the function, which essentially just determines the price value. Machine learning model runs and it stores its final outward inside this price constant. And then we assign the alert title to this value that we get from the machine learning model. And now it's just simple syntax for alert. So here it has a two-way binding obviously because we will be using and dismiss modelling. So when we tap on the dismissed, but then it just toggles showing alert property which is a Boolean and set it to false. And when it set to false, that means they're loud can't be shown and it dismisses actually, it's really that simple. So now we are just writing down stuff. And I think I actually forgot to write text before the alert title that I just wrote. And I will come back to change it as well. And now in the next video, I'm going to show you that practical use for it. We would actually pull out that CSV file and then match W from it. And if it's actually able to predict that thing or not. And we would be able to get a better understanding that if it really works or not. So for now unless majors and let me just correct this error that I cause. And yes, our app is completely done for now. 12. Testing out our app: So yes, we're finally done with high obligation. So let us open up dad CSV file as well. And you could actually use a lever for this purpose as well. We're just testing out app out. So there I'm just going to select one of those random values from here, the file. And we would just check if it's actually working on nor Sulla just create this using the 2019 Audi A3 Model, which is actually a manual transmission, petrol, petrol fuel fuel type. And then the year of manufacture or something. And there's the mileage around 1980 something I guess at a selected 1946 because it was going beyond that. Afterwards. You off manufacturer is actually 2019. Could see the price for it is given a hair at $17,500, I guess. So our model suggests know it. Yeah, so $17,900 and our model to the 17 donor and $539. So it's quite accurate, I would say for this case specifically. So a yard, this is Davos for the model. It just goes through everything and then it selects out what would be idle price according to FDI data that it caught. And one thing that you should keep in mind is that this dataset included three more values actually, and I didn't include them when creating the model. So that is why the price is not exactly what is inside a CSV file. As to someone wondering that weekly, use this same dataset for creating this model, then how come it's not working? And I were thinking that looks kind of plain. So I just sort of like giving it and closing everything inside a navigation view and I will just simply give it a title. So it would look better. But I didn't know that. It doesn't really look that way. That could I mean, you will come to know what I mean to say now, I'm just going on about adding a navigation bar title and I just mess things up. I taught that instead of doing all this, I could just important one more invasive, which would include some interesting formed with my app name. Let's name this app, create my RD or something like that. And this sounds cool actually. So we can just add, I trade my Audi using Adobe Illustrator or Photoshop in a really fancy way. And then we could just import that image at the top of the stack. And you can do spacers to space things out. And I feel like we still got a little bit of space between that Calculate button n miles, a slider, we can just push things down. Word you can say just messed up. So I felt like vision naughty. Use the navigation view after all. So I'm really tenfold for each one of you who are taking this class. And like, I hope you learned a lot and in the future I would come up with more videos, which would be two more things. So it would be really great if you just leave a review and I will see you in my next class. Again. Thanks a lot.