쉐도잉 연습: Mastering iOS Development: Mock Interview with Ramiro Neto - 영상으로 영어 말하기 배우기

레슨 만드는 중...
1
Right.
2
So thank you for joining, Romira.
3
And let's just quickly go through some agenda for our smoke interview.
4
So firstly, we'll just talk about, you know, some do some introduction, then going to be two sections.
5
First one, more like soft sections of skill, your behavior driven section in a way.
6
And then the technical part, the technical part, we will split for two parts.
7
It's one pure task, pure questions, both, you know, classical Swift, iOS, SDKs, questions, and the second part,
8
more like example testing, let's say.
9
So I will drop you some piece of quotes, and then we'll just talk about it.
10
No life -building, no kind of algorithms thingy, just let's say...
11
Discussion.
12
Yeah, just discussion, basically, like a classic thing, nothing more.
13
So that's it.
14
Let's start.
15
Let's see how it's going to go.
16
Yeah, let's start from the introduction.
17
Let me start it.
18
So my name is Ildar.
19
I'm now located in Sweden.
20
I'm working in the H &M as a lead engineer.
21
And I really like to drive such sections like mock interviews or in general interviews.
22
So always nice to see and talk with the new people and see how we can be used to support each other.
23
Yes, what about you, Amir?
24
Yeah, thank you for the opportunity.
25
So I am Amir, I'm from Fortaleza, Brazil.
26
I have been working with software development since 2012.
27
I started as Android, but after that, I did the Apple Develop Academy course.
28
And after the course, I worked with other technologists like PHP,
29
Muscle, React .js, and others but I got back to focus on iOS in 2017.
30
And yeah, I have worked with several projects and companies and like telecommunication companies,
31
banking projects, and also digital wallets, e -commerce.
32
Yeah, that's it.
33
Yeah, really, really nice experience, I would say.
34
You know, especially this kind of different experience from different areas probably gives you, you know, a sense of understanding how things work you know,
35
I draw it or I end up in a way.
36
So that's really nice, especially for, you know, agile teams when you need to be agile, you know, I guess.
37
Cool, cool.
38
Right.
39
Let's just then jump to the first part.
40
So behavior driven questions to warm up in a way.
41
And yeah, just to start all this.
42
Yeah.
43
Since you have some experience, I've seen that you have more than five years experience in the development right
44
or in general in development you probably had situations where you need to review code of your teammates um
45
so really interesting to understand how you're doing it
46
so for example um you have a team of three four people
47
and you need to review each other right
48
and you need to review someone's code
49
so how do you do it here you you have a rule
50
that uh a pure pr to be approved needed at least two likes.
51
The team needs approved at least for two two person to be approved.
52
Yeah, I have to work.
53
Okay, do you think two person is enough for approving PR?
54
What exactly?
55
Two person, not one or not three?
56
It depends because our team, it's not a big team, you know?
57
So as you have less numbers from people, I think it's okay in your case.
58
But of course, if you have a bigger team, it would be better and have more likes.
59
Okay.
60
Yeah, yeah.
61
Fair enough.
62
Fair enough.
63
And for review, when you're reviewing some word code, you know, usually people trying to see for something specific
64
or have some we have some pattern to you know scheme the code
65
and catch some some of the things can you maybe tell
66
what usually is catching your eyes on the it's maybe syntaxes errors
67
or some kind of boss symbols in a way yeah here you have a some a partner for CodeStyle.
68
So we see it in the PR as guardlets, as possible iflets, trolls, or yeah, some things like that.
69
Camel case, uppercase too.
70
And also we try to see if the developer is following the clean architecture that it's necessary for the, the improvements.
71
So that's it what I do.
72
Interesting.
73
Right.
74
And then when you're working in the team, you usually have a designer and some backend developers and you need to,
75
let's say you need to work on some feature where all these parts involved,
76
what would you say is best way for communication about new feature
77
or how to be sure
78
that some specific feature is uh you know in the best shape
79
when you're finishing it or you when you you know
80
when you finish the work how to be sure
81
that uh all the parts in in the place
82
when you work yeah it's a it's a it's a very good question it's a complex one you know yeah
83
and i think uh the design maybe it's the the first parts of the idea.
84
We, as a mobile developer, works in all the parts from the idea.
85
And so when the design presents the idea for us,
86
it would be nice to see if you have some technical implications from the implementations.
87
And after that, when you are implementing the the the feature
88
that is approved for design and for us we need to see if the the the backend it's
89
it's everything all right or what you will need implementing the backends or to to
90
to develop it in the mobile yeah yeah okay and let's say design is finished for starting the work,
91
but back -end not.
92
Is there any way you can still start working or you will wait for back and fully finish the work?
93
No, honestly, we can start to work and create interviews at least.
94
But of course, it depends from the case.
95
But as I assume that you have a BFA, we can close a contract,
96
you know, like I agree and agree be agreeing it in a contact contact contact sorry
97
and yeah it started develops the view
98
and maybe with uh uh uh creating a block or something like
99
that right right yeah sounds sounds great
100
and let's say the final question for this you know the classic situation
101
when you have some technical depth as unit tests or some refactoring
102
and you also have your features that needs to be delivered.
103
How do you find a balance in that?
104
Or how do you maybe as a senior developer can recommend to your management or team how to resolve it?
105
So you're not stuck fully in the back block with all this technical depth, but also you're delivering the features.
106
Do you have any tips, tricks, how you find the balance between technical depth and actual features.
107
Can you repeat the first synthesis, please?
108
How do you find the balance between the technical depth?
109
So basically tests or refactorings and the features that you need to deliver because, you know, usually management pushing for features, right?
110
Or business pushing for new features to release.
111
But you know that you need to cover something with a unit test or refactor something because in the future, there is some consequences for that.
112
So how do you find this balance?
113
How do you kind of sell it?
114
Honestly, I think that's for a mature team.
115
We need to spend at least like time to cover some tests and fix some bugs.
116
And improve also our code bases.
117
I think I find the balance for it.
118
Like I haven't taken priorizations from the features between the others,
119
things that you need to improve the codes, like the tests and the others factors that you need to do, as I said.
120
Right.
121
So I think it would be a priorization between these ones.
122
Yes.
123
Yes.
124
All right.
125
So I guess we can wrap up with these behavior questions and then smoothly go to technical part,
126
but I'll just give you some feedback after each section.
127
So not to forget about the things.
128
This section, I would say that all gifts for behavior questions, your answer is solid about how you behave, how you do, especially part about.
129
you know, how do you find the balance in the technical part between these features and technical depth,
130
because you always need, you have such experience.
131
I mean, this is something where you can recognize that person has some experience to actually work on technical depth, not just work purely on the features,
132
because you really need to think about it and you really need to
133
reserve some time in your daily work or your sprint or whatever you call it for specifically for technical depth.
134
You could be a bit maybe descriptive in a way for how exactly you can do this.
135
Let's say that you can reserve 20 % of sprint
136
or technical depth or have some iterations and indication in the team that that if we will not do this,
137
then there is a consequence for businesses to sell it in a way for the team and present it.
138
It's not just some updated work or not needed work, but something really important, not only for us as the developers, but first of all, to the business.
139
Yes.
140
Right.
141
Let's jump to the technical part.
142
Yeah.
143
Let's just start from the, some, you know, easy, easy ongoing questions.
144
So where in the Swift, we have the structures and classes.
145
Can you explain to me what is the differences between these two?
146
Yeah.
147
The main difference is because the struct, it's a value type and class, it's a heifer type.
148
So it's created a heifer in the memory.
149
So it's the main difference.
150
All right.
151
Maybe, can we, for example, inherit structure from another structure?
152
And no, you can't, I think.
153
Can we inherit classes?
154
Because it's like a structure.
155
It's a copy one from the object.
156
So yeah, it's immutable.
157
Yeah, right.
158
Can we inherit classes?
159
Yeah.
160
Yes.
161
Can we inherit, let's say, two classes?
162
So one, you know, we have class A and then we inherit class B, class C.
163
Yeah, you can.
164
Okay.
165
So how we can do this? so i just decided to describe
166
or you meant something else yeah you can create like a final class
167
and like in here to other like a network uh protocol class
168
and they are that would be inherit from a protocol
169
and you have a network service class and a mock services networks okay
170
so so you meant protocols
171
but i mean can you inherit you know classes just after you know comma class you have class a
172
and then you have just a pure class b
173
and then comma class c comma class d can you do this yeah you you can do it like
174
and create like an um let's see um a knowledge case
175
and y view controller
176
that would inherit some some functions to to analysis to to send to the crash leads
177
or send to the Firebase analytics some functions to analytics.
178
Or you can create a view that would have a background like rounded and grey.
179
I don't know, and every view that your design systems would be narrated from this one.
180
It can be created in the final class.
181
And yeah, like a super class.
182
Got it, got it.
183
All right, let's move further a little bit.
184
So in the Swift, we have different types, right?
185
So, and we have so -called primitive types that usually variables.
186
and we have reference types that usually is something bigger than just pure variables.
187
Can you tell me what is in this system?
188
What is closures?
189
Are they reference types or are they value types?
190
Yeah, honestly, no. I don't know about it.
191
Not sure.
192
Closures.
193
You know closures, right?
194
Yeah, I know closures.
195
I'm not sure where to.
196
Okay, no problem, no problem.
197
Right, and then maybe if we go a step further, let's maybe speak about the memory management.
198
So we have a memory management.
199
Can you explain how it works in the iOS?
200
Yeah, we have a GCG on iOS and it works with a lot of threads.
201
Yeah, we have ARC 2 that's that have the memory management for count heiferis.
202
And yeah, it's the automatically way that Swift works with memory management.
203
Right, right.
204
And for ARC, you have, you know, so can you maybe explain in the details a bit how ARC works for us?
205
Yeah.
206
How that works?
207
Every time that you create a new object, it counts one reference from this object, this one.
208
When the object would be deallocated, they decrease this reference from the memory management.
209
But of course, if you create some strong references, it could not decrease it and maybe crash the app,
210
create a memory leak.
211
Do you know how it's called this kind of bad situation when you have one strong reference to another strong reference?
212
Two classes have strong references to each other.
213
Do you know how this situation is called?
214
How this situation is called?
215
Yeah, I know the XETLIN name, but I forget.
216
Sorry.
217
No, no, it's not a problem.
218
It's called Retain Cycle, right?
219
Retain Cycle, yes.
220
Because you can't retain actually.
221
Yeah, yeah.
222
So I thought how to resolve it, do you know how to resolve such situations?
223
Yeah, you can use weak or unknowable, so two options to resolve it.
224
And what's the difference between these two?
225
Because weak is an optional one and unknowable you guarantee the app that it's,
226
you have, it's like an unfortunate in others.
227
Right, right.
228
And that's interesting.
229
So when we're working with this, right?
230
So I see that almost no one uses a null.
231
Do you know any scenario where you can actually use a null and be locally safe with that? questions?
232
Well, I think you can use it another way like when you have a reference between one,
233
just one class, like when you have a protocol inside in a cell,
234
for example, and the view controller has the table view.
235
You know that this protocol just will exist in this case because the cell,
236
it's just in there in this view controller.
237
It's not being used in anyone, in some somewhere, sorry.
238
And so you can use anodes in this case, that would be a problem.
239
Right.
240
Okay.
241
Yeah.
242
Yeah.
243
Interesting.
244
So let's then jump to next one with the, just maybe about the, you know, coming back to the closures.
245
So we have the closures, right?
246
And they have some specific, I would say, working with the references.
247
When we're working with the references inside the closures, can you tell what we need to be aware of?
248
You need to be aware of the routine cycle that you want to know?
249
I don't know if I understood everything, sorry.
250
No, no, I mean, that's one thing.
251
I agree.
252
But for inside the closures, how we can be safe with this kind of routine cycles,
253
what we should you can use wix itself as i as we said and guide let's to okay the the view
254
all right and then so for closures sometimes
255
when i'm using it for the functions from time to time
256
and it has a big different syntaxes in the you know
257
in the function name sometimes called escaping sometimes it's not escaping
258
can you tell me the difference between this what's what's the
259
point to put this yeah i already use it it's before of course
260
but yeah i can't exactly remember
261
that as i think escape as i can remember escaping i
262
think you can pass a code of block to be be executing in the in the order
263
when they the user would be call this function with the closer
264
so So you have a complexion one that I can remember, sorry, but yeah, my knowledge about that, it's not good.
265
It's not very close by the answer, but yet.
266
Okay.
267
Got it.
268
Got it.
269
Right.
270
And then, so the closures, uh, really, you know, they are, they are very powerful, right?
271
But is there, do you see, do you think it's a best practice to use closures as a parameters for functions today?
272
you know in a protocol oriented object it would be better Right.
273
But in the case when you need to, let's say, when I have a function and after that function,
274
after, you know, finished, we want to call another function.
275
Yeah, you can use a guarantee sequence.
276
That's right.
277
As we use, you know, with closures as a parameter, it's usually because when it's the parameter, we're calling it callback or, you know, completion block.
278
And then we're calling it and then putting some piece of code there to be called after the function or, you know, after we complete it.
279
Yeah.
280
Today, I think it would be better using the triassincurate in this case.
281
Right.
282
Yeah.
283
Good, good.
284
Assignuate is a modern way for threading, right?
285
And working with the threads.
286
Do you know any old style way for working with threads?
287
What do we have to use in a normal multi -threading without a sync weight?
288
Dispatch queries, you mean?
289
Yeah, for example, dispatch queries, something else?
290
Yeah, dispatch queries, as you said, the completions in some case should be...
291
I'm specifically about, you know, working in the multi - Dispatch group.
292
Dispatch group.
293
But that is just a part of GCD.
294
So we have a GCD.
295
We have a Syncquate.
296
Something else?
297
Do you know about something else?
298
No, that I can't remember.
299
Sorry.
300
Have you heard about the operation queues?
301
Oh, operation queues.
302
Yes, but I never worked at Zwift.
303
Yeah, but I have...
304
Right, right.
305
So for.. for these things to work.
306
So this AsyncAway and GTD in general, we're saying that it's multi -threading, right?
307
In our project.
308
But does it really clear multi -thread in our apps?
309
Or, I mean, how does it work that we can do things on different threads?
310
If we have, you know, iPhones with adjusted one or two core, actual physical core, I mean, do you know how
311
but i can create you know hundreds of threads i can create hundreds of calls
312
and gcd different priorities
313
or how does it work do you know general what what
314
does it mean for us this multi -threading for the apps is it the same as nvidia you know
315
when you have a thousand of separate threads where each works separately
316
or it works differently for us let me see we have a concurrence and also, oh my gosh, I forgot the...
317
That was my thing.
318
Yeah.
319
And you can create, you can work with that.
320
If you create other, like you said, it would be just to be more organized to us or just to,
321
but it's not, we work like in really so many different strategies.
322
It would be more for organize the codes for, we have this, these two ways to, to, to work with it at the,
323
the simultaneous and the asynchronous ones.
324
Yeah.
325
I don't know if you, you want to know about it.
326
Sorry.
327
Yeah.
328
I mean, okay.
329
It's everything, everything fine.
330
Let's then talk about, that's a good thing.
331
So we talked about the threats and concurrency, you know, how things works.
332
And the part of this, you talked about the async way, how this works.
333
But part of this topic is also so -called actors.
334
Do you know what is actors?
335
How do we work with this actors thing?
336
Yeah, you mean these annotations that you...
337
Yeah, for example, annotations.
338
Yeah, you're using some annotations to put this whole object or just the functions in a specific branch,
339
like a main actor.
340
okay but uh do you know
341
that we can actually create actor ourselves yeah you can create
342
actors like this yeah we have class we have structure
343
and then we have actor as a you know a keyword
344
we can create actor something do you know what what what
345
it give us to create such in such a way for example some class user manager
346
or something like this yeah actors uh as i said to change the block
347
or the objects and its markets that it would be due in a...
348
Well, it's markets the code or the function on a code block to do something that you want,
349
that you like a main actor, it would be that you mark the code block to be executed in the the main QE,
350
let you create an actor for other...
351
Like at this table, you would be due that the code of blocker is the, the, the, the, the stable from other, from the, the current app.
352
Okay.
353
But, but I'm, I'm saying that, so you're saying about the marking something as attribute like main actor or something like that for the class, right?
354
Mm -hmm.
355
Or, or property in the class.
356
Yeah.
357
What I'm saying that we can create actor as, you know, as you, for example, you have a, let's say,
358
network manager or user manager that manages users.
359
You have a class, user manager, something, something.
360
In the same way, we can create actor, user manager, something, something.
361
Do you know what would be the difference or what is the scenarios when would be nice to create actors such?
362
yeah honestly no i never worked with this okay type of actor got it got it
363
and uh probably last thing about um uh just in this you know topic
364
so we have so -called thing solid have you heard about the solid yeah
365
and there is some you know something called the dependency injection
366
just interesting how you would do it in the project without any with
367
or without frameworks If you have worked with some frameworks, just tell me with which, how you worked and the scenario when you don't have any frameworks, how you would do it.
368
Yeah, I have worked with Swinject,
369
but also with products without Swinject and we create our own factories.
370
Sometimes builders are necessary to inject some dependencies too
371
and sometimes just it's a it's a complex subject you know
372
like just an in meets with others it's already an injection dependence
373
so yeah all right yes yes i mean cool framework right
374
let's wrap up with this part yeah you've been really great
375
for this part i i have just maybe a few comments
376
so just about the first question you remember was about the inheritance in the suite
377
and can we inherit multiple classes and there is might be some misunderstanding, but the thing just to, you know, be clear here in the iOS,
378
in the Swift and Objective -C, we don't have multiple class inheritance.
379
Just as example, as just I said it, so we have class A, then you have inheritance from class B, then comma inheritance class C, you can't do it.
380
So that's why we're using product protocols, that's why we're using, but we can, we can use like simulated in a way.
381
So in a protocol oriented programming, when you have multiple protocols, we have, you know, infinite amount of protocols that we can implement, but it's a different one, right?
382
So between inheritance and implementation or something, but in a way we can simulate it because what we can do,
383
we can extend the protocol and then do default implementation for each function, right?
384
Of the protocol, for example.
385
That meaning that we have a default implementation for functions.
386
And whoever inherits or implements these protocols actually has default implementation for functions.
387
Same way as it would have during the inheritance of these functions from another class.
388
You see what I mean, right?
389
So this is the trick where we could use to have
390
this kind of multiple inheritance doesn't mean it's always need to be in place, doesn't mean it's always good, but just the fact that we don't have multiple inheritance,
391
but we can simulate it in a way with a protocol
392
or in the programming with extending it and giving it default implementation for the functions.
393
Right, the other one about the actors.
394
So basically just my comment that, you know, check it out, how it works.
395
It's something that now on the, you know, on the top of discussions, where to use it, where not to use it.
396
Yeah, I would say it's helpful for some specific group of tasks.
397
So the difference would be that the actors makes your data inside secure for threats,
398
for concurrency, but it has some drawbacks or I mean, it has some tricks.
399
So you need to be aware of something there.
400
So it doesn't mean that you guarantee that everything that runs inside the actors, threat safe.
401
If something comes from outside, if you have some parameters and functions that comes from outside, there is no thread safe anymore,
402
even though it works inside the actors.
403
But whatever inside class as property in the class, as some variable, I mean, in the class, some counters,
404
some other classes, it's safe.
405
So that's just cool to know.
406
And for scenarios like maybe network manager, maybe user manager, maybe some credentials or other parts
407
when you need threat safes that's a good idea to create actor
408
but yeah it's it has some definition it has some behavior
409
so you know the part about the part about
410
that in general about the actors is set right
411
that we have this kind of main actors
412
and to run everything even there you could be a bit
413
more district this descriptive in a way why we need it
414
or how it help us yes i didn't ask it
415
but just you can just tell it
416
that okay we have this kind of main actors it's it
417
helps us to run everything on the main thread on the main queue
418
and we save there so that's really helpful
419
because before we needed to run in dispatch queue main async everywhere for example to guarantee
420
that this code works and now if you just mark it with the main actor.
421
And then in most scenarios, it runs on the main queue.
422
Again, there is some, you know, some scenarios when something could go wrong, but it's a bit harder scenarios, not just a normal when you're just calling some functions or,
423
you know, changing some variables.
424
That should be pretty, pretty fine.
425
Right.
426
That's pretty much it.
427
Otherwise, yep, we took clear.
428
Was something, ah, yeah, the closures.
429
I asked you about the closures, right?
430
It's a class as a reference type of course there are closures
431
because you can pass them I asked if the closures value type or reference type remember this?
432
Yeah I remember this but I didn't understood.
433
Yeah yeah it might be again misrepresenting in a way so just saying that the closures
434
reference types
435
so that's why we can pass them in the parameters of
436
functions that's why we can in general working with them in such way that we can call them afterwards.
437
Same for escaping, non -escaping.
438
You answered in a way for this, but the clear answer would be that escaping closures,
439
they basically escaping current context, meaning you have a function that returns something.
440
So escaping closures can be called after function returned.
441
And non -escaping will be always called, you know, just sequent.
442
It's called and then something returned.
443
So in the moment when you have some thread work or some async work, where you're calling this kind of closure,
444
the compiler, it has compiler check.
445
Compiler will tell you to put escaping there because you will call this closure afterwards,
446
after the function finished, just to cover up this topic.
447
Right.
448
Yeah, that's pretty much it.
449
Let's now jump to interesting part, practical part.
450
So I will send to the chat some part of the codes and if it's fine to you, you can maybe share your screen with the playground.
451
If you can just start it.
452
I've sent some code in the chat.
453
If you see it.
454
Nice.
455
Yeah.
456
Just pass it there and then let's discuss.
457
Right.
458
So you can maybe, yeah, just ignore it.
459
It's fine.
460
So you can maybe just increase the font size here.
461
Increase font size?
462
Yeah, just or comment plus maybe.
463
Yep.
464
Nice.
465
Right.
466
So let's just ignore this.
467
Let's just thread safe checks.
468
It's fine.
469
But in general, let's just discuss this code.
470
How do you feel about this code?
471
Do you see any problems with this code?
472
what kind of followers you see?
473
What would you improve?
474
Yeah, I think here I will check in this way.
475
You can say in this case, if they're this way, you pass the data.
476
What do you...
477
You need this one too.
478
Right.
479
And you need to put a return to avoid call tries that I can see.
480
Right.
481
What do you think about the first two constants that we have in the class?
482
First constants?
483
Ah, yeah.
484
Do you have any comments about this?
485
You'd say that if it's a charge,
486
would it be uh states it needed to be no it's needed to be staged but not
487
Same day both.
488
That's fine.
489
I mean, you don't need to mark anything for now.
490
Let's discuss, you know, just a singleton here.
491
So you have a shared singleton, right, for network manager?
492
Yeah.
493
Any comments on that?
494
Do you feel it's fine?
495
I think we need to create and initialize it to
496
that's assumed that it would be just one
497
and in it but yeah I can't see any problems here sorry I think okay for the session
498
Is it fine to have such a session as shared one here?
499
Just use the shared one?
500
Yeah, I don't see any problems.
501
Okay.
502
Right.
503
So if today you would do something like that, let's say you need to load data, would you do it like this kind of function?
504
Or would you do it differently?
505
If today I do, I think I wouldn't create a network chart.
506
I will create a final class with a protocol.
507
Okay.
508
So why would you need the protocol?
509
No, with some get, the other ones, like put and everything else.
510
and the load data would be my network would be in the my network service
511
I think but the way it implemented do you like it the way the implementation way of this function
512
or you would change it to something else for the function
513
you mean yeah for the function itself the searching yeah
514
so you basically need to load data right by url some some url
515
that coming it could be let's say images whatever
516
and you have some urls
517
and then updates you got it you need to do something
518
with this data would you use function like this for your real project
519
or how we would do it no in my real products of course not because it's a it's a simple function.
520
It just puts an URL.
521
You don't know if the URL is a UTF string.
522
Also, sometimes you need methods,
523
parameters, and I think who else to do this one.
524
But for a simple function, I don't see in big project in a huge problem, you know?
525
Okay.
526
Yes.
527
Right.
528
I mean, there could be, of course, different, different way for improvements to this function.
529
One of the way would be using a sync way instead of completion blocks, right?
530
So would you use the, how you, you know, today in your work or in your pet project,
531
why would you prefer using the completion blocks for such functions?
532
No, I prefer using a SyncAway.
533
A SyncAway, yeah.
534
So this could be also mentioned in a way, but I know that you know it.
535
So just to be clear here.
536
You see inside the function, there are multiple completions, right?
537
Mm -hmm.
538
And multiple places.
539
Do you know any way to move this completion just in one place?
540
That guarantees that it's always called?
541
Yeah, you can like put that. So it's like that.
542
I got it.
543
Yeah, that could be one way.
544
Let's say that inside this task, we have more if else's or garbs inside.
545
For example, when you need to parse do so or do something else. So sorry?
546
Yeah.
547
It's fine.
548
Sorry.
549
Can you repeat, please?
550
Yeah.
551
So let's assume that you have multiple if -else's inside this task.
552
Yeah.
553
Right?
554
So when you need to call...
555
Like it.
556
Yeah.
557
Like here.
558
So let's leave this scenario when you have this.
559
But do you know any way to still call just...
560
you know this completion just once inside the function but without changing the
561
signature without changing yes some way some blog of code
562
that will be guaranteed then there is guarantee
563
that it will be executed before function is returned when everything is finished it will be executed.
564
Yeah, I just want one.
565
Have you heard about that defer?
566
Defer?
567
Yes.
568
Uh -huh, you know what?
569
Let's see how we would do it.
570
I already know about in -out and defer,
571
but I can't apply in this situation.
572
No, no, it's fine fine just so you know
573
that in some scenarios
574
when you need to return after all the code is you know run best practice to use return
575
or defer it's just you know as just a simple block that will be called
576
um after function returned that could be better
577
if you're using still such the completions
578
when you need to you know do this but
579
and how are you use here yeah yeah exactly here you would return here
580
but you need to provide then you create before defer a variable
581
that holds inside possibly data so you would as you would work with the data it would be nil or something
582
And if you would have an error as well in the part of the completion block, then you would need to do the same.
583
So it's either exists or by default just an ilk and it will be executed after this task finished.
584
Right.
585
And then let's just maybe check one more example.
586
Yeah.
587
Just wondering, have you worked with the SwiftUI?
588
Yes, my main background is SwiftUIKit.
589
But have you really worked with SwiftUI in a way?
590
Yeah, in just views.
591
Okay, got it.
592
Let's maybe combine it.
593
Okay, so UIKit you said, right.
594
Gonna be simple example, too simple for you.
595
Just drop it to you.
596
This one?
597
Yep.
598
Any problems here?
599
Any problems?
600
Yeah.
601
We have chains in global QA.
602
It's what's being the main QA and also it would be better
603
if you have thread safe
604
or thread safe nor everything cycle safe to to view i would say
605
that you don't need it here you can
606
because you can assume that's it just
607
but yeah i prefer using every time for safety
608
but then what would be
609
if you hear instead of async main async will use main sync would be any difference yeah
610
when you use sync you are like stuck the the codes the the view
611
and and the codes will would be as acute
612
so the layout it's it's what's stuck in the the view
613
but is it is it always true that it will be stuck.
614
Oh, it's true?
615
Yeah, I mean, why even this sync exists then?
616
So, can we use it sometimes?
617
Or is it always?
618
Yeah, if you have a very important info or you need like
619
code to be executing in the same type that you want, it would be better use sync.
620
Okay.
621
Right.
622
But let's say today, can you, can you maybe change this code in a way
623
that you don't need to use the async dispatch queue main async at all?
624
What we should change here?
625
So we know that this function called of the data loaded, right?
626
So inside, let's say some background queue where we did some requests.
627
How you can change it. So.
628
Because I would say that we don't need to use this dispatch code main thing at all.
629
Yeah, because you mean that it's...
630
If the functions wouldn't be called from an API, you mean?
631
Like, let's say you're using...
632
In today's code, you have some background work, right?
633
You have background request.
634
And then you have such view controller with this kind of load data.
635
How to change this code so you don't need to use dispatch queue main async.
636
So it's always executed on the main.
637
Because, you know, dispatch queue main async just creates this kind of doom effect, like spacing, you know, you just wrapped up it to some part of code.
638
You mean like put some main actor here? For example.
639
Part of here?
640
Okay, interesting, yes.
641
Right, and the interesting question would be, does view controller here in the class view controller,
642
is it main actor or not?
643
It can be, but in this case, no. It's just the function.
644
If you didn't put it here, yeah.
645
So if it's just like that.
646
Yeah, it's just like
647
that just this code block is all being the main actor
648
i got it i got it yeah i mean then we can wrap up
649
so just for for comment for this one would be nice to know for you
650
that in this example view controller is main actor really yeah that's the interesting thing to remember
651
because if you go inside UIViewController, if you open it, somehow in your project inside,
652
you will see that in today's iOS development, all the UIViewControllers, all the UIViews,
653
they are inherent from or they have main actor basically.
654
So all your views, all your controllers, if they are part of the UIViewController, then they are by default,
655
they have main actor, meaning you don't need to put main actor at all.
656
It will always run this function on the main.
657
So the only thing that you would need to do to be sure that your changes...
658
If you're using async await, nothing you need to do.
659
It becomes hard.
660
Yeah, absolutely.
661
So you'll just call it then because actors and async await knows how to switch the context,
662
knows that this part of code should be run on the background and this part of code.
663
Now, you know, returning back from the context to this actor and running this part of code here.
664
But that's purely safe.
665
The only moment when you need to put these kind of marks, main actors, when you have your personal classes, like some view models, you know, something like that.
666
Yeah, I understood.
667
So then you, of course, need to think, should you put it there or not?
668
Usually, yes if you do something related to view you just put main actor on top of the class
669
but now in the modern iOS I think that comes with a new release
670
all the classes if I remember correctly will be by default
671
everything will be by default main actor as it's supposed to be all the properties
672
and you can turn it off for some functions if you need very nice I didn't know about it Yeah, so it's interesting.
673
Yeah, I think it's useful to remember for your code.
674
Yeah, very useful.
675
If you just put it as, sometimes people are putting dispatch queue main as sync or running main actors for no reason, basically.
676
Because every time you're putting it to the code, meaning that you're just delaying it for some amount of, you know, nanoseconds, whenever, this part of code.
677
At the same time, it could be executed instantly.
678
And sometimes it affects your, it could affect your animation or some presentation, you know, in a weird way.
679
Instead of being a smooth, it could just be a little bit delayed and then presented for no reason.
680
When you can actually just, yeah, you know, use it.
681
To remove it, yeah.
682
Yeah.
683
Let's wrap up in general, Ramiro.
684
I think we did a great job.
685
So how do you feel about the...
686
running through this interview?
687
Was it hard for you?
688
Was it easy for you?
689
Yeah, it was hard to me.
690
Now I know that I need to study some points.
691
I have some lack of knowledge.
692
But it would be very nice to me to see what they want for me
693
and what I need to study more and I did some notes that you told to me.
694
Yep, sure.
695
You can always, if you have some questions or something,
696
I can reconcile what was the problem, what was the questions.
697
But in general, I think it was a really good session.
698
It's very different for interviews in Brazil, you know?
699
Yeah, yeah, it's very different because in Brazil,
700
they wouldn't know more about the real job you know like uh
701
and you this interviewer knew about the the knowledge of the
702
the the the the deep knowledge of the swift was very nice to to to have this interview thank you
703
so much yes thank you i i should say that all the all the interviews,
704
all the how it behaves, it really depends on the company, right, on the situation, because usually when we're interviewing someone to the company,
705
we're not just interviewing some random person to random position, there is actual position actual team,
706
actual expectation from this person and that gives more context usually to the
707
to the interview here on the mock interview on the other
708
side we have to go generally about things you know just pick more general topics of course
709
if you would interview to you know some audio company we
710
would talk about the audio you know core core core kids you know some
711
very different frameworks audio frameworks
712
and how you would work with this it's really depends to become where you're going
713
but i think so that that was a great
714
going through all these topics sections so i hope it was useful for you and uh
715
that's that's pretty much it thank you very much thank you for your time yes bye

이 레슨에 대해

"Mastering iOS Development: Mock Interview with Ramiro Neto"으로 쉐도잉 기법을 사용해 영어를 연습합니다.

매일 15~30분 꾸준히 연습하면 IELTS 스피킹에 대한 자신감이 길러집니다.

쉐도잉이란? 영어 실력을 빠르게 키우는 과학적 방법

쉐도잉(Shadowing)은 원래 전문 통역사 훈련을 위해 개발된 언어 학습 기법으로, 다언어 학자인 Dr. Alexander Arguelles에 의해 대중화된 방법입니다. 핵심 원리는 간단하지만 매우 강력합니다: 원어민의 영어를 들으면서 1~2초의 짧은 지연으로 즉시 소리 내어 따라 말하는 것——마치 '그림자(shadow)'처럼 화자를 따라가는 것입니다. 문법 공부나 수동적인 청취와 달리, 쉐도잉은 뇌와 입 근육이 동시에 실시간으로 영어를 처리하고 재현하도록 훈련합니다. 연구에 따르면 이 방법은 발음 정확도, 억양, 리듬, 연음, 청취력, 말하기 유창성을 크게 향상시킵니다. IELTS 스피킹 준비와 자연스러운 영어 소통을 원하는 분들에게 특히 효과적입니다.