Stop using GeometryReader in SwiftUI

  Рет қаралды 3,839

Flo writes Code

Flo writes Code

Күн бұрын

GeometryReader is commonly used to control the size of a View w.r.t its parent View/container. Let's explore a simple ViewModifier in iOS 17 that makes this so much easier and nicer to read.
🚀 LaunchBuddy: apple.co/3iFcjjW
📚 Try CWC+: bit.ly/cwc_flo
☕️ Buy me a coffee: ko-fi.com/flowritescode
Join this channel to get access to perks:
/ @flowritescode
👋 Links: flowritesco.de
🛠 Forge: apple.co/3riG8MQ
Chapters:
0:00 GeometryReader Example
2:10 containerRelativeFrame
Affiliate Links ❤
📕 SwiftUI & Combine Books: www.bigmountainstudio.com/a/t...
🔬 Get Reports about your apps: appfigures.com/r/5by3g
📊 Privacy focused analytics: dashboard.telemetrydeck.com/r...
💻 The most powerful mac app for developers: devutils.app/?ref=flo
☕️ Support me: ko-fi.com/flowritescode
If you have any video suggestions please feel free to let me know by a comment.
Get in contact via
Twitter: / flowritescode

Пікірлер: 26
@FloWritesCode
@FloWritesCode 2 ай бұрын
How will you use this API?
@CodingSwiftWithNico
@CodingSwiftWithNico 2 ай бұрын
Sehr guter Tipp! Danke fürs zeigen 👍
@swiftandtips
@swiftandtips 2 ай бұрын
Very useful information! Thanks for sharing Flo! 🙌🏻
@FloWritesCode
@FloWritesCode 2 ай бұрын
My pleasure!!
@tylerwatt5651
@tylerwatt5651 2 ай бұрын
Awesome! I'm right in the process of GeoReader and considering a second option. I think this will work! Thank you!
@FloWritesCode
@FloWritesCode 2 ай бұрын
Glad it was helpful!
@rahuljamba5846
@rahuljamba5846 2 ай бұрын
Good tips !!
@FloWritesCode
@FloWritesCode 2 ай бұрын
Thanks!
@aMazinglyKeNn
@aMazinglyKeNn 11 күн бұрын
This is a good example! I did learn recently however that although this modifier will work on most things like List and NavigationStack, it does not work on some things like HStack or VStack.
@ScottSmithDev
@ScottSmithDev 2 ай бұрын
Awesome Flo - thank you for the clear demo! I didn't know about his modifier! I'd image I'll use it for all sorts of things, including a custom bottom sheet (when your app doesn't support the SwiftUI iOS version to use detents) combined with ScaledMetric or something. Anyway, thanks again!
@FloWritesCode
@FloWritesCode 2 ай бұрын
Hey Scott! This sounds great, but unfortunately this API was only introduced in iOS 17... So it's not really suitable for you use case :/
@andrejkling3886
@andrejkling3886 2 ай бұрын
Thank you...
@Jon88938
@Jon88938 2 ай бұрын
I don’t think this modifier works relative to the parent view like geometry reader does. Instead it works relative to a container which is a window, scroll view or navigation stack
@natgenesis5038
@natgenesis5038 Ай бұрын
GeometryReader is good for all iOS devices if you wanna keep the same size based screen size
@ags2099
@ags2099 Ай бұрын
Ein tutorial zum thema animationen wäre richtig cool 🎉
@FloWritesCode
@FloWritesCode Ай бұрын
Welche Art von Animationen würdest du gerne lernen? .animation, .symbolEffect oder PhaseAnimator?
@ags2099
@ags2099 Ай бұрын
⁠@@FloWritesCodeist .animation nicht veraltet? Ansonsten sowohl symboleffect als auch phase wäre ganz cool. Vielleicht als Video Idee für dich "Introduction into Animations"
@ilyabiltuev
@ilyabiltuev 2 ай бұрын
🔥🔥🔥
@0xifarouk
@0xifarouk 2 ай бұрын
Maybe this uses GeometryReader behind the scene?
@FloWritesCode
@FloWritesCode 2 ай бұрын
We'll probably never know :/
@meowpeow765
@meowpeow765 Ай бұрын
Swift is open sourced though :)
@FloWritesCode
@FloWritesCode Ай бұрын
@@meowpeow765 Yup, but this is about SwiftUI, which isn't :/
@asl-pls-im
@asl-pls-im 18 күн бұрын
Yes... we will stop using GeometryReader maybe in 2 years =)))
@kamilsuleymanov7197
@kamilsuleymanov7197 2 ай бұрын
Stop using iOS 17 only)
@FloWritesCode
@FloWritesCode 2 ай бұрын
Tell Apple to stop shipping SwiftUI updates that aren't backwards-compatible...
@aznixqorodok
@aznixqorodok 2 ай бұрын
@@FloWritesCode New title: "Stop using GeometryReader in SwiftUI (iOS 17+)"
Horizontal Layouts on macOS (SwiftUI)
5:04
Flo writes Code
Рет қаралды 495
5 SwiftUI Features You Didn’t Know!
8:38
Flo writes Code
Рет қаралды 1,8 М.
OMG😳 #tiktok #shorts #potapova_blog
00:58
Potapova_blog
Рет қаралды 4,1 МЛН
I CAN’T BELIEVE I LOST 😱
00:46
Topper Guild
Рет қаралды 78 МЛН
Tudia Pixel 8a Case Review
3:01
Dalevon Digital
Рет қаралды 15
GeometryReader in SwiftUI: An Annoying Nightmare
24:00
Rebeloper - Rebel Developer
Рет қаралды 754
A better AsyncImage with cache in SwiftUI
16:53
Swift and Tips
Рет қаралды 10 М.
The BEST Way to Build an App
6:29
Flo writes Code
Рет қаралды 1,3 М.
SwiftUI: New Observation Framework
8:25
Mike Mikina
Рет қаралды 1,7 М.
JavaScript Visualized - Event Loop, Web APIs, (Micro)task Queue
12:35
WWDC23: Beyond scroll views | Apple
14:47
Apple Developer
Рет қаралды 30 М.
ChatGPT Just Learned To Fix Itself!
5:47
Two Minute Papers
Рет қаралды 23 М.
Enums considered harmful
9:23
Matt Pocock
Рет қаралды 196 М.
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 57 МЛН
Спутниковый телефон #обзор #товары
0:35
Product show
Рет қаралды 1,9 МЛН
ИГРОВОВЫЙ НОУТ ASUS ЗА 57 тысяч
25:33
Ремонтяш
Рет қаралды 310 М.
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00
Корнеич
Рет қаралды 3,4 МЛН