Combine Form Validation SwiftUI

preview_player
Показать описание
In this video I am going to walk you through a process for creating a Login View for your app that includes some design work, MVVM and field Validation using Combine

If you want to support my work, you can buy me a coffee :)

******** Download my StewartLynch YouTube Channel Application - Free ***********

Table of Contents:
0:00 Introduction
2:00 Designing the Log in Form
21:30 Applying Combine Field Validation

Starter Project Files:
Part 1

Part 2 (If you skip the first part, used this completed part 1 for the Coming Validation section

Completed Project:

Other references:
Original Video not using Combine:

Tundsdev - SwiftUI Form Validation using Combine (SwiftUI Tutorial, Regular Expressions, Combine Framework)

SwiftUI Login Workflow

Biometric Authentication

Email Regex site

Password Regex Stack Overflow

Other References:
Stewart Lynch's YouTube Channel:
Stewart Lynch on Twitter:
CreaTECH Solutions Website:
Stewart Lynch's GitHub:
Рекомендации по теме
Комментарии
Автор

Great tutorial. Coming from Android Development, SwiftUI has been a huge learning curve for me.

ameyajoshi
Автор

Very clear explanation. Love this brilliant channel so much.

taslimfi
Автор

Such a brilliant video Stewart. Recently discovered your channel and it's such a gem. Your teaching style is brilliant. Keep up the awesome work and thank you!

nitesh-maharaj
Автор

Awesome like always Stewart... thank you very much 🙏

andrejkling
Автор

Thanks alot, Stewart!. It's very helpful.

quyenanhnguyen
Автор

This is awesome! Question though, how to validate the fields only when the button is press and add red border to the field not passed the validation? Thanks

EmanNollase
Автор

Great Tutorial, I really enjoy your presentations!  

For this one I also added .disableAutoCorrection(true) to the EntryField so it wouldn't try to always fix the email.

scottbennett
Автор

This is really very nice, thanks Stewart! Very useful and looks good, too! I had gone thru tundsdev's video before and frankly got lost, but yours was quite clear and understandable. Any reason you did the custom view for the birth year rather than use a picker?

SBSanook
Автор

You can use triple quotes to handle escaping for you.

spaceshipable
Автор

Great content., thanks! Is there any advantages to use Combine vs the first video you did? The first method seems more easier to approach for a beginner (Combine is a bit hard to learn).

fredrigaudeau
Автор

Hey nice video....was a little confused why you didn't use '.sink' but used '.assign' when using combine in your View Model?

guarino
Автор

Hi, is there a way to have a common emptyPublisher and reuse it for other fields that need to validate into empty?

EmanNollase
Автор

I have a minor bug: when prompt disappear white space between textfields collapses. Any ideas how to fix this?

ortezan
Автор

Why you don' t set the regex string between ##?

GemoGem