Build a stretchy header with SwiftUI on iOS 18

Поделиться
HTML-код
  • Опубликовано: 6 янв 2025

Комментарии • 10

  • @RFIHW
    @RFIHW Месяц назад

    I'm still using geometry in background Color to get offset, which is the only way I tested with acceptable frequency.

  • @tokero5199
    @tokero5199 6 месяцев назад +3

    Cool. Now we just have to way a few years to be able to use it because Apple does not want to backport UI like Android has AndroidX....

  • @xzilja
    @xzilja 6 месяцев назад +1

    Hard to tell from the video, but did you by any chance notice a bit "out of sync" in scrolling and transitioning when using this modifier? I just did simple recreation with it and GeometryReader and it seems as if geometry reader is more accurate "reactive". Particularly when scrolling super slow

    • @DonnyWalsdev
      @DonnyWalsdev  6 месяцев назад

      I didn't notice any, but I also have to admit I didn't compare and do super slow scrolls so you might be right.
      Wonder about the overall performance difference though; GeometryReader in general is very slow. It'd be interesting to compare performance on increasingly large and complex views to see if one breaks down where the other doesn't

  • @w0mblemania
    @w0mblemania 6 месяцев назад

    Donny, at the beginning of the video, the list of items is overlapping the header in a nasty way.
    This may be because you have set a fixed height for the rectangle (300 pts). So the image height is being adjusted dynamically, but the rectangle is not.
    Cheers.

    • @DonnyWalsdev
      @DonnyWalsdev  6 месяцев назад

      Do you mean there’s a glitch while I’m messing around with scrolling in the beginning? Not sure why that happened.
      Changing the rectangles height causes the entire scroll view to glitch unfortunately; otherwise the header image could have been in the scroll view and we wouldn’t have needed the ZStack at all.

    • @jrgibson
      @jrgibson 6 месяцев назад

      @@DonnyWalsdev I noticed that glitch happens with my app in 18 too, I raised feedback for it.