Good to hear, I'll let some.
Okay, I'll start recording and then we can get going here.
Okay Good morning everyone.
Let's get started.
So I just following up with what's going on the chat, you know.
You know,
that's all.
That's what group is talking about.
But in terms of what let's in terms of topics and what I want to discuss today is, of course, today we're going over tutorial to, which is posted now.
But before I start talking about or even before I start talking about specific material there's some definite things I want to address.
First off,
so it doesn't bother me.
How to Succeed in this class.
So that's what I want to talk about
succeed in computer science because there are some questions about that.
So if you were feeling a bit overwhelmed after last week.
And
yeah that's that's the main things I want to discuss so.
Oh, the new project that. Okay, good to hear. Okay.
Where can you find the record lectures for this class, uh, did you look at the wiki.
Let's just there was a question Where are the recordings for this class, I mean, let's just still early on so we're here.
And you know, you go here and it says here and I'll says I'm bright space.
You know, here. So I'm.
Yeah, this is the main class page. This is where the stuff is so.
And speaking of which, here's tutorial, too.
So that's why. So this does is that so.
So
the first thing I have to acknowledge is you.
So you should use internet resources, feel free to search away.
So this is the first thing I really have to emphasize I see this, even in later years in undergrads is that you can use online resources, I encourage you to use online resources, you have to I have to, that's just the world we live in right now i mean
you need, and I can explain why that is it a bit, but.
But that's not enough, you.
If you get your code working great. But that's just the start. You have to understand why it works.
You can, you know, do that is official documentation the reasons you should always consult first. No, it's not. And so,
so.
so the ultimate truth in software is always the code.
That's what determines whether what something is wrong is it and documentation is always incomplete and know lot of times it's just flat out wrong.
So, this is how you have to figure things out. Use whatever documentation, you can realize the documentation is incomplete. You know it's often wrong.
So we're talking about your system that's being actively developed, not traditional I might have been right when it was written maybe an article or blog post, whatever it might have been right what is creative that doesn't mean it works today.
And you deal with commercialism, you don't have access to all the code I mean use the documentation that's there. But, but it's almost certainly not going to be enough.
So that's the case, I mean, You gotta do experiments to see what it does.
Okay, please elaborate and how documentation is wrong. I mean, it's just wrong I mean a human wrote it and oftentimes it says thanks so much for an older version, or sometimes it doesn't specify something or maybe there's a bug, like it's supposed to
do this but it doesn't do this and so there's a bug, and you don't have access to the code you can't fix the bug or maybe you do have access to the code but you can't fix it, but you don't, you can't change it and so you can't you know you have to work
around the bond. I mean,
there's nothing particularly sacred about documentation documentation is just people trying to write down what some system does some documentation is great some documentation is mediocre some documentation is horrible.
So I'm just missing.
So, you can't use what you can find. You'd be a fool not to. But that only gets well no documentation is a bare minimum but it's also sometimes it isn't there I mean particularly you're talking about things with swift swift UI.
I've definitely had things and this is true.
It's easy to get upset with Apple or particular thing but it's like this is true for essentially every modern software thing I mean look, if you're looking at old Unix stuff for any kind of system it's been around for a while it hasn't changed too much.
There you look up stuff you can find lots of wisdom about how it works and you can use, you know, follow that and stuff but for things are being actively developed.
Now, it's just, that's not the way and certainly if you're trying to work inside of any company or something, then definitely the documentation will be enough.
So, It doesn't always happen. Yeah, good point. Yeah.
Most of the time right but, you know, it's. So, you know.
Sometimes your codes fine. Yeah, sometimes yeah yes I'll be all right yeah development itself is an experiment. But the reason why I'm emphasizing this I'm emphasizing this now is I see a pattern today that many of you.
So, what really bothers me a lot of times people follow is this copy paste funnel.
So, they put, they get some code they say oh this is what I'm supposed to do they stick it into their into their project or something and then they like okay it seems to work or it doesn't quite work Oh getting syntax errors.
The idea is complaining oh let me fiddle with that and I'll just do this and then they get something running. They go Yay I got it running I'm done. But they don't understand why does it have even seen commercial developer me bad commercial developers
Bad commercial developers that were then fired, but I've seen folks in, you know, selling themselves as being able to program and it's like oh yeah they produced all this code then you look at wait.
They just copy pasted things together go like wow they're using this much code to do something that shouldn't take them two lines and it's just horrible, horrible so you use the online stuff, but that and use the ID and its factors for stronger errors,
but you're.
so you always be trying to refine the mental model you have, of how things work and have computers in general, and of the software specifically you're working at now.
Now, your model is always going to be incomplete. Now technically speaking, if you want to go back in time and work at systems that are 3040 years ago in terms of their complexity like the old, you know, you know pcs of the 1980s or something yeah those
systems you could understand everything that was going on in them.
That's not possible anymore. We work with system, we have millions of lines of code is like normal nowadays in code bases. I mean, operating systems are hundreds of millions of lines of code corporations have billions of lines of code.
I mean, these are enormous systems beyond the complexity of almost anything else humans have created. This is nuts, you will not understand how all this works.
Ever.
So, your mental models, always going to be incomplete. But the trick is, is how do I understand enough to do what I'm doing, which can help me to navigate but not so much why spend all my time just trying to figure things out and never actually get any
work done.
So,
that, you know, so that is hard, and now why this matters, particularly in mobile development is because there's a lot of stuff.
Yo that code. You're doing mobile development because it's driven by commercial pressure because it's actively you have this is you know how it looks like.
It's not gonna completely documented, it's running on top a lot of code, you gotta deal with all the weirdness. And so, more than anything else.
That's a skill you need to master and as you master that skill, it will serve you whatever you decide to do in computers and arguments and other domains.
So, let's be specific.
So I made this simple program called text analyzer will.
We're going to go through it.
And we're going to talk about it, but there's I've started linking to certain documentation. Now the documentation, the two big sources of documentation.
One is the swift programming language.
And so this documents the current language here. And honestly, This is worth reading from the beginning.
You can go from here, it explains things and just go through you know and then all the swift tour and language guide and you know this walks you through it or if you do the.
There's also this language reference which has all kinds of, you know, this is much more technical I wouldn't expect you to know this is the actual like how both languages defined but if you're getting, you know confused by the language guide this is
good place to go, but this is great to look at treated as a reference.
If you want to go read through it certainly you'll learn a lot but.
So I will say.
So this is the thing to understand about software and programming language stuff computer scientists don't have that many ideas, we tend to do the same things in the same ways over and over again we just want to change it around.
In, in various ways and you know there's reasons for different programming languages and know that but it's the underlying concepts are there and that's why you do a computer science degree is to learn those concepts, those, those pieces parts like that's
where you want to learn from algorithm you learn to reprogram that there's ways of looking at the world ways of looking at problems. And once you really understand those when you see a new system you sort of go like, Oh, it's just one of those.
Oh, they just did it that way oh okay that's another one of those means it's not.
It becomes all kind of the same.
And that's really what I say, you know, learning a new programs like okay yeah okay that's a new programming language okay it does this mean if the problem is has some really new ideas, then it's like okay what are those new ideas what are the old ideas
and you have to figure out that. So, my. So when you read through this language guidance stuff you should see a lot of things that you recognize from other languages now that you've learned, but you'll also see things referring to concepts that you may
not be so familiar with. And those are things you should pay attention to and try to learn.
So when you find something you don't know.
We're just about and that's part of what I see my role as he's when you come across these concepts so mobile development, particularly for having a first year level I mean, there is huge amounts, number of concepts that you all don't know and you don't
need to know all of it but there's going to come up and as it comes up I want to teach you at least the basics of it, so that you can get work done. And so I can help you.
You don't have to just go up to Wikipedia and go learn something that's where you ask questions. And that's why we have the tutorials and you collaborate go like, well, What's this thing here.
And as you see there's, you know, some stuff going on so so I'm saying so here is the documentation of swift which is the programming language working in on iOS.
And then there's also
all the way back here so and then there's also things like swift UI which is this documentation the apple developer documentation so this is what cycle for agent.
Now you look at the swift UI documentation and things I mean there's a lot of stuff. I mean, Swift is pretty good.
Swift UI is not as good.
Yeah.
So, if you're familiar with swift syntax.
So yeah, the syntax, well that's where you go.
Me, I would suggest to so you asked me about how do I learn swift syntax.
Good the Swift.
No swift documentation. And if you say welcome here and then a swift tour.
This gives you control flow This is in one page functions and closures objects and things, you know, new merchant structures, this is one
page that has the basics.
So go through that.
But again, I mean when you say it's super foreign I mean this isn't that different from Java, I mean it's different. It's cursor. But, you know, searching for syntax that's perfectly fine to search out the syntax and as you do it, you'll get but it's
again. Somebody just like I was saying it's okay to search it up but then you go like well what's the pattern here. What is the syntax, what how do things fit together you go like wait I just declare this, what is going on, it's worth looking it up and trying to
understand it because if you're just searching for a little things all the time.
It's a problem and there's always a logic to how these things work. So now I'm just saying like, I, again, search for it's a start. Now let's look at this code here for example this is 64 lines, not even 64 lines, we are free avoid the comments so slightly
less than 60 lines I mean there isn't much code here.
But we have two views. So now I've shown you how to connect views, I have this thing binding. What the heck is that I got this exclamation point here.
Okay.
You know there's of course the dollar but now you actually have enough stuff to understanding what that dollar is. Oh God is the private var stuff. Oh, then we have this for each construct.
And why does it have an ID thing here. And we kind of seen stuff there and then no okay this obligates contains we've got a set here. Oh, we've declared What's this why the heck is there an underscore there.
And why is there a point here or there and then no Whoa, what's that I mean,
there's a lot of stuff going on in this little bit of code.
A lot of stuff.
And I don't expect you to understand all this at once.
But that's what your job is now is to pick this apart, and try to understand all the concepts. As you go now.
So, I'm so instructing swift similar to see defining a data type
of, I'd say it's a little more like define an object.
Um, so, so there's all kinds of stuff going on. And so before I start talking about the code specifically I want to start talking about, like, what's going on here.
So, let's start talking about.
So first let's talk about.
So we say variable varies, but no.
So when you use lat you're talking about something that is not going to change.
Because the scoping. You know the same name may not have referred to the same data so
we refer to her okay so that so that then we're talking about so then we're.
Let's go actually show you.
So here.
Scope here. Now if you go over co
structures and classes.
So structures and classes with our general purpose flexible constructs that become the building blocks of your programs code, you can define properties and methods to add functionality your structures and and causes you the same Tracy's defined constants
variables and functions.
So interface that cluster is automatically made available for other code to use. So here's the key differences between structures and classes.
You know, they all kind of same classes have backpacks that structure don't have inheritance. It was one class they have another other typecasting, you know be initialized Reference Guide.
So basically when you talk about classes, you're really talking about things that are more like objects and other languages, we talked about struck.
They're more like data types.
So the one you've been seeing here is we've been seeing particularly this struct.
So when you have a struct.
So one thing it's immutable. It's an immutable data structure so you normally can't change the values in a struct, you can't assign them.
So, what is. So what is that so.
So we say that we have. So here we have we say struct. Here's the, you know, here's the name of the struct here's the type of the struct. And then here's the contents of the structure.
Now, note that.
me see if I can show this so let's go UX code here in the White keeps quitting on me.
I want to show that so let's create a new Xcode project.
And we're going to create a multi platform app.
Okay.
Good create here.
Great.
So we'll let this work here for a second while I do that but what I wanted to do before we start, oh by the way when you're looking at your interface.
Remember you can customize this. So, I don't really care about the side pain right now so you can go up to your menu, the View menu. So this is the
high navigator, is that the navigator is the one on the left, and then
specters is the one that right, some hiding the inspectors. And so now we just have the preview pane, and the in the main code.
So that's, that's enough for now. Now in this.
We have this view here. So, what we can do here is say, jump to definition.
You do this for any type, you're wondering, okay, what's the tiger I'm running How long does it take to load.
Boo I got the bouncing ball.
It's really thinking, Oh, there we go.
So, when you look at this, is you look at what view is defined as view is so it tells you it's available in these versions, you know, but it's public protocol view.
In the protocol has it associated body so.
So when we say, when we do this declaration here in our code, and we say that var body.
When we say that this is a view, we are saying that this struct will have a body, you know as a property of it. And that body will be of type view.
And in fact we look at the here that's in fact what it says. It says associated type body, which is going to be another view.
And, yeah, there's more stuff, obviously, so if you start looking at the syntax things here and stuff it just gets complicated fast, and I would honestly say, mostly in this class you shouldn't be looking at the definitions of code, except as, like, Oh
wow. Let's go. But you're not going to be able to understand most of it.
And that's okay.
Um, what you can do, though, is do things like go to quick help.
And, you know, like, a type that represents the part of your apps user interface that provides modifies that you can use to configure views declaration protocol view.
So, so this is.
So, actually technically text.
But what how is it
that work.
Here it is good.
So let's see if I look at taxed
out available text is equitable as wanted to see if I can see the view part so text.
Okay, if you go into text.
We should see somewhere down here that it's a view, but I think its way buried. So, we won't do that but.
everything you put in the body of you is basically another viewer helps produce another view. And so, what you've got.
If we go back to tutorial one.
You look at this code here, what does our code here is like inside of our view, what is the thing is, so in this content view view here. what do you have in the body, we have a view, that's the stack.
And then we pass these things to be stock the ultimate v stock is a view. And what is it well turns out the stock is a view that combines other views vertically stacked so text is a view text field of view rectangles of you.
Those are all combined together.
So, you can call it a text object. So the question is that text object but really think of it as a text view because really it's more of a struck thing me.
You can use that terminology, but it doesn't really make sense so much in Swift.
Yeah so but but these stack assembled, it's not so it's basically saying this is a V stack is one way of combining views together to make a bigger view.
Yes, sir. Exactly. There is an H doc for doing things horizontally and there's other ways of, and there's also a z stack for putting things one in front of the other, you know, but there's also things like group which combines things which doesn't affect
how the rendered on the screen.
Yes, exactly views.
So, you put in a bunch of views and user and views and views reviews is just us all the way down.
So, and.
Okay, so now the question is what is the stock a stock group I type of stock that is in you. So you say stock, are you thinking about the, the data structure.
Stack. This is not a data structure and this is the thing to understand.
thing to understand is when you're inside of you, and you're in here and doing stuff.
This is not. This right here is not regular Swift.
This is its own weird thing, this is like a swift UI domain specific language.
So, you can't, it's not regular code when you're in that body there's all these weird constraints. So,
so pay. So just remember when you're inside the body, you're not doing the normal rules now.
But there are times where you can and that's.
So, basically you have functions.
You can call function in fact you have to call functions inside of the body, but there are restrictions, but once you're in the regular body of a function.
You're just programming.
So,
what do I mean by this, so we didn't really see this in tutorial one and specifically this is basically swift UI. We are really seeing functions. This is just, You know, stuff here.
But if we go out in tutorial to the situation is different.
So, here this is a this is a stack. And, well, let's go ahead and run this code and then you'll understand what it does. So first let's do this. This is the code sucked at all, coffee, let's go over to cx code here, and
paste, and then delete all that other code.
Let's say,
and let's try running it.
Okay.
Well that runs and starts up the bill succeeded great
boot up.
I can bring it my editor here, so
I'll bring my browser.
So if you look at this code.
You'll notice that it has this view here. It has another view here, and then it's got some other code.
This code is regular swiftcover.
This is not in the constraints of you or other interface thing you'd say this is almost like back end code. This is much more like what you do in regular programming languages but there's a few little weird misses.
In this, which I will go through.
But first let me show you what's going on here. Oh good, came up.
So, this is the old text analyzer so.
Oh please, auto correct.
So Russia is a good voice accounts this count of the number of characters in the sentence.
But now we can go to this menu, and I can count one, so there's only one letter in here that's uppercase, and then I can, and and you know so.
So here I was, I have two options here.
So menu.
And so now let's look through the code and see how is this actually working. So first off we have a view.
and here we can see the direct mapping between these.
So first off we have the.
We have some private know we have some state private variables as T and analysis mode.
We'll talk about that in a second but the main thing we have is this view and in this view we have a V stack So sure enough we have everything vertically arranged.
And there we have a text for text analyzer which is here. It's bold and we put some padding so the padding put some space around it.
Then we have a text field, which says enter text.
And in fact, if we delete all the text here and see the little and the great thing it says enter text there.
And then we have text is t so it's a reference here to this private variable t.
And so that's where the text here that we enter will be stored in this variable here in padding again to make it, you're not just pushed up against everything else.
And then we have this whole line right here.
So, so when you say a variables private. This is just, you know, as an any object oriented language, it means the scope of this, This can't be accessed outside of this.
So you can't just come in and access T and out now from from outside of the view, this is private to the struct.
There's no problems but then. So, and then we have another text field, which is, which basically corresponds to this count.
And then this mode menu and mode menu is what puts up this menu.
And notice this text field it says what the analysis mode is which is the string here which defaults to count.
And we put a colon in front sweet plus we concatenate strings and the space. And then we do this thing.
And then of course we add padding on the end.
So, Lots of parse this out.
Because this is doing something a little funky
like 16.
So, so the dollar, I will get to the dollar sign and a little bit.
That's a little more complicated so I'll just make a note.
Okay, so we'll explain the swift UI thing that we're talking about there in a second but first let's talk about this, this analysis mode. What is this doing this is really.
Basically, It's a analysis a dictionary hash table.
So that's what's happening here is we're analysis mode is a string.
We're looking it up in a dictionary and we're getting back a function.
And then we call that function with the argument, T, but we have to have this exclamation point there because the lookup in the hash table could fail.
Now I know because of how I built the code that it will never fail because I've guaranteed that you know all the possibilities there so i'm saying is, Don't worry, it'll be fine.
So that's what the exclamation point is they're basically saying unwrap the type, don't worry it will be no it won't be No.
Does everyone follow that.
You all know dictionaries right
dictionary it so basically a hash table is an implementation of a dictionary.
So,
what would you have to do if you didn't specify the you know exclamation point if I, if, if I didn't specify that, then I would have to do the if left or something like we did last time, and check specifically for nil and do something without it.
The look at might fit actually, it won't even compile.
So, now, what if I, if this with this sort of code here. If this lookup fails, if I look up of analysis but it is not in the analysis.
I'm dictionary, then this will all decode the program will just crash your Apple crash. So, whenever you see an explanation we were like, are you sure you know you know really what you should do is do an if well, you want to be cautious you do it flat
or do some other things where you check to make sure it isn't do the unwrapping as we did before.
So now let's look here's the definition of analysis. So we did a lot because it's immutable. And here we're declaring this to be a dictionary basically it's a string that maps to this string that return strengths what this thing is this is a function
that takes a string as an argument and returns a string.
So.
So,
so is. So, what is the episode The.
So, if you look up here, this is, this is a function definition here in Swift.
Here we're defining a function in Swift, so the syntax errors use declare function with
the function, here's the name of the function and just like you expect you have an open parentheses with the arguments. And then the return value actually specify what the type of the return value is.
And then you basically say this is you know it returns, and here's the type of what it returns. And so we have a return statement and yes it returns a string.
And we're converting an integer into a string right here.
So, function there now
let's let's.
Swain underscore in a second here.
Then, S.
So, what the underscore actually is is.
So.
So by default.
So like you know in other languages you'd say, if you say f of a, b, c, you know you can use you, that's like kind of like wishing only do and then A, B and C my, you know, so when you have a will be, will go to.
Chuck, they think you're doing in front of each one you can omit.
So, so it's not, it's not exactly a placeholder what it is is specifying this so notice whenever we do things like this, we call button.
This is basically using function calls syntax.
And so we're passing in this argument mode, but then action is a named parameter.
So we must specify the name here, and that's why we're doing, you know, saying action colon.
Why do we do this is because button nationally takes your CIO convention, so.
So you typically use unnamed argue for things that you have to pass in because it needs it, and you use the names for the ones that well you could potentially leave it out.
Although here.
This button, you better have the action otherwise.
I'm not actually sure about that you might actually be able to just say button in mode and not specify action, it might still work.
I don't know, I'd have to check that.
But yeah, so I mean, honestly, even now like for function syntax and stuff like, you know, if you go here functions. And there's a lot of stuff here for like this is kind of your standard thing declaration.
And then if you call that you have to then specify the name. Here you have to name the argument you can't do
multiple parameters function without returning values.
So you have to go down for a while before it actually starts.
Implicit return a function or get labels and parameter names omitting argument labels. So here's what are you Leo for a pair of right and underscore instead of the cluster label for that parameter.
So,
you can also specify defaults. So parameter with by with default int 12 second I will call this function the value of primer with default is 12 inside the function body.
So, this is,
this is important. This is basic part of the language, it's a little different. It's not that different. But it's a little different than other things you can see there's potential advantages potential disadvantages.
This underscore frankly is kind of ugly, but it makes it clear that you're basically saying this is a positional one versus a named one.
Let's go. Let's see what else. So now we have got let's go back to that dollar sign here.
What are we actually doing here.
So the thing to really note when you look at the dollar sign is, you should look at the state and the binding
of it so it's all good questions. Good.
So, the tall Yes, exactly when you use named arguments.
Order.
Is it okay to have only named arguments. Yes, definitely. And in fact, that's the default you have to go out of your way and out in the underscores otherwise every argument is named.
So I think there's a way to actually have the extra to actually have a name that's us for calling and a name that's us inside the body of the function.
Um, I'm not sure I'm not sure.
Now I don't see that. Now you're generally.
Oh no no oh no you can like hear you can specify from is the external name that you use for the calling here, and then hometown is the name inside the body.
So you can have a separate name for calling convention, and for inside of it
up.
Let me see I can show you how the underscore works. So this question, under sleep. so let's go to this code here. can I make this bigger
this a little bit.
You know,
you.
Okay, so we're now here.
We now have this, we declared this as count upper like this.
Oh, no, that's just gonna break our code.
So you see this right here, if I get rid of this here, let's see, let's still work.
I don't think that'll work
did work.
It's all working. So yeah, you don't have to have the underscore here. I'm kind of surprised I'm not quite sure what it does with
with this because I was kind of expecting it need to do that but I'll have to check that out.
Whereas the S come from an analysis. That's kind of what I was wondering, so I need to explain this line real quick. So.
I think as long as we use the same argument name we should be fine.
That's still kind of surprised.
I'm really surprised that actually works. But, but anyway but this is what counts value is this.
So, S is this.
So note I hear
you we've defined a function here, that is a function, but it is has no name.
So is there any particular reason why you'd want to use unnamed functions.
Yes. The reason.
This is because of things like this look, the only the only thing this is doing is calculating the count of, of, of the, you know, string that's passed in, so I could define this as a full function.
And how would that be.
I could define.
You know I can find character count function count characters, and that'll be s.
So, we have a, we have a function here, and then all we do is return.
Or I could do.
I could change this code to be.
Get rid of this.
I call this.
So I can do this.
I can do this. And if I didn't mess up. Don't succeeded.
Here, the code works.
But
look what I did, I had to declare I had this is 1234 lines, or maybe if I omitted this needed three lines.
And there I just had it as one line.
You know I could have just put it in there so I've wasted all this code space where I could have just had one thing which just had what it was.
That's basically it.
Now, One thing to note about.
So, not always, but often when you see curly braces. It's actually a function.
Under the hood where they use the same space in memory.
Yeah, it's not, there's not an inefficiency thing as far as I know, I mean, whether use anonymous function named one. I don't think it matters. It's more about where you're going to use it and really.
going to.
So why didn't you have to call the function with an argument, even if the function needs one.
I'm good quietly, who. So, question is is who called these functions, they do need an argument. Where are these functions being called what line.
So I tell me what line is being called on.
Yep, exactly is being called in line 16 and we are passing in an argument, T.
Yep, we're passing in the argument T.
So yes, these functions do need an argument. But notice that we're calling depending upon the situation, either account characters, or, or account, upper for calling one of those two functions and which one we do depends on the value of the analysis mode
and that's what we're doing the look up here.
So,
so it's so this is the stuff I mean this is a little tricky here but this is very important to understand because you're going to see these kind of patterns all over the place.
And notice, when we said, What's the syntax here we said argument list comes before the end keyword, what's happening right here in this for each.
Hello closure,
we just defined a closure. This is a function here, which is taking an input of mode.
And this is the body of the function.
So, this is me
in here means something different but i'm saying is, but like this. You see, open curly brace and then you see something in in in.
You're seeing a closure so this just sort of shows up in all kinds of places, and you have to keep an eye out for it.
Okay, we're doing okay right, I'm going to wrap up soon and then I kind of want to see you all.
So you don't need it so basically what I want to do for tutorials.
basically don't fall behind with your tutorial check offs. I'm willing for you to get about a week behind but no more. Unless there's like real extenuating circumstances because you know if you're not keeping up with this you're not keeping up and you're
going to fall behind and everything.
And so next week we'll have tutorial three and assignment one will also come out. I haven't yet decided how much assignment one will depend upon tutorial three.
I have to have to decide that. But there's actually quite a bit already here in tutorial too so I might just focus on that.
But then there's three tutorials and the second assignment.
Anyway, I'm figuring out
what I want. So
what's the other little things here so available modes equal string analysis keys.
Notice here that I'm analysis is a hash table. What is a dictionary and so this is the keys of the dictionary. And so we get that and we turn the keys of the dictionary into an array of strings.
That's where doing it so that's the avail modes and that's how we get, and that what forms the labels. Oh, sorry.
I have to, we will talk about this more because I feel like I've been talking for enough for now, I'm going to talk from there five minutes I think 18 minutes of lecture is enough for any day.
We have two views.
These two views are connected.
Here we call mode menu here we're basically embedding this view in here. And then we're saying, we have this analysis mode is now so this is kind of like a function declaration although it's, it's more on the way it looks, then we're actually is in terms
of the type system. This word swift underneath the types get really weird.
And we're passing in the value of analysis mode, but we want to do is passing a reference to this variable.
And that's what the dollar is, is what that allows us to do a reference to this, it's more complicated the basic thing of this as a reference. If you just pass if you just said analysis mode, it would just be the value of it.
It wouldn't be the actual variables here what these wouldn't be connected and this only works this dollar sign thing when it's being embedded in a view, which has an appropriate binding variable.
So basically, the bind in order to associate binding variable with another state variable, you have this name here and this name becomes this name goes over here, and then the state variable goes over here and you have the dollar sign for connecting these
two. And that's how these two views communicate is by the state variable is here and this binding basically is another name for this state variable so you can say it's, it's like this is if you know see this is like this points to this one.
But it's much safer.
We will talk about this more later,