رونوشت 🔗
1
00:00:03,181 --> 00:00:05,671
Leo Dion (host): Welcome to
another episode of Empower Apps.
2
00:00:05,851 --> 00:00:07,431
I'm your host, Leo dn.
3
00:00:07,641 --> 00:00:10,881
Today I'm joined by Natalia Panferova.
4
00:00:11,826 --> 00:00:12,046
Natalia Panferova (guest): Hi.
5
00:00:12,046 --> 00:00:13,086
Really excited to be here.
6
00:00:14,111 --> 00:00:14,401
Leo Dion (host): Yeah.
7
00:00:14,661 --> 00:00:16,856
so I'll let you go ahead
and do the introduction.
8
00:00:17,797 --> 00:00:18,477
Natalia Panferova (guest):
Hi, I'm Natalia.
9
00:00:18,987 --> 00:00:23,907
I am based in New Zealand and I'm an iOS
developer and macOS developer now as well.
10
00:00:24,237 --> 00:00:27,557
I work at Nil Coalescing, which is
a small company I founded together
11
00:00:27,557 --> 00:00:29,437
with my partner a few years ago.
12
00:00:29,937 --> 00:00:34,917
we do some consulting and freelancing,
and we have a blog, nilcoalescing.com/blog
13
00:00:35,952 --> 00:00:38,632
.
Leo Dion (host): Yeah, we've been
chatting about your, just a couple of
14
00:00:38,632 --> 00:00:43,872
your blog posts you've done with macOS,
but you have a new book out, right?
15
00:00:44,362 --> 00:00:45,592
SwiftUI Essentials.
16
00:00:45,592 --> 00:00:46,792
You wanna talk about that a little bit?
17
00:00:47,402 --> 00:00:47,692
Natalia Panferova (guest): Sure.
18
00:00:47,692 --> 00:00:47,972
Yeah.
19
00:00:47,972 --> 00:00:49,652
It just went out last week.
20
00:00:49,982 --> 00:00:52,302
it's called SwiftUI
Fundamentals and it's a guide.
21
00:00:53,427 --> 00:00:56,247
On the course framework,
principles and APRs.
22
00:00:56,677 --> 00:00:58,167
It's something I wanted
to write for a while.
23
00:00:58,277 --> 00:01:01,817
Just never Got a chance to sit
down and write that for a bit.
24
00:01:02,207 --> 00:01:05,617
Yeah, and it's sort of combines my
experience and my knowledge from working,
25
00:01:06,037 --> 00:01:09,567
with SwiftUI since it was released,
but also working on the course with
26
00:01:09,767 --> 00:01:13,417
I team at Apple, from 2020 to 2022.
27
00:01:14,517 --> 00:01:19,067
So, after I left Apple, I worked a
bit in the industry and I noticed
28
00:01:19,067 --> 00:01:22,902
that . The framework obviously
became very popular, but there are
29
00:01:22,902 --> 00:01:25,542
still a few misunderstandings and
some people find it quite difficult
30
00:01:25,602 --> 00:01:28,622
to understand how it actually works
and why it works the way it does.
31
00:01:29,082 --> 00:01:33,712
So I was hoping that guide could
help to clarify some things and
32
00:01:33,822 --> 00:01:36,352
help people to use the framework
more effectively in their project.
33
00:01:37,352 --> 00:01:39,832
Leo Dion (host): Yeah, we've done
a lot of episodes on SwiftUI.
34
00:01:39,862 --> 00:01:41,882
people are still trying
to figure everything out.
35
00:01:42,942 --> 00:01:47,322
we had some really great episodes
with Ariel and, Craig and a
Load full transcript
few
36
00:01:47,322 --> 00:01:50,952
other folks, It's really odd to
have you on, you actually worked
37
00:01:50,952 --> 00:01:52,432
on SwiftUI when you were at Apple.
38
00:01:52,862 --> 00:01:53,362
Natalia Panferova (guest): Yes, I did.
39
00:01:53,442 --> 00:01:55,002
I worked on the core SwiftUI team.
40
00:01:55,002 --> 00:01:59,082
Back then, we were just 10 people and
we were focusing on iOS APIs, like the
41
00:01:59,082 --> 00:02:02,282
core APIs, like navigation, search, text,
42
00:02:02,497 --> 00:02:04,327
Leo Dion (host): and They didn't
severance you or anything, right?
43
00:02:04,477 --> 00:02:05,927
Natalia Panferova (guest):
Yeah, I remember some.
44
00:02:06,007 --> 00:02:08,847
I don't remember everything,
but I remember hopefully
45
00:02:08,847 --> 00:02:09,647
the most important things.
46
00:02:09,797 --> 00:02:13,337
Leo Dion (host): So like, what
are the things that most people
47
00:02:14,507 --> 00:02:16,377
don't get about Swifty y.
48
00:02:17,377 --> 00:02:19,487
Natalia Panferova (guest): I think,
it's a bit too magical for most people.
49
00:02:19,557 --> 00:02:22,487
Like it does some things and
you dunno why it does them.
50
00:02:22,747 --> 00:02:23,877
it's trying to be really clever.
51
00:02:24,297 --> 00:02:27,627
So like a lot of work behind
the scenes goes into figuring
52
00:02:27,727 --> 00:02:28,867
out how to do the best thing.
53
00:02:29,157 --> 00:02:29,947
Outta the box.
54
00:02:30,127 --> 00:02:33,307
So you just define a view and
it just works and it works
55
00:02:33,307 --> 00:02:34,787
differently, different contexts.
56
00:02:35,487 --> 00:02:38,807
So like under the hood, CI has
this environment which we can also
57
00:02:38,827 --> 00:02:42,247
use for our own values or reading
the values from the environment.
58
00:02:42,247 --> 00:02:46,877
But CI also uses that to understand
what context the current view is on and
59
00:02:47,057 --> 00:02:50,907
how To display it, it can be completely
different based on the platform or
60
00:02:50,907 --> 00:02:54,707
it can be different based on where
in their hierarchy it's presented.
61
00:02:54,707 --> 00:03:01,557
Like buttons can look completely different
in navigation bar in sidebar, in, slide
62
00:03:01,557 --> 00:03:05,337
their actions and they just look a bit
different depending on where they are.
63
00:03:06,337 --> 00:03:06,627
Leo Dion (host): Yeah.
64
00:03:06,787 --> 00:03:09,827
'cause that really reminds me of
what Paul was saying, Paul Hudson,
65
00:03:09,827 --> 00:03:13,187
talking about how, like, yeah, it
depends on the platform, where it's
66
00:03:13,427 --> 00:03:17,827
situated, it's a markup, and then
kind of you're handing off Apple
67
00:03:18,007 --> 00:03:20,547
to deliver the way they feel fit.
68
00:03:21,287 --> 00:03:26,387
what might be some tips you
have for someone who, who's just
69
00:03:26,387 --> 00:03:27,887
getting started with SwiftUI?
70
00:03:29,122 --> 00:03:32,302
And does it have any knowledge
of UI kit, which is becoming
71
00:03:32,332 --> 00:03:33,862
more often the case than not?
72
00:03:34,602 --> 00:03:36,202
for getting started with SwiftUI.
73
00:03:37,052 --> 00:03:38,952
Natalia Panferova (guest): I think
as you just get started, You can
74
00:03:38,952 --> 00:03:40,712
just get started with UI and build.
75
00:03:40,907 --> 00:03:43,417
quite complex apps without UIC knowledge.
76
00:03:43,867 --> 00:03:49,027
I would recommend to not fight the
framework, but sort of work with it and
77
00:03:49,647 --> 00:03:54,097
customize things you can customize maybe
if something is not quite working out
78
00:03:54,097 --> 00:03:55,617
adjust your app design a little bit.
79
00:03:55,847 --> 00:03:59,977
It's gonna be easier and more robust
in the future because if you start
80
00:03:59,977 --> 00:04:03,187
to hack it, it's just going to break
with the next release So that's
81
00:04:03,187 --> 00:04:04,907
what I try to do in my own projects.
82
00:04:04,907 --> 00:04:06,147
And when I work in companies as well.
83
00:04:06,227 --> 00:04:09,747
I would talk to the designers saying,
this is a great design, but it's gonna
84
00:04:09,747 --> 00:04:10,667
be really difficult to implement.
85
00:04:10,667 --> 00:04:12,907
Can be adjusted slightly like
this 'cause it's gonna be.
86
00:04:13,412 --> 00:04:17,857
Easier, faster, and it'll be working
better in the future as well.
87
00:04:18,517 --> 00:04:20,737
So that's, I think, one way to look at it.
88
00:04:21,587 --> 00:04:26,087
but I think like as you progress, it's
still useful to learn your kid, firstly
89
00:04:26,087 --> 00:04:31,287
because a lot of C two APIs still rely on
your APIs under the hood, like the push
90
00:04:31,397 --> 00:04:33,607
navigations, the model presentations.
91
00:04:33,707 --> 00:04:38,407
And then a few things you might need
to integrate with UI Kit to support.
92
00:04:39,497 --> 00:04:43,357
So I think as like, you don't
need to tell them both frameworks
93
00:04:43,477 --> 00:04:47,437
straight away, but it's useful to
know them both in the end, I think.
94
00:04:48,757 --> 00:04:51,207
Leo Dion (host): what are some pet
peeves you've heard people tell you
95
00:04:51,217 --> 00:04:56,017
about SwiftUI and what do you think
are some misunderstandings that people
96
00:04:56,017 --> 00:04:58,537
would have to have those pet peeves,
97
00:04:58,627 --> 00:05:00,877
Natalia Panferova (guest): Yeah, I think
definitely state management and like
98
00:05:00,937 --> 00:05:05,837
the data flow and how to structure it
is a hard one, for many people to get, I
99
00:05:05,837 --> 00:05:09,077
think straight away, especially because
it changed over the years as well.
100
00:05:09,347 --> 00:05:12,317
Like at first we had all of these
like property wraps and you had to
101
00:05:12,447 --> 00:05:15,437
understand them all and choose the
correct ones, and now it's a bit less.
102
00:05:16,377 --> 00:05:20,077
But yeah, it just changed recently,
so people just started to get
103
00:05:20,077 --> 00:05:22,677
the, the previous way and now
it's a new way and it's all bit
104
00:05:22,842 --> 00:05:23,522
Leo Dion (host): do you prefer?
105
00:05:24,587 --> 00:05:26,947
Natalia Panferova (guest): I use the
new way now in my projects, like with
106
00:05:26,947 --> 00:05:31,067
observable and state, just because it's
supposed to be more performant because
107
00:05:31,067 --> 00:05:32,547
observable object had some issues.
108
00:05:32,547 --> 00:05:34,587
That's why I guess observable was done.
109
00:05:34,762 --> 00:05:35,112
Leo Dion (host): Right,
110
00:05:35,212 --> 00:05:37,272
Natalia Panferova (guest): but it
took me like probably a few months
111
00:05:37,332 --> 00:05:38,992
to switch to the new way as well.
112
00:05:39,121 --> 00:05:40,271
Leo Dion (host): Right, right.
113
00:05:40,501 --> 00:05:40,791
Yeah.
114
00:05:41,431 --> 00:05:45,431
I mean I've pretty much gone all
in on observation with anything
115
00:05:45,431 --> 00:05:48,791
that can support that os 'cause
that's the other issue, right?
116
00:05:48,851 --> 00:05:52,191
Is like if you have to support
it old enough os then you
117
00:05:52,191 --> 00:05:53,911
can't use the new shiny stuff.
118
00:05:54,691 --> 00:05:58,591
one of the things you've been
talking about in your blog is scenes.
119
00:05:59,151 --> 00:06:03,751
I think that is a concept people
don't understand, and how they work.
120
00:06:03,771 --> 00:06:06,151
We kind of just have
usually one scene, right?
121
00:06:06,691 --> 00:06:08,271
and then everything goes into that.
122
00:06:08,461 --> 00:06:11,751
what do you think people are missing
when it comes to scenes In SwiftUI?
123
00:06:12,747 --> 00:06:14,027
Natalia Panferova (guest): I think
people maybe don't think about
124
00:06:14,027 --> 00:06:16,627
scenes so much because you create a
new project and it's already there.
125
00:06:16,687 --> 00:06:19,067
The window group, which
probably most apps use.
126
00:06:19,647 --> 00:06:23,367
the trick to understand is
that it's not one scene.
127
00:06:23,367 --> 00:06:24,807
It's like actually multiple scenes.
128
00:06:24,807 --> 00:06:27,697
CUI will create as people open
new windows, it doesn't work
129
00:06:27,697 --> 00:06:30,737
this way on iPhone because you
can only open one window of
130
00:06:30,836 --> 00:06:31,186
Leo Dion (host): Right,
131
00:06:31,396 --> 00:06:33,886
Natalia Panferova (guest): Most apps
will probably still run on the iPad and
132
00:06:33,886 --> 00:06:35,686
that people can open multiple windows.
133
00:06:36,446 --> 00:06:40,026
If you use the window group well,
which you probably will, and
134
00:06:40,336 --> 00:06:42,346
each scene will have a new state.
135
00:06:42,446 --> 00:06:47,266
So like if you have a state you want to
preserve for the entire app, so that it's
136
00:06:47,326 --> 00:06:50,146
the same consistent state in every scene.
137
00:06:50,146 --> 00:06:52,896
For example, you have some counter
or something and you want to have it.
138
00:06:53,836 --> 00:06:57,356
be the same in every scene, then you
have to put it on the top level in the
139
00:06:57,376 --> 00:07:02,916
app because if you initialize that state
object inside the content view or any
140
00:07:02,916 --> 00:07:04,836
other view, it's going to be reset.
141
00:07:04,906 --> 00:07:09,156
Like it's because since will create
a new hierarchy from scratch with new
142
00:07:09,156 --> 00:07:11,426
state, and everything for every scene.
143
00:07:11,646 --> 00:07:13,586
So that's something to
keep in mind, I think.
144
00:07:14,581 --> 00:07:17,541
Leo Dion (host): I think for me,
like SI didn't get scenes until I
145
00:07:17,541 --> 00:07:19,461
started doing Mac OS development.
146
00:07:19,701 --> 00:07:22,941
'cause then like you said, you could have
multiple windows and things like that.
147
00:07:23,101 --> 00:07:25,621
I guess iPad, you could
have multiple scenes, right?
148
00:07:25,621 --> 00:07:27,341
Because technically you
could have multiple windows.
149
00:07:28,241 --> 00:07:34,241
So, and I would assume Vision OS and I
don't know about TV or definitely not
150
00:07:34,241 --> 00:07:38,741
watch, Yeah, that's I think where you, you
really see where scenes are, are useful.
151
00:07:39,331 --> 00:07:44,871
So there's like scene storage and then
there's app storage, what, what are
152
00:07:44,871 --> 00:07:46,471
all those and what are they useful for?
153
00:07:47,471 --> 00:07:50,596
Natalia Panferova (guest): Yeah, so these
are some helpers of property robots that
154
00:07:50,616 --> 00:07:55,866
we can use to store some small amount
of data app storage is just wrap around
155
00:07:55,866 --> 00:08:00,836
user defaults, so that's something you
want to persist, between, app launches
156
00:08:01,516 --> 00:08:03,196
reliably, but it has to be quite small.
157
00:08:03,386 --> 00:08:04,636
Same as user defaults.
158
00:08:05,711 --> 00:08:09,011
So it could be some username
or some other user setting.
159
00:08:09,311 --> 00:08:11,991
Some configurations that you want to
persist, you can store them there.
160
00:08:12,901 --> 00:08:15,521
And since storage, it's
for state management.
161
00:08:15,631 --> 00:08:19,371
This is something if you want to
persist the app state between, launches.
162
00:08:20,121 --> 00:08:23,021
It also has to be quite
small amount of data,
163
00:08:23,361 --> 00:08:25,041
I does not guarantee it's
gonna be saved because.
164
00:08:26,516 --> 00:08:31,096
If the app is quit, it's going to
be cleared or if the app terminates.
165
00:08:31,476 --> 00:08:34,056
and so if I didn't have time to save
it, it's also going to be cleared.
166
00:08:34,476 --> 00:08:38,576
But it's not like, it's just the app
state, so it's not a disaster if it's
167
00:08:38,576 --> 00:08:40,136
not persisted, but it's
nice if it is.
168
00:08:41,136 --> 00:08:45,086
Leo Dion (host): It's like, does
it use, so like with, with, okay.
169
00:08:46,486 --> 00:08:51,516
Sorry, with Mac Os you have like Windows
State and that's stored somewhere in
170
00:08:52,186 --> 00:08:54,876
like app group or, you know what I mean?
171
00:08:55,296 --> 00:08:57,636
But that's different from
seeing storage or app storage.
172
00:08:57,776 --> 00:09:00,356
App storage is basically user defaults.
173
00:09:00,356 --> 00:09:00,556
Right.
174
00:09:01,001 --> 00:09:02,621
Natalia Panferova (guest): App search
is user default under the hood.
175
00:09:02,621 --> 00:09:05,931
Leo Dion (host): SwiftUI previews, What
are some tips you have for using them?
176
00:09:06,591 --> 00:09:09,931
do you always try to have a SwiftUI
preview in all your views, or
177
00:09:09,991 --> 00:09:12,811
are you just kinda like, I give
up, this isn't worth my time?
178
00:09:13,807 --> 00:09:15,852
Natalia Panferova (guest): Yeah,
I try to have previews for smaller
179
00:09:16,022 --> 00:09:21,637
views where it's faster to build the
UI With Swift, I don't have mockups
180
00:09:21,657 --> 00:09:24,947
or something I used to in Sketch, but
now I just usually build something
181
00:09:24,947 --> 00:09:26,267
and see how it looks straight away.
182
00:09:26,327 --> 00:09:29,567
So for that I use the previous
just sort of design with SwiftUI
183
00:09:30,421 --> 00:09:30,771
Leo Dion (host): right.
184
00:09:30,967 --> 00:09:32,207
Natalia Panferova (guest): I
would do that for smaller views.
185
00:09:32,937 --> 00:09:36,587
usually and something like content
view or some like wrap reviews,
186
00:09:36,707 --> 00:09:37,667
I usually just delete them.
187
00:09:39,107 --> 00:09:42,347
Leo Dion (host): I basically do the
design in a separate clean Xcode project.
188
00:09:43,602 --> 00:09:47,082
I can make the design as complicated
as I want and just hard code a bunch
189
00:09:47,082 --> 00:09:52,002
of values and then copy it over and
then put everything to a state instead
190
00:09:52,052 --> 00:09:56,952
One thing I wanted to ask about was,
so we talked about Swift eye previews,
191
00:09:58,132 --> 00:10:01,242
let's talk about layout and I mentioned
geometry reader and things like that.
192
00:10:01,312 --> 00:10:04,482
What are some ways of getting
around some of the pet peeves,
193
00:10:04,732 --> 00:10:05,922
sorry to use that term again.
194
00:10:06,652 --> 00:10:10,262
with or some of the things that
bug people when it comes to layout.
195
00:10:11,182 --> 00:10:13,822
'cause I know we got some custom
layout stuff that we can do now,
196
00:10:14,442 --> 00:10:17,397
but, People still struggle and
sometimes they still end up using
197
00:10:17,437 --> 00:10:18,957
Geometry Reader and things like that.
198
00:10:19,467 --> 00:10:24,117
What are people doing wrong
when they maybe are overusing
199
00:10:24,117 --> 00:10:25,877
those or don't need to use them
200
00:10:25,977 --> 00:10:27,297
Natalia Panferova (guest): I
use geometry sometimes as well.
201
00:10:27,377 --> 00:10:29,777
I think the important part is
not to create like a cycle.
202
00:10:29,797 --> 00:10:33,117
If you use the geometry, they
have to be careful not to, to
203
00:10:33,117 --> 00:10:35,677
like read the geometry, write it
somewhere else, so it's horrendous.
204
00:10:35,727 --> 00:10:36,017
Leo Dion (host): Okay.
205
00:10:36,667 --> 00:10:39,067
Natalia Panferova (guest): I think
I know there are few more tools now,
206
00:10:39,597 --> 00:10:43,477
like few new APIs that can help us
to avoid using the geometry rhythm.
207
00:10:43,667 --> 00:10:48,057
Like I saw there's container relative
frames, I think something we can use.
208
00:10:48,277 --> 00:10:51,497
And the other few like things
for scrolling as well that are
209
00:10:51,497 --> 00:10:52,617
helpful now I think as well.
210
00:10:53,487 --> 00:10:54,287
I could layout and.
211
00:10:54,697 --> 00:10:56,262
Can be different from
a few other frameworks.
212
00:10:56,522 --> 00:11:01,482
So you have to sort of get it how it
works, like how, the size is allocated.
213
00:11:01,502 --> 00:11:05,062
The fact that you can't force
a size on a view, it just will
214
00:11:05,062 --> 00:11:06,222
be the size it wants to be.
215
00:11:07,092 --> 00:11:07,812
How F works.
216
00:11:07,962 --> 00:11:12,692
It's actually not like, it's just
another view wrapped in your view.
217
00:11:12,762 --> 00:11:15,652
It's not like it doesn't assign the
frame to your view, it's just another
218
00:11:15,652 --> 00:11:17,532
view with that frame that drops
219
00:11:17,552 --> 00:11:18,732
Leo Dion (host): Mm.
Yeah, that makes sense.
220
00:11:20,152 --> 00:11:24,802
and I remember having Chris ID off on
and talking about how Sizes the way
221
00:11:24,802 --> 00:11:29,042
they're suggested in the hierarchy,
like how a size might be suggested
222
00:11:29,042 --> 00:11:32,162
by a parent or a child, and I don't,
do you know what I'm talking about?
223
00:11:32,917 --> 00:11:34,617
Natalia Panferova (guest): So
like the parent suggest the
224
00:11:34,727 --> 00:11:35,007
Leo Dion (host): that work?
225
00:11:35,707 --> 00:11:37,397
Natalia Panferova (guest): so
it starts with the fresh app.
226
00:11:38,197 --> 00:11:42,647
the parent use, I create, and then it
suggests the space to the root view,
227
00:11:42,667 --> 00:11:47,647
the content view, and then the content
view, suggests this space, this child,
228
00:11:47,707 --> 00:11:51,527
and then the child says, okay, I want to
be that big, based on that suggestion.
229
00:11:51,527 --> 00:11:54,167
And then the parent says,
okay, this is the space I have.
230
00:11:54,497 --> 00:11:57,537
the child wants to be that big,
so I will position it here.
231
00:11:57,677 --> 00:11:59,047
most often it's in the middle.
232
00:12:00,057 --> 00:12:02,177
if you do geometry for
example, it'll go to the top.
233
00:12:02,277 --> 00:12:05,977
So like the parent decides how, where
to position the child, well, the child
234
00:12:06,047 --> 00:12:07,857
decides how to size itself based on that.
235
00:12:08,857 --> 00:12:10,157
Leo Dion (host): It makes complete sense.
236
00:12:10,647 --> 00:12:11,767
Do you still use combine,
237
00:12:12,887 --> 00:12:13,947
so, how do you use it?
238
00:12:14,457 --> 00:12:17,017
Natalia Panferova (guest): I didn't
use it that much like over the whole
239
00:12:17,017 --> 00:12:20,817
time because it was a research UI
and like search UI obviously relied
240
00:12:20,817 --> 00:12:21,937
heavily on it, so I did use it.
241
00:12:22,652 --> 00:12:26,422
When I used observable objects
but didn't use like that much.
242
00:12:26,482 --> 00:12:29,852
All the other features of combined,
because I worked with Swiss for one year
243
00:12:29,852 --> 00:12:30,812
and then I started working at Apple.
244
00:12:31,312 --> 00:12:33,352
Leo Dion (host): do you have any
use cases where you use it now?
245
00:12:33,682 --> 00:12:34,862
in any of your client apps?
246
00:12:35,542 --> 00:12:36,862
Natalia Panferova (guest):
I use sync sometimes, like
247
00:12:37,002 --> 00:12:39,342
to, to like sync on a value.
248
00:12:39,562 --> 00:12:45,392
I used that when I was integrating with
UI Kit and I had to observe the changes
249
00:12:45,532 --> 00:12:47,472
to like an observable class in UI kit.
250
00:12:47,472 --> 00:12:50,912
So you have to like call sync
to update manually your UI kit
251
00:12:51,112 --> 00:12:53,452
Leo Dion (host): Are you using
like key value observation and then
252
00:12:54,332 --> 00:12:55,532
creating a publisher from that?
253
00:12:55,847 --> 00:12:58,267
Natalia Panferova (guest): For example,
you have observable object, which is
254
00:12:58,267 --> 00:13:01,147
the older way and you have a published
property and then you create the
255
00:13:01,147 --> 00:13:05,167
cancelable, you save it and then you
sync, on that published property and
256
00:13:05,187 --> 00:13:07,927
you get a callback when it changes
and then you can make your update.
257
00:13:07,927 --> 00:13:08,607
You like it view.
258
00:13:08,607 --> 00:13:10,847
That's how I create it.
259
00:13:10,847 --> 00:13:13,487
And like two way connection
between UA and UI kids.
260
00:13:14,587 --> 00:13:16,747
Leo Dion (host): I think it makes sense
when you have something that's like,
261
00:13:16,747 --> 00:13:18,627
starts off already being a publisher.
262
00:13:19,542 --> 00:13:22,872
Like a timer or a notification
or any of that stuff.
263
00:13:23,652 --> 00:13:27,912
But otherwise, like if you're doing
a network call, yeah, I am pretty
264
00:13:27,912 --> 00:13:31,352
much been doing all async weight
now when it comes to that stuff.
265
00:13:31,942 --> 00:13:32,622
Natalia Panferova (guest):
I was going to say.
266
00:13:32,622 --> 00:13:32,902
Leo Dion (host): Have you
267
00:13:32,922 --> 00:13:33,892
Natalia Panferova (guest):
and it was already, so
268
00:13:34,642 --> 00:13:37,212
Leo Dion (host): Have you had any
issues doing async weight in Swifty
269
00:13:38,212 --> 00:13:39,972
Natalia Panferova (guest): I don't
think I had any, but I'm not sure, like
270
00:13:39,972 --> 00:13:44,242
a hundred percent I'm using every time
correctly . So yeah, I'm using it and,
271
00:13:44,657 --> 00:13:45,577
Leo Dion (host): how are you doing it?
272
00:13:45,722 --> 00:13:46,012
Natalia Panferova (guest): Yeah.
273
00:13:46,172 --> 00:13:46,692
I use tasks.
274
00:13:46,852 --> 00:13:49,972
I know that you shouldn't be using
too many tasks because it can like,
275
00:13:49,972 --> 00:13:54,072
create way too many, threads for you
and then it's gonna be a problem,
276
00:13:54,092 --> 00:13:57,032
but I don't usually have that many
tasks, so it's still, it's working.
277
00:13:57,182 --> 00:13:59,002
Leo Dion (host): how did you
get started in development?
278
00:14:00,002 --> 00:14:04,102
Natalia Panferova (guest): It was, a while
ago and I started with Java 'cause I was
279
00:14:04,102 --> 00:14:06,342
going to study computational linguistics.
280
00:14:06,362 --> 00:14:10,022
So I was learning data structures,
algorithms, and then I was learning
281
00:14:10,252 --> 00:14:13,462
Java and Python because that's
like, especially Python is what
282
00:14:13,462 --> 00:14:14,382
was going to be used mostly.
283
00:14:15,327 --> 00:14:19,907
Then I got a job, doing web . So
I just didn't go to study.
284
00:14:19,907 --> 00:14:23,507
In the end, I was just working,
doing some frontend development.
285
00:14:24,207 --> 00:14:26,457
then I learned full stack
development as well.
286
00:14:26,947 --> 00:14:29,877
after that I started learn iOS
because I wanted to experiment with
287
00:14:29,897 --> 00:14:33,757
one project and seemed like iOS was
the right way to do that because
288
00:14:33,787 --> 00:14:35,197
it's self-contained and small.
289
00:14:35,197 --> 00:14:36,777
But you can still sell your products.
290
00:14:37,987 --> 00:14:41,767
Leo Dion (host): is there anything you
miss about not developing for the iPhone?
291
00:14:41,817 --> 00:14:42,377
Natalia Panferova (guest): I still do web
292
00:14:42,407 --> 00:14:43,467
Leo Dion (host): Do you miss Java?
293
00:14:43,847 --> 00:14:44,927
Natalia Panferova (guest):
I don't remember it anymore.
294
00:14:45,047 --> 00:14:46,567
I think I haven't used it for a while.
295
00:14:47,437 --> 00:14:48,257
But I still do web.
296
00:14:48,327 --> 00:14:51,217
most of the web development I
do now is with Swift because I
297
00:14:51,217 --> 00:14:52,377
usually build static websites.
298
00:14:52,477 --> 00:14:54,447
Leo Dion (host): what are you using
to build your static website in
299
00:14:54,562 --> 00:14:55,052
Natalia Panferova (guest): Publish.
300
00:14:55,662 --> 00:14:56,672
it's by John Sandel.
301
00:14:56,702 --> 00:14:59,102
we have our own fork and we're
trying to maintain it somewhat
302
00:14:59,152 --> 00:15:01,652
Leo Dion (host): so how did you end
up at Apple, if you mind me asking?
303
00:15:02,452 --> 00:15:05,142
Natalia Panferova (guest): I was, using
SwiftUI building with SwiftUI since
304
00:15:05,142 --> 00:15:06,702
like the first year it was released.
305
00:15:07,082 --> 00:15:10,902
And I started my blog and I was
publishing articles about whatever,
306
00:15:10,942 --> 00:15:13,862
hacks I came up with because the first
version SwiftUI was really limited.
307
00:15:14,852 --> 00:15:15,272
Leo Dion (host): Mm-hmm
308
00:15:16,002 --> 00:15:18,102
Natalia Panferova (guest): so
the blocks that's growing and.
309
00:15:18,792 --> 00:15:22,117
It was like a different newsletter and
I was posting on Twitter back then,
310
00:15:22,297 --> 00:15:25,437
and then someone from the team reached
out and said, we found your blog.
311
00:15:25,617 --> 00:15:27,517
It looks like you're really
passionate about the framework.
312
00:15:27,517 --> 00:15:28,917
They wouldn't come and work with us.
313
00:15:29,657 --> 00:15:32,337
I started like I interviewed and
then it took like a few months
314
00:15:32,757 --> 00:15:34,097
to get the job in the end,
315
00:15:34,277 --> 00:15:38,137
Leo Dion (host): Right, been doing
Mac os development lately, or did you
316
00:15:38,137 --> 00:15:39,907
just, start doing the macOS stuff?
317
00:15:40,407 --> 00:15:41,307
Natalia Panferova (guest):
So I was doing a bit
318
00:15:41,382 --> 00:15:41,942
Leo Dion (host): you get into it?
319
00:15:42,537 --> 00:15:42,827
Natalia Panferova (guest): Yeah.
320
00:15:43,147 --> 00:15:46,407
I was doing it a bit, before
I joined Apple because I was
321
00:15:46,407 --> 00:15:47,807
like, oh, we have SwiftUI now.
322
00:15:47,847 --> 00:15:48,927
I don't need to learn AppKit.
323
00:15:48,927 --> 00:15:50,507
I can just do something with SwiftUI.
324
00:15:50,527 --> 00:15:54,827
But yeah, I started sort of trying
it out a bit and then I obviously
325
00:15:54,827 --> 00:15:57,907
had to learn a bit more about that
because I was building APIs for Marcos.
326
00:15:58,637 --> 00:16:02,077
it was tricky because like, I don't
know the platform as well as I know iOS.
327
00:16:02,787 --> 00:16:03,077
Leo Dion (host): Okay.
328
00:16:03,287 --> 00:16:05,687
Natalia Panferova (guest): but yes, had to
learn, had to talk to other people because
329
00:16:06,077 --> 00:16:09,777
if you build a text, API, it is going to
be used everywhere, across all platforms.
330
00:16:09,777 --> 00:16:11,897
So you have to make sure
it makes sense everywhere.
331
00:16:12,682 --> 00:16:13,032
Leo Dion (host): Right.
332
00:16:13,137 --> 00:16:13,427
Natalia Panferova (guest): Yeah.
333
00:16:14,062 --> 00:16:18,392
and now recently I just, I have more
time for my own projects now as well.
334
00:16:18,612 --> 00:16:22,192
So I want to try to build more micro
assets just because it's a bit more
335
00:16:22,192 --> 00:16:23,712
fun because it's more new for me.
336
00:16:24,322 --> 00:16:25,652
lots of room for experimentation.
337
00:16:26,672 --> 00:16:29,732
Leo Dion (host): How far back did
you do Mac OS development with 50 Y.
338
00:16:30,382 --> 00:16:32,212
Natalia Panferova (guest): I
tried the first year, 2019.
339
00:16:33,582 --> 00:16:33,872
Leo Dion (host): Okay.
340
00:16:34,172 --> 00:16:36,192
We, and you were like, this is great.
341
00:16:36,212 --> 00:16:39,032
Or were you like, oh, because I
just remember that I had done a
342
00:16:39,032 --> 00:16:42,752
little bit of that kit, not a lot,
and I was just like, this is rough.
343
00:16:43,292 --> 00:16:45,272
Did you, what, how did you feel about it?
344
00:16:46,427 --> 00:16:48,187
Natalia Panferova (guest): Yeah, I
thought it was quite difficult and like
345
00:16:48,187 --> 00:16:51,377
the design was difficult for me as well
to understand what to do with micros.
346
00:16:51,557 --> 00:16:54,537
But with iOS, I sort of understand
what I want with micros,
347
00:16:55,547 --> 00:16:56,677
it's more difficult for me.
348
00:16:57,017 --> 00:16:57,307
Leo Dion (host): yeah.
349
00:16:58,717 --> 00:17:01,527
So, as I've been talking about it on
the podcast, I've been doing a lot of
350
00:17:02,057 --> 00:17:05,727
Mecca West development with Bushel, and
there were some articles that really
351
00:17:05,727 --> 00:17:07,877
interested me, that you had recently.
352
00:17:08,877 --> 00:17:11,247
Well, building like a menu bar utility.
353
00:17:11,667 --> 00:17:18,127
You want to talk about that and like
how cool that is and why, and why.
354
00:17:18,307 --> 00:17:20,927
Why is it so powerful to do in Mac Os?
355
00:17:21,987 --> 00:17:22,507
Natalia Panferova (guest): Sure, yeah.
356
00:17:22,707 --> 00:17:27,147
I wanted to build like a tool for myself,
that, I would use, basically I write my
357
00:17:27,147 --> 00:17:32,867
blog in lockdown and the lockdown parts
that we use, it struggles to par URLs for
358
00:17:32,867 --> 00:17:34,507
Apple Doc, like, when they have brackets.
359
00:17:34,757 --> 00:17:35,927
so like fails every time.
360
00:17:35,927 --> 00:17:37,167
So I have to code them manually.
361
00:17:37,167 --> 00:17:40,527
So I'm like, I just want a tool
that's . I can like press the keyboard
362
00:17:40,807 --> 00:17:43,817
shortcut or something, and I just like
euro code, your codes, euros for me.
363
00:17:43,917 --> 00:17:47,967
So I'm like, oh, it could be a cool
project to try to build as a micros
364
00:17:47,967 --> 00:17:51,127
utility just to learn new things
and I can use it myself as well,
365
00:17:51,347 --> 00:17:54,517
So I thought my new bar would be the
right thing to do because it's quite
366
00:17:54,517 --> 00:17:56,277
limited functionality, maybe too much.
367
00:17:56,447 --> 00:17:58,007
I tried using the menu by extra.
368
00:17:58,007 --> 00:17:58,887
Worked out mostly.
369
00:17:58,997 -->
00:18:00,527
Well, there were a few things.
370
00:18:01,262 --> 00:18:06,352
They were tricky, like sizing the icon to
the custom icon to use for the menu bar.
371
00:18:06,812 --> 00:18:10,412
They had to drive your things, had to
go with some hack in the end then like
372
00:18:10,412 --> 00:18:13,972
presenting settings window, the, the,
in the way that it like behaves the same
373
00:18:13,972 --> 00:18:18,052
way as other settings windows, like,
so it comes to the front straight away,
374
00:18:18,192 --> 00:18:19,732
but then doesn't stay at the front.
375
00:18:19,962 --> 00:18:22,772
Mine stays because I use
floating window for that.
376
00:18:23,207 --> 00:18:23,447
Leo Dion (host): Okay.
377
00:18:24,477 --> 00:18:26,447
Natalia Panferova (guest): Yeah,
or just the fact that you can't
378
00:18:26,447 --> 00:18:28,007
add right click to the menu bar.
379
00:18:28,157 --> 00:18:31,047
like many menu bar apps, you
can right click on them and
380
00:18:31,047 --> 00:18:32,007
they show additional options.
381
00:18:32,117 --> 00:18:33,487
Quit, button.
382
00:18:33,907 --> 00:18:35,127
And I couldn't implement that.
383
00:18:35,177 --> 00:18:37,057
I couldn't find a way to
implement that in my app.
384
00:18:38,232 --> 00:18:42,492
Leo Dion (host): Did you had to do
anything with AppKit or Relic was what's,
385
00:18:43,072 --> 00:18:48,652
is it NSVU Representable or any of that
stuff to like, where have you had, where
386
00:18:48,652 --> 00:18:49,972
have you found the need to do that?
387
00:18:50,072 --> 00:18:51,732
in your macOS app development?
388
00:18:52,127 --> 00:18:54,877
Natalia Panferova (guest): so I
haven't used wrappers, but I did use,
389
00:18:54,977 --> 00:18:57,277
AP Delicate, like n as App Delicate,
390
00:18:58,092 --> 00:18:58,382
Leo Dion (host): Okay.
391
00:18:58,852 --> 00:18:59,352
Natalia Panferova (guest): Yes, yes,
392
00:18:59,352 --> 00:18:59,512
Leo Dion (host): Yeah.
393
00:18:59,622 --> 00:18:59,912
Okay.
394
00:19:01,257 --> 00:19:01,547
Natalia Panferova (guest): yeah.
395
00:19:02,892 --> 00:19:04,382
Leo Dion (host): Well, what
did you have to use it for?
396
00:19:05,382 --> 00:19:06,142
Natalia Panferova (guest):
I think it's something to do
397
00:19:06,142 --> 00:19:07,222
with the startup of the app.
398
00:19:07,322 --> 00:19:08,482
I think maybe it's to present.
399
00:19:09,112 --> 00:19:13,072
I wanted, like when the app is first
opened, I wanted to open the, like,
400
00:19:13,182 --> 00:19:17,002
because when you start the menu bar
app, it just starts with an icon in the
401
00:19:17,002 --> 00:19:18,322
menu bar, but it doesn't open the app.
402
00:19:18,462 --> 00:19:21,842
And I think I used something
from AppKit to open for
403
00:19:22,087 --> 00:19:23,407
Leo Dion (host): you want
it to open the menu bar,
404
00:19:23,457 --> 00:19:23,747
Natalia Panferova (guest): Yeah.
405
00:19:24,652 --> 00:19:27,092
. Leo Dion (host): That's where you
have that like application as agent.
406
00:19:27,532 --> 00:19:29,132
'cause then it thinks,
oh, you just want like.
407
00:19:30,147 --> 00:19:32,947
A menu bar item where it's
like, no, you want a window too.
408
00:19:34,137 --> 00:19:37,837
what are some things if I, an iOS
developer and you want to build your
409
00:19:37,837 --> 00:19:41,517
first Mac app and you want to use
SwiftUI, what are some other things
410
00:19:41,517 --> 00:19:43,317
that maybe somebody should know about?
411
00:19:44,477 --> 00:19:47,537
if they're gonna get
into macOS development.
412
00:19:48,672 --> 00:19:50,792
Natalia Panferova (guest): I think
there's a few more ways to integrate
413
00:19:50,792 --> 00:19:53,912
with the system and I think users
will probably expect more system
414
00:19:53,912 --> 00:19:55,472
integration from Marcos app.
415
00:19:55,642 --> 00:20:01,002
Like you can, add an option to start the
app or start up like a launch login it.
416
00:20:01,112 --> 00:20:02,842
Then you can add system services.
417
00:20:02,842 --> 00:20:04,362
That's what I looked at as well.
418
00:20:05,362 --> 00:20:08,422
Leo Dion (host): Are you looking
at App Store and Sandboxed, or are
419
00:20:08,422 --> 00:20:09,982
you looking at outside App Store.
420
00:20:10,447 --> 00:20:12,347
Natalia Panferova (guest): So for
now App Store, but we are thinking
421
00:20:12,347 --> 00:20:15,387
of building our own platform to sell
apps from, just from our website.
422
00:20:15,387 --> 00:20:19,267
Especially now we have like a book
platform so we could adapt it to sell
423
00:20:19,267 --> 00:20:22,747
apps just because it is probably gonna
be faster and a bit more like we would
424
00:20:22,747 --> 00:20:24,747
be more free to what APIs we can use.
425
00:20:25,747 --> 00:20:29,737
Leo Dion (host): One of the things I've
had to do, is, getting into the NSWindow
426
00:20:29,757 --> 00:20:33,297
API and like assigning a NSWindowDelegate.
427
00:20:33,317 --> 00:20:37,597
I've had to do that quite a bit because
there's certain things I want to do, like.
428
00:20:38,507 --> 00:20:42,447
Get rid of like the minimize
button or other things like that.
429
00:20:42,587 --> 00:20:43,647
Or changing the size.
430
00:20:44,587 --> 00:20:47,367
so I started building bushel not
this year, but the year before.
431
00:20:47,907 --> 00:20:53,007
And I know they've added some stuff
for Windows SwiftUI and Mac Os.
432
00:20:54,137 --> 00:20:56,097
there's a lot of power in that.
433
00:20:57,552 --> 00:21:01,752
That, I've found when it comes to stepping
back to the app kit stuff when I need to,
434
00:21:02,027 --> 00:21:02,317
Natalia Panferova (guest): Yeah.
435
00:21:02,802 --> 00:21:06,302
Leo Dion (host): So another book out
your last year, right, called Swift Gems.
436
00:21:06,972 --> 00:21:09,902
what is that about and how is
that different from your new book?
437
00:21:09,902 --> 00:21:11,022
SwiftUI Essentials.
438
00:21:11,642 -->
00:21:13,567
Natalia Panferova (guest): Yeah, so
Swift Jams is more like a collection of
439
00:21:13,567 --> 00:21:17,527
tips that have been collected over the
years because I think it's fun to find
440
00:21:17,527 --> 00:21:21,057
this like little nuggets of information
that you can use, instead of a book
441
00:21:21,057 --> 00:21:24,457
that you can open on any page and like,
oh, this is a cool Swift feature I can
442
00:21:24,457 --> 00:21:25,977
integrate right now into my project.
443
00:21:26,637 --> 00:21:30,417
And some of them are like syntactic
sugar that will make coat cleaner
444
00:21:31,537 --> 00:21:33,357
or prettier, or some of them are.
445
00:21:34,407 --> 00:21:37,907
for optimization purposes as well, like
some ways to deal with collections,
446
00:21:38,527 --> 00:21:40,567
that could your code as well.
447
00:21:40,747 --> 00:21:44,517
So it's like a few different things
that I've been collecting and I
448
00:21:44,517 --> 00:21:47,997
thought, why not put them into a book
and organize them like by topics?
449
00:21:48,217 --> 00:21:51,477
So it was like a fun thing to do,
especially like last year I was also
450
00:21:51,757 --> 00:21:53,197
employed, so I had a bit less time.
451
00:21:53,247 --> 00:21:56,007
that was a perfect book to write
because I could do it in the evenings.
452
00:21:56,127 --> 00:21:57,927
I didn't have to like sit
down and write it all at once.
453
00:21:58,417 --> 00:22:00,007
Could like write a tip every evening.
454
00:22:01,057 --> 00:22:02,787
Leo Dion (host): What kind of
feedback have you gotten from
455
00:22:02,787 --> 00:22:05,267
people where they're like, oh, I
totally didn't know about that.
456
00:22:05,267 --> 00:22:07,787
Natalia Panferova (guest): the
mostly quite happens that, oh,
457
00:22:07,787 --> 00:22:10,867
there's like so many things I
didn't know that's like amazing.
458
00:22:11,127 --> 00:22:11,987
And I was like, yeah.
459
00:22:12,087 --> 00:22:13,787
And I also like, forget those things.
460
00:22:13,837 --> 00:22:14,837
I remember writing about that.
461
00:22:14,917 --> 00:22:18,237
I should go back to my book and see what I
wrote about that so I can use it as well.
462
00:22:18,297 --> 00:22:19,517
So it's good for me as well.
463
00:22:20,257 --> 00:22:21,257
Leo Dion (host): I think
this has been great.
464
00:22:22,547 --> 00:22:24,517
Natalia, thank you so much
for coming on the show.
465
00:22:24,517 --> 00:22:25,437
I really appreciate it.
466
00:22:26,327 --> 00:22:29,477
or can people find you
and your books, online?
467
00:22:30,182 --> 00:22:31,722
Natalia Panferova (guest):
So it's neil co.com.
468
00:22:31,782 --> 00:22:34,162
So Neil Co is like the operator and Swift.
469
00:22:34,892 --> 00:22:40,212
the blog is neil co.com/blog and
the books is books dot neil co.com.
470
00:22:40,712 --> 00:22:46,432
And I'm also on all sorts of social
platforms like X Masteron, blue Sky,
471
00:22:46,932 --> 00:22:50,292
LinkedIn, so it's at not Rova, on X.
472
00:22:50,512 --> 00:22:54,272
And Masteron Social as
well, not Rova and Blue Sky.
473
00:22:54,272 --> 00:22:55,832
It's also the same, not fer.
474
00:22:57,012 --> 00:22:59,422
Leo Dion (host): Yeah, and we'll have
links to all that in those show notes.
475
00:22:59,522 --> 00:23:00,902
So definitely take a look at that.
476
00:23:01,762 --> 00:23:05,842
thank you so much, Natalia, that was
really good and super informative.
477
00:23:05,842 --> 00:23:06,122
Thank you.
478
00:23:06,957 --> 00:23:07,882
Natalia Panferova (guest):
Thank you for inviting me.
479
00:23:09,152 --> 00:23:10,692
Leo Dion (host): People
can find me online.
480
00:23:11,192 --> 00:23:13,812
Leo g Dion, I'm on all the stuff.
481
00:23:14,192 --> 00:23:17,532
If you're watching this on
YouTube, please like and subscribe.
482
00:23:18,112 --> 00:23:20,892
And if you're listening to this on
your favorite podcast player, please
483
00:23:21,002 --> 00:23:26,452
post a review, share this online,
and we will talk to you again.
484
00:23:26,752 --> 00:23:27,532
Bye everybody.