Stop using GeometryReader in SwiftUI

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 มิ.ย. 2024
  • 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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 24

  • @FloWritesCode
    @FloWritesCode  หลายเดือนก่อน +3

    How will you use this API?

  • @CodingSwiftWithNico
    @CodingSwiftWithNico หลายเดือนก่อน +1

    Sehr guter Tipp! Danke fürs zeigen 👍

  • @swiftandtips
    @swiftandtips หลายเดือนก่อน +2

    Very useful information! Thanks for sharing Flo! 🙌🏻

  • @tylerwatt5651
    @tylerwatt5651 หลายเดือนก่อน +1

    Awesome! I'm right in the process of GeoReader and considering a second option. I think this will work! Thank you!

    • @FloWritesCode
      @FloWritesCode  หลายเดือนก่อน

      Glad it was helpful!

  • @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

  • @rahuljamba5846
    @rahuljamba5846 หลายเดือนก่อน +1

    Good tips !!

  • @ScottSmithDev
    @ScottSmithDev หลายเดือนก่อน +1

    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  หลายเดือนก่อน

      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 หลายเดือนก่อน +1

    Thank you...

  • @natgenesis5038
    @natgenesis5038 23 วันที่ผ่านมา

    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 หลายเดือนก่อน +1

    🔥🔥🔥

  • @0xifarouk
    @0xifarouk หลายเดือนก่อน +1

    Maybe this uses GeometryReader behind the scene?

    • @FloWritesCode
      @FloWritesCode  หลายเดือนก่อน

      We'll probably never know :/

    • @meowpeow765
      @meowpeow765 หลายเดือนก่อน

      Swift is open sourced though :)

    • @FloWritesCode
      @FloWritesCode  หลายเดือนก่อน

      @@meowpeow765 Yup, but this is about SwiftUI, which isn't :/

  • @kamilsuleymanov7197
    @kamilsuleymanov7197 หลายเดือนก่อน +9

    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+)"