Performance between LazyVStack, VStack and List

  Рет қаралды 9,177

Swift and Tips

Swift and Tips

Күн бұрын

Hello guys!
I started this channel talking about stacks in SwiftUI, today we will talk about another stack: LazyVStack.
Let's see what's the difference between regular VStack and List. By the way, we will focus only on vertical stacks, but this also will apply to horizontal ones.
Content:
0:00 - Intro
0:39 - What is a VStack?
3:21 - LazyVStack to the rescue!
4:41 - List vs LazyVstack
5:46 - VStack loading images from the network ❌
6:52 - More between List and LazyVStack
7:45 - Do you want to learn more?
------
Source code showed in the video: github.com/pitt500/Pokedex/tr...
------
Resources:
* LazyVStack: developer.apple.com/documenta...
* Stacks, Grids, and Outlines in SwiftUI: developer.apple.com/videos/pl...
------
Other videos in the channel:
* CacheAsyncImage: • A better AsyncImage wi...
* What's new in SwiftUI 3.0: • What's new in SwiftUI ...
* Swift Concurrency: • Swift Concurrency
-----
Don't forget to subscribe to the channel, like it, and follow me on social media:
Twitter:
/ swiftandtips
/ pitt500
Finally, ask me for a video you would like to see next 😄!
Credits:
- Music by Wataboi from pixabay.com/
- Video edited with LumaFusion

Пікірлер: 26
@Kevin_Zed
@Kevin_Zed Жыл бұрын
I found this very helpful. You asnwered my concerns and provided even more helpful knowledge that I wasn't aware of.
@ColeDano
@ColeDano 2 жыл бұрын
Great explanation, seeing the memory usage really made it clear.
@swiftandtips
@swiftandtips 2 жыл бұрын
Thank you @Cole! I found that example accidentally and it was great 😆
@trevormills
@trevormills 2 жыл бұрын
Excellent explanation. So clear and easy to understand - Thank you.
@swiftandtips
@swiftandtips 2 жыл бұрын
You’re welcome Trevor! ☺️
@isurujn
@isurujn 5 ай бұрын
Thanks for this. Really helped me make the decision on what to use when.
@swiftandtips
@swiftandtips 5 ай бұрын
Awesome! 🚀
@yeshadithya
@yeshadithya 2 жыл бұрын
This one is great lessons for me when developing app without using extra memory usages and thank you for your valuable lesson❤
@swiftandtips
@swiftandtips 2 жыл бұрын
I’m glad the video was useful for you 😄 Thank you @Yesh!
@freakpunker
@freakpunker Жыл бұрын
Excellent video! 👍🏻
@swiftandtips
@swiftandtips Жыл бұрын
Thank you! 🙏
@protaotogamer1503
@protaotogamer1503 2 жыл бұрын
As usual epic video
@swiftandtips
@swiftandtips 2 жыл бұрын
Thank you @Protaotogamer 🙌🏼
@sipanhazim4128
@sipanhazim4128 2 жыл бұрын
I am using VStack in my projects and always wondered why performance is heavy and slow ..Thank you !!!!
@swiftandtips
@swiftandtips 2 жыл бұрын
I’m glad to read this was useful for you @Sipan! ☺️
@MohammadRaziPour
@MohammadRaziPour Жыл бұрын
Thanks, great
@leandroandrade8490
@leandroandrade8490 Жыл бұрын
Maybe use List is not a problem when e.g. fetch data from external API using pagination. Thanks for your explanation.
@VictorRiurean-ee7fj
@VictorRiurean-ee7fj Жыл бұрын
nice
@xalizalizx
@xalizalizx 2 ай бұрын
Is there a reference/proof that List "reuse" cells? I tried to find, although some StackOverflow answers says it is, there's no official reference on this behavior. So just wondering if you have more info on this :).
@swiftandtips
@swiftandtips 2 ай бұрын
That’s a default behavior since UIKit to save memory. developer.apple.com/documentation/uikit/uitableviewcell/1623223-prepareforreuse
@xalizalizx
@xalizalizx 2 ай бұрын
@@swiftandtips Yes, I’m aware prepareForReuse() exists. But how do you know SwiftUI List uses it?
@natureloverspakistan
@natureloverspakistan 2 жыл бұрын
I have lazyVStack reviews list . But when I scroll , in review Row .. rating stars are getting hide by self
@swiftandtips
@swiftandtips 2 жыл бұрын
Hi @NatureLovers, not sure if I follow your comment. What is your approach? Could you share a piece of code?
@natureloverspakistan
@natureloverspakistan 2 жыл бұрын
@@swiftandtips sure I will share it
@pe60t0
@pe60t0 2 жыл бұрын
b stack renders biews in bertical order
@swiftandtips
@swiftandtips 2 жыл бұрын
Bery good! 🙃
How to replicate Apple Watch home layout with Lazy Grids? #SwiftUI
16:55
A better AsyncImage with cache in SwiftUI
16:53
Swift and Tips
Рет қаралды 10 М.
Nutella bro sis family Challenge 😋
00:31
Mr. Clabik
Рет қаралды 12 МЛН
KINDNESS ALWAYS COME BACK
00:59
dednahype
Рет қаралды 137 МЛН
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 59 МЛН
VStack, HStack, and ZStack in SwiftUI | Bootcamp #10
21:37
Swiftful Thinking
Рет қаралды 38 М.
SwiftUI List Explained | All Modifiers & Styles
11:49
Flo writes Code
Рет қаралды 2,6 М.
How to use NavigationStack in SwiftUI | Bootcamp #62
23:59
Swiftful Thinking
Рет қаралды 31 М.
How to Get User Location on a Map - Swift
26:11
Sean Allen
Рет қаралды 62 М.
LazyVGrid, LazyHGrid, and GridItems in SwiftUI | Bootcamp #16
22:16
Swiftful Thinking
Рет қаралды 42 М.
iPhone 15 Pro в реальной жизни
24:07
HUDAKOV
Рет қаралды 204 М.
⚡️Супер БЫСТРАЯ Зарядка | Проверка
1:00
Tag her 🤭💞 #miniphone #smartphone #iphone #samsung #fyp
0:11
Pockify™
Рет қаралды 38 МЛН
Как правильно выключать звук на телефоне?
0:17
Люди.Идеи, общественная организация
Рет қаралды 727 М.