Easy Form Validation In SwiftUI & AttributeGraph Warning Fix
Вставка
- Опубліковано 9 лют 2025
- Easy Form Validation In SwiftUI & AttributeGraph Warning Fix
🤙🏾 Subscribe to the tundsdev UA-cam channel
www.youtube.co...
⏭ Next Video
Adding Haptic Feedback and a Settings Screen in SwiftUI
• Adding Haptic Feedback...
⏮ Previous Video
Adding An Animated Pop-Up View In SwiftUI
• Adding An Animated Pop...
Ready to level up your SwiftUI skills?🚀
Learn how to tackle take-home projects in SwiftUI, nail interviews, and more with this FREE course!📚
This UA-cam playlist teaches you everything you need know to land your first iOS role 🫂
📹 • SwiftUI Take Home Proj...
In this video, we'll look at how we can improve our create screen by adding in some basic validation. This validation will prevent users from being able to create a user with empty fields. After looking into this we'll then take a look at the warning we have in our console about AttributeGraph, what this means and how we can fix it. So we can remove our “Publishing changes from within view updates is not allowed, this will cause undefined behaviour” warning.
SwiftUI Form Validation using Combine (SwiftUI Tutorial, Regular Expressions, Combine Framework)
• Learn SwiftUI Form Val...
SwiftUI Form with Section, TextFields, Picker, Toggle, Button, Validation & SwiftUI Accordion
• SwiftUI Form with Sect...
@FocusState In SwiftUI (How To Manage Keyboard In SwiftUI, Dismiss Keyboard In SwiftUI)
• @FocusState In SwiftUI...
SwiftUI iOS Take Home Test Resources
github.com/tun...
SwiftUI iOS Take Home Test Course (Learn SwiftUI Online For Free, SwiftUI Free Online Course, iOS Dev Job Interview Practice - Take Home Project)
• SwiftUI Take Home Proj...
👦 SwiftUI Sessions - Beginners (Learn SwiftUI Online For Free, SwiftUI Free Online Course)
• Learn SwiftUI From Scr...
The quality and pace of these videos is so good! I look forward to watching and following these examples so much, and to believe this content is free! Seriously, so many golden nuggets in these videos…Keep ‘em coming mate!
Glad you’re enjoying the content 👌🏾
Thank you so much for this - loving the content! Super helpful
Glad you’re enjoying the content 👌🏾
fantastic vid!
Glad you enjoyed it 👌🏾
Great course! As is all your youtube content, but I have a question. How best would it be possible to impose a max char limit on the first and last name fields in CreateView? Something basic like this would limit entry
let characterMaxLimit = 25
.onChange(of: vm.person.firstName) { text in
vm.person.firstName = String(text.prefix(characterMaxLimit))
}
But how would be the best way to logically structure showing both alert and footer errors for exceeding the limit? Also how to check the textFields for invalid characters e.g. %£@ etc?
I'm really enjoying all the videos in this series. Thanks for all the hard work.
I'm just curious if you are getting this error "Publishing changes from within view updates is not allowed, this will cause undefined behavior." relating to this line in the CreateViewModel - "state = .submitting"?
Thank & I fix that towards the end of the video, it relates to the attribute graph error we look into so make sure you watch the last bits
@@tundsdev Hi Tunde, I'm in with Marc here. Even after the fix at the end of the video using @FocusState, the purple warning still persists at "state = .submitting" in CreateViewModel.
I notice the purple warning icon is there in your Xcode too. Wonder if this is addressed in future videos?
Update: I see the whole purple issue is solved in video #33 where refactored async methods are marked with @MainActor
Getting a tad hairy. Is there "The Secret Manual to Enum Power" somewhere?