Stop using Spacer() in SwiftUI

  Рет қаралды 12,723

Flo writes Code

Flo writes Code

Күн бұрын

Пікірлер: 41
@nickdalts
@nickdalts Ай бұрын
I had absolutely no idea about that autocompletion trick, thanks!
@martinq872
@martinq872 Жыл бұрын
Oh! You finally make video about spacer! I’ve wait for this from you said on short video until now! 😁
@easybusinessou
@easybusinessou 24 күн бұрын
Great content! Just a small suggestion: it would be even better if the focus was more on the screen code with fewer transitions. Also, keeping your photo in a small circle in the corner works well. Thanks for the valuable insights!
@abdulkarimkhaan
@abdulkarimkhaan 11 ай бұрын
I have been creating SwiftUI tutorials from last two months and this is a great piece of advice for aligning texts or view. It will increase readability by keeping code clean. Will definitely use this from now onwards. Big Thanks!! :))
@FloWritesCode
@FloWritesCode 11 ай бұрын
Great to hear!
@natgenesis5038
@natgenesis5038 4 ай бұрын
Very facts i just found that , since i started caring other screen sizes .
@yeserguitar
@yeserguitar Жыл бұрын
Good suggestion for a neat and readable code. Thank you!
@marcesmack
@marcesmack 3 күн бұрын
Great video! What’s the best way to keep the size of the window or at least a minimum size and proportions on visionOS?
@illyakrit7494
@illyakrit7494 Жыл бұрын
Nice Star Wars helmets! And advices are very useful
@ramonteiro
@ramonteiro 10 ай бұрын
Totally agree. 4 Spacer() to only keep a Text in a corner seems quite verbose 😅Thanks for the tip
@FloWritesCode
@FloWritesCode 10 ай бұрын
You're welcome!
@rahuljamba5846
@rahuljamba5846 5 ай бұрын
Great thanks for sharing your knowledge 📚
@FloWritesCode
@FloWritesCode 4 ай бұрын
My pleasure!
@holgerflick
@holgerflick Жыл бұрын
Great video! Thank you! Just a note... did you notice the flicker after most of the pans? It is quite unnerving and distracts from the excellent content.
@FloWritesCode
@FloWritesCode Жыл бұрын
Thanks. I already passed that on to this video‘s editor and it seems to have been a rendering issue in Premiere. Will hopefully be fixed in all videos going forward👍🏼
@alihodroj9559
@alihodroj9559 9 ай бұрын
Great tips! Thanks a lot for the video.
@FloWritesCode
@FloWritesCode 9 ай бұрын
Glad it was helpful!
@swiftandtips
@swiftandtips Жыл бұрын
Great tip! 😃
@DevLiuSir
@DevLiuSir Жыл бұрын
Thanks! Simplified a lot.
@FloWritesCode
@FloWritesCode Жыл бұрын
Glad it helped!
@KevinChromik
@KevinChromik Жыл бұрын
Very useful, thanks!
@rahuljamba5846
@rahuljamba5846 Жыл бұрын
Great 💡 tips thanks for sharing
@sunrizz
@sunrizz Жыл бұрын
Great! Thanks! 🙌
@fsck-music
@fsck-music 6 ай бұрын
What's the shortcut to take what you've highlighted and place it within curly braces? I've been doing this by hand 💀
@FloWritesCode
@FloWritesCode 6 ай бұрын
Just use the curly braces, there's no shortcut. Xcode automatically places them around the selected lines :D
@simonIsDev
@simonIsDev 6 ай бұрын
it's so usefull for me
@natgenesis5038
@natgenesis5038 4 ай бұрын
GeometryReader,Stacks and Padding are enough
@Scott-oe7dv
@Scott-oe7dv 4 ай бұрын
what was the short cut you used to add outer {} to a view?
@FloWritesCode
@FloWritesCode 4 ай бұрын
No shortcut, just select mutliple lines and type a {
@vsemenchenko
@vsemenchenko Жыл бұрын
Thanks! Is using overlay efficient rather than ZStack+VStack?
@FloWritesCode
@FloWritesCode Жыл бұрын
Since SwiftUI is closed-source, I really don't know how things are implemented under the hood :/
@redhotbits
@redhotbits Жыл бұрын
just male view extension with spacers
@CarstenVoss-oh2el
@CarstenVoss-oh2el 3 ай бұрын
Sorry but this is title is confusing for new people. This works as long as you use view which tries to take as much space as possible (e.g. Color). If one would use your advise and overlay a Text with an Image, one need to set a frame on the text with the correct size and alignment for that frame. Additionally, as the modifier name suggests, the content of the original view could overlapped by the overlay.
@ivenprillwitz
@ivenprillwitz Жыл бұрын
Of don’t get what’s wrong with spacer(). Easy to read.
@FloWritesCode
@FloWritesCode Жыл бұрын
Yup, in some cases it really makes sense. This video just shows an alternative that can be cleaner at times :D
@indomitabletr1834
@indomitabletr1834 Жыл бұрын
@@FloWritesCode I agree, different scenarios for different needs
@tokero5199
@tokero5199 7 ай бұрын
@@FloWritesCode Your video is literally called Stop using Spacer() in SwiftUI...
@natgenesis5038
@natgenesis5038 4 ай бұрын
Other screen sizes
@Hewhogotslapd
@Hewhogotslapd 5 ай бұрын
Title is misleading for beginners. Geomettery reader is great for the example that you shared, however for more simple UIs Spacer is much easier to use and creates less code complexity. Otherwise great video.
@FloWritesCode
@FloWritesCode 5 ай бұрын
How is GeometryReader relevant here?
@natgenesis5038
@natgenesis5038 4 ай бұрын
For all screen sizes spacer() is nightmare . GeometryReader is very powerful for all screen sizes and position .
Introduction to SwiftData (WWDC23)
7:39
Flo writes Code
Рет қаралды 13 М.
Илья Чикмарев - Performance в SwiftUI
31:05
CocoaHeads
Рет қаралды 2,9 М.
Bike vs Super Bike Fast Challenge
00:30
Russo
Рет қаралды 23 МЛН
Modus males sekolah
00:14
fitrop
Рет қаралды 20 МЛН
My daughter is creative when it comes to eating food #funny #comedy #cute #baby#smart girl
00:17
5 SwiftUI Features You Didn’t Know!
8:38
Flo writes Code
Рет қаралды 1,9 М.
UI Libraries Are Dying, Here's Why
13:28
Theo - t3․gg
Рет қаралды 311 М.
SwiftUI tutorial: Using Spacer within Stacks to align views
4:40
MagiCat ⚡️🐾
Рет қаралды 148
Stop using Spacer in SwiftUI (and what to use instead)
13:14
Rebeloper - Rebel Developer
Рет қаралды 3 М.
How to use Alignment Guides in SwiftUI | Continued Learning #32
13:07
Swiftful Thinking
Рет қаралды 3,7 М.
Stop using GeometryReader in SwiftUI
4:27
Flo writes Code
Рет қаралды 4,9 М.
Most overpowered way to build mobile apps?
8:33
Beyond Fireship
Рет қаралды 794 М.
WWDC23: Beyond scroll views | Apple
14:47
Apple Developer
Рет қаралды 32 М.
Bike vs Super Bike Fast Challenge
00:30
Russo
Рет қаралды 23 МЛН