Building REUSABLE SwiftUI components - Peter Friese | Swift Heroes 2023 Talk

  Рет қаралды 15,461

Swift Heroes

Swift Heroes

Күн бұрын

Пікірлер: 22
@olegmyatlikov
@olegmyatlikov 10 ай бұрын
Thanks for the report Peter Friese! Very useful tips. I faced the same problems when I refactored my project from UIKit to SwiftUI. I wish this report was available when I did this. The report would save me a lot of time :)
@SwiftHeroes
@SwiftHeroes 10 ай бұрын
Thanks for sharing! 👍
@phukieu4238
@phukieu4238 9 ай бұрын
A question doesn’t relate to the topic, but I saw you inject service instance in Login View, so what is responsibility of LoginViewModel? It just keep state of Login View, right? 33:08
@chesterman18g
@chesterman18g 10 ай бұрын
very good talk, Thank You Peter!
@SwiftHeroes
@SwiftHeroes 10 ай бұрын
Glad you liked it! 🧡
@MrKhanLabRunner
@MrKhanLabRunner 4 ай бұрын
Would love to see how to unit test this environment logic
@tbg6nb
@tbg6nb 8 ай бұрын
19:32 I am still not getting it. What is the benefit of the entire environment stuff over using "var clearButtonHidden = true" inside the TextInputField and passing "false" two times in the init ?
@cordlc
@cordlc 4 ай бұрын
I think your method would force a default of "true," while the environment method can have any "default" in any given scope
@caldera726
@caldera726 11 ай бұрын
Great video! I'm curious, is there a particular reason for not using a viewModel? Wouldn't this result in tighter coupling of Views, potentially reducing their reusability?
@PeterFriese
@PeterFriese 10 ай бұрын
Hey @caldera726 - which part of the video are you referring to?
@trungnguyenthanh9233
@trungnguyenthanh9233 11 ай бұрын
Nice
@waheedafolabi6929
@waheedafolabi6929 7 ай бұрын
I so much love ❤️ this. Is the code 👨‍💻 available?
@ihorzhukov
@ihorzhukov 5 ай бұрын
What is the reason to use environments, but not init with default values for a custom TextField? Just to have the same init as an original TextField? I mean anyway you have to not just substitute one line TextField on TextInputField in this case.
10 ай бұрын
Nice "input" 👏
@SwiftHeroes
@SwiftHeroes 10 ай бұрын
Thanks! 😃
@Stricken174
@Stricken174 10 ай бұрын
i dont see any benefits of extract to functions, except when where is a switch. Extracted Text with modifiers doesnt make sense because its the same view with the same specs but with more lines of code.
@SwiftHeroes
@SwiftHeroes 10 ай бұрын
Interesting observation, we asked peter to reply to you 😉
@PeterFriese
@PeterFriese 10 ай бұрын
Keep in mind this is mostly to demonstrate the technique, so the example is deliberately simple. There are many cases where this makes sense and will make your code more maintainable.
@Stricken174
@Stricken174 10 ай бұрын
​@@PeterFriese acceptable) Don't think that I'm underestimate you) Common situation when extracting subviews is extracting them with all modifiers inside. So you're actually cant reuse it in the most cases. Designers nowadays can be the pain in the.. you know)
@thisissergo5874
@thisissergo5874 2 ай бұрын
If you put reusable components everywhere you will be confused very soon, it is better to keep simplicity and don't overcome with a lot of functionalities
@SeveSands-ey9he
@SeveSands-ey9he Ай бұрын
🥱
@mithun-ytcom
@mithun-ytcom 26 күн бұрын
SwiftUI Grids - LazyVGrid, LazyHGrid, Static Grid
17:55
Sean Allen
Рет қаралды 15 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
SwiftUI Architecture - Best Practices and Principles
39:04
AppForce1
Рет қаралды 4,2 М.
These Swift 6 Features Change a Lot! | @SwiftBird
17:10
The Swift Bird
Рет қаралды 6 М.
SwiftUI Tooltips with TipKit (Popover & Inline Tips)
16:17
Sean Allen
Рет қаралды 17 М.
Your Brain 🧠 on Swift Concurrency - iOS Conf SG 2023
30:38
iOS Conf SG
Рет қаралды 11 М.
I Made an iOS App in MINUTES with This AI Tool!
13:20
Creator Magic
Рет қаралды 654 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН