Leo Dion (host): Hey everybody.
Before we begin the episode today, I wanted to let you know of a few things.
One I'm still open to new opportunities, so if you or your
company needs someone to come in and help with any swift development,
bright digit is available reach out to me, Leo, at bright digit.com.
Or you can go to our, the website right digit.com to get more details.
Let's set up a time to talk and see how I can help you or your team.
With whatever project they're working on.
So yeah, just let me know and I would love to help in any way I can.
Secondly, I'll be speaking at Swift Craft.
This will be in May dates.
You can check that out here and on the website.
And I will be speaking on learning how to count and being
an advanced swift programmer.
So I'll go over some stuff about the history of numbers and mathematics
and how it's related to the evolution and complexities of Swift.
So I would love to see you there if you're gonna be in the UK, in Kent.
Come check it out.
And then I have been doing a live stream every Tuesday and
Thursday at 9:00 AM and I'm hoping to continue to do that as well.
For the foresee future.
I.
I've been doing stuff with bushel and with a new app that I'm working
on that will be revealing soon.
So if you are interested in learning what is coming down the
line, you can definitely want to check out my live stream.
It's on my YouTube channel, bright YouTube dot.
Com slash break digit.
It's also on LinkedIn and on Twitter as well.
If you like what in those live streams, I want to test
some of these features out.
I'm still looking for beta testers for Bushell, and I'd love for you
to join and get an exciting look at what you can do in Bushel.
So definitely check that out.
And lastly, we still have our Patreon, so if you want to get early access
to episodes like this or you want to, get access to upcoming articles
and drafts and a little of the feedback I've been getting from folks.
Super helpful.
Reach out to me and let me know.
That's about it.
So thank you again for joining me for this episode, and I
hope you enjoy the rest of it.
Bye.
Welcome to another episode of Empower Apps.
I'm your host, Leo Dion.
Today I am joined by Craig Clayton.
Craig, thank you so much for coming on today.
Criag Clayton (guest): Thank you for having me.
Leo Dion (host): You are obviously a prolific YouTuber amongst other things.
I'll let you, for those who don't know, I'll let you go
ahead and introduce yourself.
Criag Clayton (guest): All right.
I wouldn't say prolific, but I'm definitely a YouTuber.
Leo Dion (host): You're more prolific for me, but I guess that
puts the bar down pretty low yeah.
Criag Clayton (guest): I've been doing iOS.
I started in 2010 teaching myself objective CI, then got
a job working in sports, mostly N-B-A-N-F-L-N-H-L-C-H-L MMA.
And I did that for eight years.
Once I got out of that, I did a couple of other jobs working
mentoring market and just trying to.
Get my feet wet and different things.
So I mentor and I do a lot of helping others online when I
can, if I see someone ask a question or just struggling.
'cause you never know.
I know that I, when I tried, when I started it was very helpful to
have someone, which I never did.
So my way of giving back and not having someone else do the go through the same
struggles is to try to help others.
Besides that, I've written about.
Four or five books and three of them, three of them were
on ob were on storyboard, and then I wrote one on SwiftUI.
And yeah, there's a ton of them out there from me.
It was taken over yeah, I've been doing this for a while.
Leo Dion (host): What have you seen is the big change.
I assume we're talking like iOS development specifically.
What is you see, what have you seen as like the big change in those eight years
as far as development in that space?
Criag Clayton (guest): For me I think the biggest changes
is going from storyboard to SwiftUI was the biggest change.
The reason why I like Swift GY is probably different than most.
Doing a lot of the design work in storyboard was.
A little more.
It wasn't complicated.
Like I, I didn't have problems how a layout, like
everyone else didn't like it.
They had, you had some things that it didn't do right.
But overall I was able to do anything that I really wanted to.
But the problem with the storyboard was it took forever to prototype.
And the biggest thing that I find with Swift July is within a day or two, I can
have a prototype done and ready to go.
And so with storyboard in a day or two, I might have one view ready
Leo Dion (host): is funny you said that 'cause that's exactly what we
said in the last episode with Malin.
And Kai was like, it's so easy now to prototype on SwiftUI and just get
it out there and get it into people's hands to see, how it actually works.
Yeah, for me, I didn't hate storyboards, but for me it was
like dealing with get conflicts.
That was always the biggest pain point for me.
Any of that stuff, whether it's like the model data schema or storyboards
or Xcode projects, it's like anything I could avoid a get conflict for, I'll try
to do it 'cause that workup is a mess.
But yeah, swift fuel, I definitely, I'm not surprised by any answer do a lot
of people who come to your educational content, do they come to it with a
background in storyboards or are they coming to it from a totally new, fresh
perspective where they haven't done any UI development work in Swift.
Criag Clayton (guest): Most of it is new, and most of it, I would say is
pretty much from the design perspective.
So what normally happens is I get the Paul Hudson, where they've
done some tutorials, they've done that kind of stuff, and now I.
They're looking for the UI part and how to like, customize different things.
And I think that's pretty much why I focused on why a lot of my video and my
content focus on more design because I.
I'm a rare guy who has design skills that can actually do things
visually without needing a designer.
Now I'm not perfect.
I don't claim to be but I feel like most designers.
If they see my work, they'll appreciate it.
And they always have feedback, which is good.
And over the last I think 10 years, and especially eight years, when I
was working with the sports group in particular, I worked with one designer.
His name was Pixel.
And he taught me a lot of stuff, just things that he saw and I
learned, okay, these are the things I need to pay attention to.
So then when I started, working in design, those are the
things that I started with.
And.
And that knowledge gave me a heads up on, on just how to
handle different layouts in ui.
Leo Dion (host): So your background is mostly software development and then
you picked up design along the way.
Okay.
That's what I was wondering.
What do you think are some of the things that folks have a
difficult time understanding when they start getting into SwiftUI?
I.
Criag Clayton (guest): I think swift UY stacks are a little confusing for
some people when you first get into it because it's a little different.
I like to use the CSS analogy to explain the floating and the pushing
and the doing of the different things.
'cause I feel like that.
Most people understand somewhat what CSS, how it works.
And I think that's a good jumping off point.
But overall, I think using Stax, getting used to being able to do
different things with them and knowing that you can combine them overlay
them, have backgrounds to them like they do so much with those like
basically the three stack modifiers and then using the background and
the overlay, you can literally accomplish any layout you want.
Leo Dion (host): Is there something, do you, so do you
have a background in CSS at all?
Criag Clayton (guest): I, I used to do web design and web development
before I got into iOS, so yeah, I
Leo Dion (host): Okay.
What is something you might miss from that world that you wish SwiftUI had?
Criag Clayton (guest): none.
That's why I'm in iOS.
I didn't.
Leo Dion (host): Fair enough.
Criag Clayton (guest): I didn't really my, my grief or my gripe with with web
was having to deal with the browsers, having to always constantly figure
out and back then when I did it, there was only like two main ones, and now
there's I don't even know, four or five.
And so I just didn't like that.
I liked the controlled environment with iOS and I liked being able
to, even when I started it was just iPhone, iPad, and it was only one.
And then now we've gotten like phones and all kinds of stuff, but even
then I still feel like I know what I'm gonna do or how to, I know how
to do different things for different devices and not have to stress it.
Leo Dion (host): Yeah.
The web is a lot better than it used to be.
Even with the four browsers, it's better than having to constantly
make sure that your app works in IE.
Seven or God knows what version, but yeah there's a lot more and we've seen
that slow switch towards response.
Can you call it responsive design?
Even though it's one device, but like being able to design for
multiple iPhone screen sizes.
Like that transition definitely happened, but it's nowhere near as
bad as it was on the web browser is when it comes to having to design for
different sizes and browsers and yeah.
What, so what are some things that you wish you knew when
you started doing swifty?
Y.
Criag Clayton (guest): Honestly, I was there when they announced it.
And I would, within the first day or two, I was playing around with
it and I absolutely loved it.
I don't know if there was anything that I guess it was just at that
time more resources because anything that just releases, there's nothing
just like visionOS like I had the same issues with visionOS.
It was just.
Figuring out how to accomplish what I want to accomplish with the new, like
going from storyboard to now, this whole new thing, but nobody really.
Has anything for me to see.
So like right now, I I'll see some code, like I'll see things
on, YouTube from different people that I'm like, oh I didn't even
think about doing it that way.
I can still accomplish it, but I did it in a different way.
And now I'm like, okay, I see an alternative way that
might be a little bit better.
So I feel like there wasn't really anything that when it
came out but it was just like.
Figuring out how it worked.
And I think my code from SwiftUI day one to now is like drastically different.
'cause I made a lot of assumptions just because we, there was really
nothing to really go off of.
Leo Dion (host): I think there's two things when a new API comes out
A, there isn't a lot of resources and B you're not sure if you
are crazy or the API is broken
Criag Clayton (guest): Very true.
Leo Dion (host): and you're like, and then you go to look for a Apple's
documentation, it's like nothing.
And you're like, wait a second, am I do, I thought I did this right.
And or they'll skip off, they'll skip some like very important
part in a WWDC video and it's wait, what happened there?
Yeah, no I totally get it.
I totally get it.
I've had the same thing, visionOS SwiftUI, SwiftData recently.
So yeah, I totally get that.
Okay,
so let's go over like some tips that you have or hidden gems in SwiftUI that
you think people should know about.
Criag Clayton (guest): Alright, so the biggest one that I think
Apple started with at the very beginning, and I think it's lo been
lost in the ether, is really small.
Taking your code and making small views in small components that is huge.
That I pretty much write, try to recommend to people right away.
I think that's the number one.
The other one that I find that's useful is code folding.
If you don't have code folding enabled NX code for SwiftUI, you're
doing yourself a disservice because it literally allows me to see which
bracket, which v like which stack is.
Containing the code I'm looking for and I can minimize it and then see other
things that I don't, like I can hide things and still be able to see code.
So I think code folding and enabling that in Xcode is
Leo Dion (host): So that goes to a bigger thing that I would suggest is
that breaking your types, your files into small of a pieces you can possibly
do like into it in incremental pieces is like one of my biggest like tips
for any software developer out there.
Like even if it's a one line body, like whatever, I don't even care.
Maybe one line's ridiculous, three lines, four lines,
whatever, you shouldn't.
I almost, I like the code folding feature, but I also feel like
it's a good smell that maybe you need to break this body up into
smaller pieces one way or another.
And like what I do sometimes is I'll break it into like properties
maybe at first, and then if I see it like to a point where it could
go into a separate swift view, eye view, I'll do that as well.
Yeah that's a really great tip.
I don't see a lot of benefit to having a large SwiftUI view type, like that's
just really difficult to manage.
Criag Clayton (guest): Yeah, I think the, so there's like this,
so right now I'm working in countdown to binge in my own app
and there are some files that are.
Big, and it's more because of once I move them into another file, then
I have to worry about state and binding and then moving property.
So if I have a model object, then there starts to become like
other issues that I don't really want to deal with at that time.
So what I'll do is I'll keep it in the file until I've gotten it
situated, and then I'll move it.
So that's when the code
Leo Dion (host): Like I said, it's an incremental thing.
Yeah, totally.
Totally.
Yeah.
Criag Clayton (guest): So yeah I would say I do the same thing as you
is I start with, okay, I'm gonna move it into a, like a variable and then
I'll use it in my file, but it won't be in the main section of my code.
I like to take my body and make content and then use that.
And then put everything within content variable.
So like the main body isn't stacked with a bunch of code.
And then as I progressively as I progress through the project and I
start to know okay, this view is done, then I'll start refactoring into the
smaller views and then saying if I have a view that I really like, that
I want to reuse, then I'll start creating new views and do it from there.
But.
I always increment.
I don't really want to waste time moving stuff if I don't really need to.
So I try to
Leo Dion (host): And like you said, if you're especially in that design
part, like you don't know you're gonna start, it's like you're gonna
rip stuff out and change things.
So that's obviously not a good time to refactor.
So Yeah, I totally get it.
Do you, I think it's like Xcode, is it Xcode 15 where you can
start doing like refactor into sub view and stuff like that.
Which like, yeah, that stuff is awesome if you can get up to work.
Criag Clayton (guest): It's worked from there from time to
time, but it is come in handy.
Leo Dion (host): Yeah.
You mentioned state and binding, I think to a lot of people.
Some of those property wrappers and the way the data binding works in
swift ey can be a bit of a mystery.
Do you have any do you have any like pointers on how they work and
how they should be used properly?
Criag Clayton (guest): I think the easiest thing to do so with state and
then binding is because now we have bind a bull is when you're working
with something that's within a view strictly like the parent, and you want
to handle toggles or you wanna handle, has someone done something, anything
that you're doing with any, you.
Is contained within the view you would use state and always make it private.
I always remember when I was, again, when, back when I was learning I
still remember Paul Hudson saying state variables are always private,
state variables are always private.
So I always, every time I see one that's not, I'm like, make it private.
And then where the binding comes in is when you have a child view that
basically, one you want to have it also listen to a property, so
you bind it through to the child.
And that is probably the easier portion of like state and binding.
When it gets a little more complicated is now we have two different versions
where the new iOS 17 version does state and state objects and all
of that, and that's where it gets a little bit more confusing and.
And how you work with it.
But the state and the binding part, I think that is, is carried
over from the previous ioss.
So those are to me a little bit easier to grasp.
But when you first start, it's a little confusing,
Leo Dion (host): Yeah.
Yeah.
State.
Yeah.
And then on top of it, we have the new observable macro.
Have you done anything with that or observable object?
It's using observable.
Okay.
Yeah.
That's what I've been using.
RIP combined.
But yeah, I do a lot of observable stuff and that's changed the way
that, of course, bindable as well has changed a lot of that to make it
so that the line between class and struct used to be a lot more strict.
And then now basically you can put a.
Observable object how do I say this on a podcast, but like the
new observation stuff it doesn't matter if something's a class or a
state, whereas it used to matter.
That's where you get like state object and stuff.
Do you, how about as far as like the environment stuff?
Have you dealt with any of that where it's like you want to
pass an environment, there's an environment object and then
there's the environment values.
Criag Clayton (guest): Yeah.
Right now.
Yeah, there, there's a, yeah, there's a definitely a difference.
So in in my app that I'm working on now, I'm using Environment
and I find it a little easier.
So before I used to always have to add the environment modifier and then
make sure it was attached to the view.
Whereas now you just have to do it in the initial state and then all of the
children really do have access to it.
And so that's the great thing.
Like I, I find myself writing less code that way.
I.
When to use it and like how each one works is a little different.
But I think, having the observable and not having to do app publish everywhere
that is definitely cleaned up code and it, the paradigm has changed.
And now instead of doing MVVM you're trying to, you're really
doing model view instead.
And so that kind of design pattern and that kind of thinking is where
I'm transitioning to, depending on the project and the size of it.
But yeah, that's where I'm at.
Leo Dion (host): you wanna explain a little bit more about
this app Countdown to binge?
Is this is an app you wanna publish in the actual app store, or is
it just a demo teaching tool?
Criag Clayton (guest): No.
So countdown to pin, countdown to binge came about a few years ago.
So I like binge watching.
I work from home and I watch shows all the time, and I can't stand
waiting for a show to go week to week.
So pretty much Game of Thrones is the only show I ever.
We'll watch week to week and not wait.
'cause I can't wait one, like I can't wait a whole like two
months for that show to end.
So the idea is, what I used to do is I'd go to IMDB, find a show I liked,
and then it says, oh, it ends in May.
And then I'm like, okay, trying to remember May.
And then and then December comes around and I'm like, oh yeah, that
show that I wanted to watch back that ended in May is ready to go.
And it's about to start a new season.
So that is where it derived from.
So what countdown to binge does is it lets you add shows you watch,
and then it will tell you how many days until the show ends.
It will also tell you how many days until the show launches.
And then the other great thing is any shows that are pending, for example,
daredevils coming out for Disney.
And most people don't know that.
But when you, when I was doing like building my app and I added Daredevil
there's the daredevil from Netflix and then there's now the daredevil from
Disney and the Daredevil from Disney has the same characters, but it hasn't
get gotten a release date specifically.
So what my app will do is it.
Checks to make sure, like every couple of days or whatever, it
will go and see if there's a date.
And then when you open the app and there is one, it'll tell you when the
date is for the launch rather than you having to go look for it every time.
Leo Dion (host): Is this using IMDB?
Criag Clayton (guest): No, it's using movie db the movie DB actually.
Leo Dion (host): Okay.
Yeah, we did an episode with Casey Liss for Call Sheet, and
he had, I think he was using movie DB or TV db, something like
Criag Clayton (guest): That's, it's probably the same one I'm using.
Leo Dion (host): Yeah.
What are you watching right now?
To watch?
Criag Clayton (guest): I just finished the really good shows
that I finished were Money Heist.
Somebody told me to watch that, and then I got into Berlin, which is a spinoff.
From that I.
What else am I watching?
I'm in a transition.
I'm watching some European shows, so I'm watching line of,
I can't remember the name of it.
It's like a cop show based out of the out of Britain.
And I'm in the final season of that.
I'm waiting on Masters of Air to finish, so that's coming up
in a week, less than a week.
Leo Dion (host): That's on Max, right?
Criag Clayton (guest): that is on apple tv.
Actually.
Leo Dion (host): Oh okay.
But it's I was thinking Max, because it's like a band of brothers type
Criag Clayton (guest): Yeah.
It's more, I think it's based on a true story of the flight.
I didn't, I'm not, I've seen a trailer, but I didn't want
to get into it too much.
I'm waiting for it to end, so I'm, I should be binging it soon.
And there's a couple other shows that I have on my list, but I've been.
I go through, I try to find shows that have I haven't watched at all.
I'll go to like old shows that are like, eight or nine seasons that'll
just take me two, three months and then when I'm coding I'll throw it on
and I'll just watch while I'm coding.
And that's usually where I get hooked.
But I never really was into TV shows until probably, maybe 10 years ago.
Leo Dion (host): I was trying to do Sopranos recently.
I've never watched it.
It's slow, but
Criag Clayton (guest): yeah, Sopranos is good.
I got through that after the, after it was over.
And everybody was talking about how the ending was bad, and I liked it.
It is slow.
You do have to have some patience with it.
Same with the wi the wire.
The wire took some time for me to get into the first
few episodes every season.
Leo Dion (host): like the one, I'm a big Breaking Bad fan.
So like I, I've heard of those shows amongst the greatest shows ever made.
So I was always like, curious about that.
Yeah.
Criag Clayton (guest): Is Epic.
Leo Dion (host): let's see.
Yeah, that's what everybody said.
I gotta try it again.
What did you learn in the making of this app?
So you got like API calls you you must have some sort of.
Back.
Do you have a backend and do you have any like local storage?
Criag Clayton (guest): So right now I'm using SwiftData.
I am hopefully going to integrate cloud kit into it so that way when you go from
device to device, everything is saved.
But right now my focus is really on the core functionality.
Leo Dion (host): Yeah.
Criag Clayton (guest): I've learned a lot.
The API actually does not do a really good job of what I'm trying to do.
So there's a lot of custom
Leo Dion (host): Which API.
Criag Clayton (guest): The movie db, because it tells me it's weird.
It like.
It tells you like the last episode, it tells you the next episode,
but that's not really reliable.
And then it gives you episodes and then you have to like basically
go through the data and find it.
So what, like with the strike that happened, I think this is
probably the worst year to build this app or maybe the best year.
So with the strike, we have shows that are not being, like
their entire schedule isn't being released when the show's released.
For example, the rookie just came out about 4, 3, 4 weeks ago.
They've only have four episodes that they've actually told people
what the dates are, and then there's still maybe 12 more episodes, but
they haven't released the dates.
So my app has to constantly check to look for updates
and then update the timing.
So it's a little weird.
But it's helpful now because.
I don't, I'm, because of this, I'm actually able to ride it to
where it will, it should work no matter what the situation is.
And it also knows if it's a Netflix show versus a show that's on
like A, B, C or CBS or one of the other ones that are weekly shows.
So
Leo Dion (host): I miss the days when they just released the whole entire
Criag Clayton (guest): that is, and that's the point of this app
Leo Dion (host): Yeah.
Yeah.
Criag Clayton (guest): Not having to
Leo Dion (host): SwiftData, what'd you think?
Criag Clayton (guest): It is good.
I like it.
I'm actually going through an issue right now with a bug that it's not
updating and it keeps crashing on me.
So as soon as this is over, I'm hoping to finish fix it.
But overall it's the, it's a breeze to use.
Haven't really had any major issues other than the one
that I'm encountering now.
And that's pretty much it.
I enjoy it.
That obviously, I think it'll, as it grows, it'll get better, but I like it
Leo Dion (host): Yeah.
I think this June we're gonna have a big house cleaning, and that, along with the
updates for synchronization and stuff.
Yeah I'm looking forward to that.
I, by the time this episode comes out, hopefully I'll have published that.
The article I'm working on model actors.
Maybe after this recording I'll share it with you and see if it helps you in
your issue because that's the one thing I had a hard time with in the Making a
bushel was dealing with synchronization and SwiftData and threads and
actors and all that fun stuff.
Yeah.
But I like, I, like I had said at the beginning of the episode,
like storyboards, xcode projects, any of the core data, like.
Model files.
I forgot what those are called.
The schema files or whatever, like any of that stuff that was like some
special appeal list, XML format that you don't want to have to deal with when
you're merging is if I can remove that.
So so data, it's like the same thing.
It's like core data moving to a purely swift model or purely swift
format, just like storyboards move to a purely swift format.
UI moved to a purely swift format with SwiftUI,
I'm all for it.
It's not perfect, but yeah, like you said, it's just, it's so much nicer
to deal with that stuff in actual swift as opposed to a UI that you
don't want to have to deal with.
Criag Clayton (guest): Yeah, I mean for me, so one thing that I did when we did
storyboards, I wasn't, I didn't work for a huge team, but it was three of us.
It started with two of us, but now it was three of us before I left.
Working with storyboards and we just communicated, Hey, I.
I'm gonna be doing some major design work in storyboard, and we had it
separated so that all of the individual items that were repeated were in nibs.
We, I never put anything in the actual storyboard.
Most of the storyboard was blank.
So it was more
Leo Dion (host): when storyboards didn't even have like storyboard references
and you had to put all the UI in?
Oh my God.
Criag Clayton (guest): Yes.
That's the, when it wasn't, when it wasn't that one big file and it was
like you had to refer, like you had to do nibs and do that kind of stuff.
That's how I adopted and used storyboarding.
So it made it easy.
But then when they started giving like more features and like doing
containers and doing other things, I always found ways to help me.
But I always just communicated I always out overwrote anybody that I worked with
because I did most of the design work.
So if my coworker happened to open a file and we had conflicts, he
would take mine and and then he would do whatever he needed to do.
Leo Dion (host): it would do the thing too where it was like it would
change an id like some, it's like somebody opens the file, right?
And they don't know what they're doing.
They open the file and then they close the file.
They didn't do anything.
It just changed some stupid random ID in the file.
And then you're like, oh, great.
Now I have this conflict because all, he like the poor guy, like
all he did was just open the file.
It's not like he meant to change anything.
Criag Clayton (guest): Happens a ton of times, but we al, whenever
we mer, whenever we merged code, we always got in a chat.
And then if there was a conflict with a storyboard file, my, my coworker
would be like, I'm taking yours.
And then I.
He, he's oh, I didn't do anything.
It's just conflicting.
Or I changed one thing and he's I'll go back and just change
it when I get the new version.
So it, we, as long as you communicated, I felt like it worked.
We never really had major conflict issues because we always are
like, you're working in that file and no one else will touch it.
Leo Dion (host): But it's a black box.
That's what I don't like about it.
Like you like, yeah.
Obviously communication is the key, but like it is a black box.
It's like, why?
Why would you do this?
Why not just make it a format that people can understand?
Criag Clayton (guest): Agreed.
Agreed,
Leo Dion (host): yeah.
So I was looking over your YouTube channel and there was a few interesting
things that you've been talking about recently that people don't know about.
Like for instance, your last video, you were talking about the con,
is it content unavailable view?
Criag Clayton (guest): correct.
Leo Dion (host): That amongst other, what are some like hidden, other hidden
times views that people should be using?
When they are when they're using SwiftUI that they just don't know about.
Criag Clayton (guest): So I think if we're talking iOS 17,
we have con unavailable view.
That's new tip kit, which is also new.
And those are just ways to put in like a.
Basically an image text, a title that you can tell a user
when they're in an empty, when your view's in an empty state.
For example, if somebody's doing a search in your list and they're
looking for a product and the product isn't there, instead of it
just being empty, you can just say, so and so does not, is not found.
So the user knows.
So continental available view just makes it really easy for you to not have to.
Write that like all of us can do it.
It's not like it's hard to do them, but when you can write like one line of code
to put a content unavailable view into your project and move on, it's great.
The other one tip kit I think is really good for the simple fact that if you're
trying to educate your users on some icons or some stuff that you want them
to know tip kit works and I think.
Once it expands broader than what it's covering right now, then I
think it'll be even more powerful.
But for now it's working in most of the things that you
would work, you would use.
But it's a little, it's still it doesn't do everything.
So you have to just be mindful of that for that.
Is there anything else inside of.
SwiftUI iOS17 I would say those are the two main ones that I can think of.
I haven't actually covered tip kit yet.
Leo Dion (host): yeah, I tried using TipKit and Bushel and I, so it's
a macOS App and it was like this.
This felt like awkward and I think maybe I just wasn't using it in
the right place at the right.
Time.
But I I wanna get better at onboarding.
Especially in the app, as complex as it is, it deals with
virtual machines and stuff.
And if there's anything I could do to alleviate that
tip kit seemed like the ideal.
But yeah.
Have you done, you've done such with stuff with searching Correct?
Criag Clayton (guest): I've used content available view for searching,
but tip kit, I did a whole course.
I did a whole course on design and I cover tip kit in there.
So I.
You can do a lot of, do really good things by Hey, I don't
want this tip to show up.
For example, let's say you have a detail page for product and they go
to the page, but they may not see the favorites and you're like, Hey, by the
fifth view, if they don't see, if they don't like Mark favorite, show them
the tip that, Hey, there's favorites that you can favorite your product.
So you can customize it down to like.
How many times you see it.
Once they see it, it never comes back and you don't have to really do user
defaults or any of that stuff because it's all built in and it's great.
So I think the more people start using it and seeing it in the
world and in, out, in where people can see the code, then they'll
start to see the power of it.
But I think that was one of those that I had to like really hunt
for during the summer when I was trying to integrate it into.
My course.
Leo Dion (host): How hard is it like to implement or difficult is it to
implement searching in SwiftUI now?
Criag Clayton (guest): Oh, it's pretty easy.
I have a whole video on YouTube that kind of covers it within a few minutes.
You basically implement one property, two properties, a modifier, and you
just tie in your array and that's it.
You tell it what you're actually gonna search for during the array to filter.
And that's it.
And then you, from the search, you can then integrate content unavailable view.
So it all works together.
But I would say searching can be done in about 15, 20 minutes into your app.
Leo Dion (host): Is there anything you have done in SwiftUI where you're
like, man, I just wanna go back to UI kit on this particular piece.
anything you miss?
Is there anything you miss?
Criag Clayton (guest): So I would say before the grid stuff really came
out, those, that was pretty much it.
But I didn't really miss collection views because collection views
took forever to get going.
And I.
And I hated the way that they separated the sections.
And it was like, is it this one?
Is it that one?
Okay.
And like it, I just felt like the amount of work I had to do just to get it up
and running never really was worth it.
And with SwiftUI, I can immediately.
See results.
Like once I know if I need a lazy V grid or an H grid or a grid, like
the newer ones, I can get it up and running within, five minutes and I
get feedback, I can work with it.
So I would say there's nothing in particular that I miss.
I really do.
I think maybe because I'm more design heavy, I find that it's.
To me better to use.
I didn't like using third party third party libraries and I felt like that
was really heavily used in UI kit, but everyone praised UI kit, so I'm like,
you're praising UI kit, but then you're using 40 different libraries in your
Leo Dion (host): Yeah.
You a web developer
Criag Clayton (guest): do
Leo Dion (host): on,
I have
Criag Clayton (guest): to NPM install?
Yeah, no, I get it.
Totally.
Yeah, and it was probably Cocoa Pods too,
Yes.
Or a Carthage.
Leo Dion (host): Yeah.
There's a couple of videos I see about fonts and shapes.
Is there anything you wanna talk about those subjects?
'cause those are like, when you get into really like fancy designs,
you're gonna start implementing custom fonts or custom shapes.
Criag Clayton (guest): Yeah.
I.
Leo Dion (host): there anything you wanna expand on that?
Criag Clayton (guest): I do a lot of custom fonts.
I think fonts are great for taking your app to a, just having, it's
not it's not hard, it's just, it gives it a different look and feel.
Leo Dion (host): It is a branding thing too, right?
Like you look, you don't look like an out of the box app, right?
Criag Clayton (guest): And I love it.
So when I, when we worked with the sports teams, they had particular fonts
that they always had that they, it was, their legal team were like, you
have to use the swamp for this thing.
And fonts are great.
I think the new condensed, compressed all of those new ones from Apple,
even if you just use those.
Are amazing because if you combine them with other ones I like the really
thick font, the little condensed thin fonts, you start mixing and matching
with those and your app goes from okay, that looks like a basic app to, oh,
you put some thought into your app.
So I think.
Using fonts are great and I talk about how to integrate custom fonts
and I have a little way to make it so that it's really easy, just type
dot custom and then boom, it works.
And then you don't have to put everything in strings because I.
If I want to change a font, let's say I have a regular font that
I'm using and it's San Francisco condensed, but then I want to change
it to a different condensed font.
I don't have to go in and replace all the strings that
I did in my entire project.
I can just go in, simply replace it in one place, and then my entire
font, my entire app is updated.
So I find that it's a lot more
Leo Dion (host): you do like an extension or something to do that?
Like where you Basically because one of the, one of the things I
do miss, honestly, from web design is like the ability to just say
here's the font for the entire body.
Here's the font for headers, here's the font.
And being able to like.
To like have like with style sheets, just being able to or
have that better organized.
Do you have any tips on that when it comes to SwiftUI?
Criag Clayton (guest): No, but you bring up a good point so you
can do exactly what you just said.
So Apple has Title A, they have header, they have H one,
H two, H three, so right.
You can actually make a custom version of that in your app
and make it with custom fonts.
What I typically do is I'll use a custom font and I'll use a font size and then.
Based off of the font size, it scales up and down off of accessibility.
So it, when a user
Leo Dion (host): So I just wanna make sure this is clear.
If you set a font
With a custom font, it'll automatically scale from accessibility.
'cause I thought there was like, oh no, you have to do this
for the dynamic type to work.
Or you don't have to do any, anything fancy for that.
Okay?
Okay.
Criag Clayton (guest): No, you if you use, if you watch my video,
it'll, you can integrate it and it's basically, it's all within
the code that I'd share in there.
And once you have it integrated.
Even like my app now and my countdown to binge, I have it
where it works with accessibility.
Now what's great now with SwiftUI is I can do ranges.
So I can say that I want this header to be only from small to like extra large.
And then once it hits, once it goes past extra large, it stops.
So it doesn't break my app.
Leo Dion (host): Yeah.
Okay.
Criag Clayton (guest): So you can do it that way.
I prefer to do it by the font size.
But to go back to what you asked, you can do it by, you can set
up a sheet that says, my titles are 22, my paragraphs, or 14.
And then you can just do dot paragraph and then it'll do exactly that.
And then again, it'll scale and do everything that you're trying to do.
So you can make it not assertive, but you can make it behave like
Leo Dion (host): that's a, that's awesome.
And I'll put a link to your video and maybe even a YouTube
card here somewhere, wherever.
Criag Clayton (guest): I'll do a, I'm gonna do one on the
one that you just mentioned.
I'll do that one next.
Because I think it's out there, but there's not a lot of resources on
it, so I'll post a video on how you can do it by going the other way.
'cause I, like I said, for me, I prefer just putting in
a number and then I let scale.
But if you prefer to put the number in and base it off of an H, like a
Title one, title two, title three, where it scales down, you can
Leo Dion (host): So yeah, let's talk.
So you're gonna be talking at Deep Dish, which is awesome 'cause I will be there.
I.
What are you gonna be talking on in Chicago?
Criag Clayton (guest): So we talked earlier about why I like SwiftUI being
prototype, and my particular workflow is different than most devs where
I like to visually see everything before I integrate models, before I
integrate APIs, before I do anything, I literally want to see my app running
from tab to tab and page to page.
Just generic, just a basic prototype with nothing hard coded everything.
And then I go to the testing.
And so what I have learned over the last two to three months with John
Reed is that there's actually two, like two different ways of testing
and there's a what we call outside in and inside out, and most devs do.
Inside out, whereas in I in particular where I wanted to be outside in and I
never really understood this particular concept or even knew about it.
And so my talk is how do you go about doing test driven development if you do
prototype design or development first?
And I will give, I still haven't worked on it.
I started with the presentation yet, but the idea will be, you can do.
Stuff like Kiwi and oh man, the other one.
So there's a, it's based off of our spec for Ruby Development and they made a
library for iOS that does the same thing where it's story based T so behavior
driven development and it's using quick and quick and what's the other one?
Kiwi, I think is a Ruby.
But but yeah, so basically that's, that is where my talk
is gonna be baselined from.
So I'm gonna do a DDD, I'm sorry, a BDD version and a TDD version.
But I'm gonna do it in the flip.
Instead of doing inside out, I'm gonna show outside in and then I'm
gonna show how you use it from that other perspective as well, so that
people can see you can do it this way.
Instead of the typical, I'm gonna start with my model and then I'm going
to, I'm gonna put the properties in.
To me that's I, like when I see the design is when I know how
I'm going to create my objects and my models and how that works.
Because the designer really is the one who dictates what you do.
And that's the way I've always worked
Leo Dion (host): I think that's especially helpful if you have an
actual client you're working with.
And like for me, when I have a client, like I want them to see what
it's gonna look like in the end.
And like I think the other side of that comes from the fact that
we're not totally comfortable with what's going on underneath.
And we might want to see like how.
What is going on underneath might behave, whether it's networking or
database, but as far as like knowing what you want in the end, yeah, I
totally like that outside in approach.
So I'm like really excited to see her talk in Chicago.
That's gonna be awesome.
Yeah.
Anything else lately you've been working on?
Any Vision Pro stuff or AI
Criag Clayton (guest): I did a, I, so I did a workshop for tri Swift in New
York over the summer, and I learned a ton about Vision Pro and design,
Leo Dion (host): do you have one I'm obligated to ask?
Criag Clayton (guest): I have, I don't have one in the store.
I have one that I've done but I haven't put one in the store.
Oh, no, I'm not.
I'm still on the four, 4K is still a bit much that I wanna spend.
I plan on getting one, but I'm not, I don't have one yet yeah.
Leo Dion (host): yeah.
What'd you learn in that?
Like from doing Vision Pro stuff?
Criag Clayton (guest): a ton.
A ton.
So I learned that it vision Pro.
Is different than anything you're doing in SwiftUI for iOS, iPad
that you're normally used to.
So backgrounds are different.
The way that you handle colors and overlays are different.
The way that you handle state is different.
The way that you handle fonts are different.
So there's a lot
Leo Dion (host): Why state?
What do you mean by state?
Exactly.
Criag Clayton (guest): So let's say that you select a button when you select
a button, they like it for it to be
Leo Dion (host): Oh, okay.
Okay.
Visually, but
Criag Clayton (guest): visually, yes.
Not in the code part of it, but in the visual aspects of it.
Sorry, I should have prefaced that.
So a lot of the things that I was like trying to figure out is how do
I take a design and what is it that.
What, like what is the ideal design for Vision Pro?
And those were the, some of the things like, you need
to use blurred backgrounds.
You can't, don't they're against, not against, but they recommend you don't
use solid backgrounds because they want you to be able to see different
things in the environment while
Leo Dion (host): Like a translucent background like that.
Yeah.
Frosted glass or
Criag Clayton (guest): And you're.
And the buttons that you use all should basically go from there.
So I found it very difficult again, like I did when Switch UI first came out.
How do I implement a button with a, when I, when it's a state
that's like empty or when it's just what is it that they call it?
Leo Dion (host): Selected or not
Criag Clayton (guest): when there's nothing going on.
Yes when you're not interacting with it, there's that state, then
there's the state when you're actually hovering over it, which is
actually when you're looking at it.
And so it has a little bit of a glow and a it.
It like does different things and those are the things that I
didn't, that I was like learning and it took me hours upon hours.
How to do mods, how to do share
Leo Dion (host): all in this simulator.
Okay.
What anything as far as do you know what Fitz Law is?
I was just trying to search what it was called.
Do you know what I'm talking about?
Fitz Law?
Okay.
The idea being like your fat finger is not as precise as a mouse coor
and your eye, your eyeball, is not as precise as your finger and so on.
Was there anything there that you were like, oh yeah, these buttons
need to be a lot bigger, or this button needs to be smaller, or what?
Criag Clayton (guest): So Apple covers those in the video.
So I found that those were helpful.
The, but what Apple doesn't cover in detail are the other nuances of them.
They cover fonts and they say, Hey, our fonts are steps up.
One step up bigger than what they would be normally in, in
an iPhone app or an iPad app.
And so that makes sense.
And they like Boulder fonts because obviously that's easier to read.
But they, but like how you handle the state of a button, how you handle the
background of them, and when there's.
When you're on a background that has a blur and then you have another
object that's on top of it, how do you handle those different like scenarios?
Like all of that they talk about, but then you get into Vision Pro and then
you're like how do I implement it?
And that was the problem that I had.
I was literally like, okay, I see what you're showing in the
demo, but there's no demo project.
There's no anything that I can see code with.
So I literally.
I swear I hunted for days on just little things and I, like I said,
I just gave a talk on it about a month ago in regards to all of it,
like my top five things for Vision
Leo Dion (host): Awesome.
Is that talk available online or was that Try
Criag Clayton (guest): I.
So unfortunately something happened with zoom and the, and they are having
trouble getting the video, so I'm probably gonna have to make a YouTube
video of it because they, right now, they still haven't put it up.
It should have gone up like literally the weekend I, after the weekend I
did it and he's, he keeps telling me he has, he's having trouble.
Leo Dion (host): If you find a video or have the video, let me know.
I'll try to put it on here, so for sure.
That's awesome,
Criag Clayton (guest): You got it.
Leo Dion (host): Craig.
Anything else you wanna plug before we close up?
Criag Clayton (guest): I'd probably say my YouTube channel, design a
SwiftUI, and then my website design a SwiftUI.com, which has courses
and I'm hoping to launch more.
I'm working currently on a bootcamp and I'm hoping to eventually do a design
visionOS where we go from, we open up sketch, we create an A design, and then
we go into Xcode and we implement it.
Just the design.
Not like any functionality, but just understanding how to take like
how you take a thought in your head or design and work it into vision.
So those are those are my next
Leo Dion (host): you so much, Craig for coming on.
Besides that, where are you online as well?
Criag Clayton (guest): So Mastodon Twitter is pretty
much where you can find me.
The Dev me is my name on both platforms.
And I, if you respond to something I say, or at me, I always respond.
Even though if, even if it's a thumbs up or a thank you, but I'm always
pretty active on there because I know how it is and it's a really good
resource for people to reach out and get
Leo Dion (host): Awesome.
Craig, thank you so much for coming on.
I look forward to seeing you in Chicago.
I'm excited for the talk.
That's gonna be good.
People can find me on Twitter at Leo g Dion, Macon, Leo G Dion at
c Im my company's bright digit.
If you're watching this on YouTube, please and subscribe.
I would really appreciate it.
Thank you again and I look forward to talking to you in the next episode.
Bye everyone.