>> Now I see some warnings.
What are these warnings trying to tell us?
>> These warnings are Xcode trying to be nice and
telling us stuff, that our variables are unused, which is true.
We created them and we haven't used them, because it's more of a demonstration.
So, it also gives us different, so Swift has a new feature which, if you don't care
about a variable, You can not give it a name, which is very interesting.
So, you can call this method and
get the return value, but you just don't care about it.
So, you just want to put into a underscore, which we talked about.
And you can do this in function cranrate and such.
But in Objective C you can't do that, so it's just gonna tell you you
haven't used this yet, which probably means you shouldn't be printing.
I'm sure some people, including myself,
have a question of how is this useful if you are just calling.
Is it that this essentially has an effect and that's all you care about?
>> Yeah. So, say this had a side effect.
Which is doesn't.
Here, you can always just call it without an assigned return value.
But this underscore is really more useful as we coded be for
when you're say getting a block which gives you three parameters.
But you only really need one of them.
So, the other two can be underscores.
So, you're expressing clear intent that I'm going to use this and
I'm not gonna use these.
Even though you're gonna give it to me, I'm gonna sign it to the underscore,
which means I'm just not gonna use it.
But you're still gonna give it to me anyways, right?
When Objective C, you can't express that meaning in Objective C.
So if you have a function that gives you five parameters, five variables,
in Objective C all five would be ran out and
you would have to look in the code to see which ones you're actually using.
In Swift you can express that I'm going to just use this one.
Or none of them, and give them like five underscores, cool.
Okay so what we've seen is a basic of Objective C is SWIFT,
there's a lot more to Objective C obviously and
so we'll have links and for anyone who wants to learn more about Objective C.
It's good to have a look, because there's a lot of code out there, and
there's quite a bit in objective C right now, so it might be useful.
But for the remainder of this specialization,
we'll just focus on [INAUDIBLE].
>> And I hope, after seeing this comparison, you're much more happy that we
are indeed focusing on >> I don't know.
I still like Objective-C,
but maybe that's just cuz I've been programming in it for a while.
[LAUGH] So it's still cool.
>> Yeah, no, I definitely urge everyone that's doing LS, eventually you're gonna
have to give yourself an Objective-C, it's unavoidable, really, at this point.
And maybe if, five years down the road, you can avoid looking at Objective-C but
since >> But sense iOS and Cocoa Touch,
the framework we're using, is random in Objective C, like,
lots of the restrictions do surface in Swift and we see them all over the place.
>> Well, I guess if someone wanted to build a simple app
you could actually build that app with Swift.
And we're going to see that throughout this course.
But if you want very advanced functionality, then in those cases,
some of the codes you might actually find online,
or you may want to use, are in Objective C.
So that's something that, again, goes to the fact that this specialization
is geared towards, maybe, the more beginner, moderate type programmers and
app developers, but Very advanced, perhaps should be much more Objective C savvy.
[LAUGH] >> Yeah, and I guess we can just briefly
mention how Swift and Objective C works together in iOS, because
as you can see there are two languages, and can do the same thing in both.
And like Prior mentioned, there's a lot of existing Objective C code out there.
Well, in Outpoint you do Swift they're not gonna Just discard all that code.
So they created many ways, which is out of the scope of our course,
for ObjC and Swift to work together.
As you see, just like ObjC Bridging-Header here which allows ObjC to be used in Swift
and that's And you may run across that in the future in your codes, and there's lots
of resources that will provide the course materials that goes over that topic.