SwiftUI Alerts - Buttons, TextFields, & Passing Errors

preview_player
Показать описание

In this video I show you how to display various types of alerts in SwiftUI. We discuss multiple buttons with destructive and cancel button roles and how to use a TextField in an alert. Then I show you how to pass an Error into your alert modifier so your alerts can be dynamic.

My iOS Dev Courses:

My Source Code:

X (Twitter):

Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):

Mark Moeyken’s SwiftUI Books:

Paul Hudson's Hacking With Swift:

RocketSim - Enhance Your Xcode Simulator:

Timestamps:
0:00 - Types of Alerts
0:17 - Basic Alert
3:13 - Multiple Buttons Alert
4:55 - TextField in Alert
7:23 - Passing an Error to an Alert
10:26 - Dynamic UI based on Error

#swift #softwaredeveloper #iosdeveloper
Рекомендации по теме
Комментарии
Автор

I needed to learn about error alerts so the first place I went was to Sean's YouTube page and searched for error handling. Sean Allen always comes through!

toddmarshall
Автор

So Sean this is completely different from the Appetizers lesson correct? So I would use this vs. the Appetizers App way?

MassonLifestyle
Автор

Great tutorial, just what i was looking for

joalux
Автор

What annoys me is that the alert buttons have a 400ms callback delay, while the closing animation is only 300ms. I managed to fix this (in UIKit), along with a couple of other quirks.

Jannemandevries
Автор

thx, do more videos for creating ui components

El_Batono
Автор

Спасибо большое, что помогли разобраться с Alerts

sashlandia
Автор

Kindly increase the fontsize of ur XCode, maybe to 36.

NATAR
Автор

Also if you have only one button with role n your alert, you don’t need another button to show Cancel. You get Cancel for free.

nileshjdarji