Read the transcript
Jeroen Leenarts: Hi, and welcome
to the 77th episode of my
podcast. My name is Sheila
Leenarts. And I've been
developing software for over 20
years developing iOS apps for
over 10 years. And I'm running
flashcards for over nine years,
you can find me online under the
handle app Force One, just look
for it. Wherever you are at,
probably you will find me. If
you're an iOS app developer, you
should listen to my podcast
because it will keep you updated
on interesting articles,
conferences and events you might
not have heard about. In this
episode, I'm going to talk about
the difference between checked
and unsafe continuations in
Swift, correctly playing audio
in iOS applications using Doxie
on GitHub Pages, async throwing
stream and async stream
explained with code examples.
And I was seen delegates and
external screens. So let's get
started. Hey, welcome back to
another episode of our podcast.
I'm sitting here in a quiet
house. Finally, my kids have
school vacation, so they're at
home. But my wife and a family
friend took them out on a day
trip. So first time in about a
week's time that it's like peace
and quiet in the house. So the
moment that happens, total body
relaxation experience. So that
was awesome. And that concludes
the ASMR section of my podcast,
working hard on all kinds of
conferences and things. I don't
know of any conferences at the
moment that I haven't seen yet
in the next six months, about
iOS or Apple technologies,
specifically, that I haven't
thought about of getting
sponsored through my place of
work. So the workloads on my
team at stream is getting so
high with in person defense that
we're now asking developers
within the development team to
go out and represent the product
and the company, which is fun,
which is good. It's not at first
one podcast related, but still,
it's it's part of my day to day.
And it's just a whole lot of fun
to get to basically send people
out there to in person events
and see them have the in person
experience again, talking about
in person experience on June 15,
the caca hats will be at my
place of work in Amsterdam. So
if you're around, make sure to
sign up on meetup.com at the
Coker Hudson l meetup on June
15. Because it's it's a whole a
whole new level of awesome with
this meetup going on. And I just
look so much forward to meeting
people I know, online, and
people who I haven't seen for
like two years to see them back
in person again, in the office
in Amsterdam. So if you're
around, make sure that you join
tomorrow, it's going to be Kings
Day. So the national holiday
because our king in the
Netherlands is having his
birthday. It's not his actual
birthday, I think. But still, we
have a day off with the entire
country. And if you are in the
Netherlands, and you have never
been in the Netherlands on Kings
Day, prepare yourself. If you're
curious, look it up online,
Kingston Netherlands and be
amazed with the whole sea of
orange with people that you will
see in all these pictures. So
have some fun, and hopefully
back to work on Thursday again,
in the Netherlands without too
much of a hangover. So the first
article of this week is by Dani
waltz the difference between
checks and unsafe continuations
in Swift. When you're writing a
conversion layer to transform
your callback based code into
code that supports async await
in Swift, you will typically
find yourself using
continuations. A continuation is
a closure that you can call with
the result of your asynchronous
work, you have the option to
pass it the output of your work
an object that conforms to
error, or you can posit a result
or objects in his post done you
won't go in depth on showing how
you can convert your callback
based code to async await. He
has another post on that.
Instead he wants to explain the
difference between checked and
unsafe continuation in his short
post. The next article of this
week is by Igor Kumar, correctly
playing audio and iOS
applications. When you look for
ways to play audio in your iOS
applications, you usually find
code like this AV audio player
gets created you prepare to play
and you pray you hit play. While
this code works, and it will
play the given audio file. It
does not deal with all the
nuances of audio playback.
Imagine the user is playing a
podcast or some music do you
want to sound in your app to
stop that playback or play over
it?
The key to correct audio
playback according to Igor is
using AV audio session. In his
article he will go into some
detail and by example, showcase
why you should be using AV audio
session instead of AV audio
player. An audio session gives
you a lot more flexibility.
Flexibility comes with some
complexity. But if you look at
this article by Igor you will
know that the complexity is not
that bad yet because we're not
like deep dive in your low level
code yet for audio playback.
There are some options that you
have with AV audio session and
Igor goes into some detail on
what these are like ducking
audio or playing over existing
art You're stopping existing
audio and the cleanup that you
need to do afterwards. So good
rates, interesting thing to have
a look at, especially if you
want to do some audio things
within your app. So have a read
through this article. So the
next article is by Jesse
Squires. He wrote some content
before on using Doxie on GitHub
pages, or maybe more than it was
not working for him. But in this
article, since there were some
updates in INDOXXI. He revisits
the topic. And yeah, goes over
the things that he likes and he
doesn't like about using Doxie.
For his documentation generation
based on gold level Commons
biggest gripe that he has with
Doxie is the URL scheme that
Doxie imposes on your
documentation sites. It's it's
pretty elaborate what you need
to navigate to form a URL, but
still, it works. But another big
thing is that Doxie generation
is not stable Doxie is great,
but there are still some rough
edges there that we are waiting
for some fixes to get that
sorted. Also do note Doxie is an
open source project. So if you
have some insights into these
topics, you can just fix it
yourself. The fourth article is
by Antoine formulae async drone
stream and async stream
explained with code examples
async drone stream and async
stream are part of the
concurrency framework introduced
in Swift 5.5 With Sae 314 async
streams allow you to replace
existing code that is based on
closures or combined publishers.
In his article Antoine goes to
some detail what an async Truong
stream and an async stream is.
But as Antoine always does,
teaching is best done by
example. So he quickly goes into
some sample code and explains
what the sample code does. And
why should actually be looking
at async trunk stream and async
stream. Because async trunk
stream and async stream are
great ways to rewrite existing
code based on closures to async
await supporting alternatives.
You can deliver a continuous
stream of files and finish the
stream on success or failure.
You can iterate values on the
implementation level using a for
loop based on the async sequence
queue API's even. And then the
final article I wanted to
mention this week is by Keith
Harrison usual love.com. iOS
seen delegates and external
screens. This is a very
interesting niche that's
actually possible with iOS
devices. Because you can show
content on an external screen,
it's nothing new. The
notification notifications that
tell you someone has connected
or disconnected screen have been
in iOS since iOS 3.2. So that's
a long while, over 10 years, but
a lot has changed since the
beginning days of iOS 3.2. Since
iOS 13. You have seen delegates
and an Irish 14 Swift UI gains
new app lifecycle events. So how
do you work with external
screens in a modern iOS
application. To get things
going, Keith goes into some
detail on how you get started
with external screens using UI
kits. And the whole point of
this application is to just
enter some text and show that on
an external screen. The default
implementation of a UI Kit
project provides both an app
delegates and the scene
delegates. And default scene
configuration in the info P list
sets the class for the scene
delegates and the name of
storyboard used to load the main
user interface. So all very
nice, what you then need to do
is add some code to be able to
add an external screen to make
sure that you can actually put
content on this external screen,
do some plumbing, do some work.
And then finally, you can put
the external screen in practice.
And it's good to know that the
simulator also has support for
external displays. In the I O
menu, use the external displays
menu to choose the size of the
external display you want to
simulate. So one thing to note
about Swift UI is that Apple
added new lifecycle events to
iOS 14 In regards to external
displays. But what it didn't add
is any direct support for
creating a scene for an external
display. So that means you need
to fall back to UI kit and
seeing delegates to get
something displaying on an
external screen. Keith promises
to look into this more and see
if there's any way that he can
solve this issue with a pure
swift UI based product solution.
So that's it for this week, five
articles nice and sweet.
If you have any questions,
please feel free to reach out to
me on Twitter at app Force One,
either DM or within the app
mentioned. And yeah, just make
sure that you like subscribe to
my podcast in the podcast player
of choice. And if you have the
opportunity, please review me on
Apple podcast. It really helps
me a lot and yeah, especially if
it's if you'd like for podcasts
high reviews is greatly
appreciated. If you don't like
it, I'm gonna try to have that
should reach out to me directly,
of course, because yeah, I just
like to know how I could
potentially improve my podcast
for you as a listener. Talk to
you again next week, and enjoy
the rest of your week.