Performance between LazyVStack, VStack and List

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

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

Пікірлер: 25
@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! ☺️
@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!
@isurujn
@isurujn 6 ай бұрын
Thanks for this. Really helped me make the decision on what to use when.
@swiftandtips
@swiftandtips 6 ай бұрын
Awesome! 🚀
@freakpunker
@freakpunker Жыл бұрын
Excellent video! 👍🏻
@swiftandtips
@swiftandtips Жыл бұрын
Thank you! 🙏
@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! ☺️
@protaotogamer1503
@protaotogamer1503 2 жыл бұрын
As usual epic video
@swiftandtips
@swiftandtips 2 жыл бұрын
Thank you @Protaotogamer 🙌🏼
@MohammadRaziPour
@MohammadRaziPour 2 жыл бұрын
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.
@xalizalizx
@xalizalizx 3 ай бұрын
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 3 ай бұрын
That’s a default behavior since UIKit to save memory. developer.apple.com/documentation/uikit/uitableviewcell/1623223-prepareforreuse
@xalizalizx
@xalizalizx 3 ай бұрын
@@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
Async/Await in Swift | Comparison vs Closures and Combine Framework
19:59
Пранк пошел не по плану…🥲
00:59
Саша Квашеная
Рет қаралды 7 МЛН
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 51 МЛН
VStack, HStack, and ZStack in SwiftUI | Bootcamp #10
21:37
Swiftful Thinking
Рет қаралды 39 М.
SwiftUI List with Custom Cell & Passing Data
36:27
Sean Allen
Рет қаралды 115 М.
@EnvironmentObject Explained in SwiftUI | iOS 17
21:16
AppStuff
Рет қаралды 5 М.
SwiftUI List Explained | All Modifiers & Styles
11:49
Flo writes Code
Рет қаралды 2,7 М.
How to use NavigationStack in SwiftUI | Bootcamp #62
23:59
Swiftful Thinking
Рет қаралды 32 М.
Запрещенный Гаджет для Авто с aliexpress 2
0:50
Тимур Сидельников
Рет қаралды 1,1 МЛН
Частая ошибка геймеров? 😐 Dareu A710X
1:00
Вэйми
Рет қаралды 5 МЛН
Как удвоить напряжение? #электроника #умножитель
1:00
Hi Dev! – Электроника
Рет қаралды 1,1 МЛН
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 7 МЛН