How to Create a Custom Help System in SwiftUI - A Reusable Solution for Your Apps

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

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

  • @StewartLynch
    @StewartLynch  15 дней назад +1

    If you want to make sure that the text in the scrollView will only scroll if necessary (by this, I mean that if the text is not long enough to require scrolling, then why have a scroll view) you can add this modifier to the scrollView
    .scrollBounceBehavior(.basedOnSize)

  • @SkipKelley56
    @SkipKelley56 День назад

    Thank you Stewart. This solves a problem I was having in an app and adding a help button to screens.

  • @jamesrea329
    @jamesrea329 22 часа назад

    Very well thought out idea. This sort of help would be a great addition to a large percentage of iOS apps.

  • @obelix8477
    @obelix8477 День назад

    Great lesson in application architecture! Reusable components aren't really taught this thoroughly in other RUclips tutorials. +50 Points to Ravenclaw.
    In my mind, I wanted you to add padding to the bottom of the *HelpIndicatorView* to push it up from the bottom a bit. Indeed @22:21 you add *bottom* padding. However, in the iPad simulator @31:41 the indicator is flush with the bottom edge of the *HelpView()* . Seems the padding() is ignored in a modal sheet⁉ 😕

    • @StewartLynch
      @StewartLynch  18 часов назад

      Looks OK to me in the completed source code so I am not sure I understand what you are referring to

    • @obelix8477
      @obelix8477 18 часов назад

      @@StewartLynch Didn't mean to be obtuse. In the video, @31:41 it seems the indicator is flush with the bottom edge, No?

    • @StewartLynch
      @StewartLynch  18 часов назад

      @@obelix8477 I see what you mean, but when I use my completed source code that is not the case. I must fix the issue somewhere but I created this video over a month ago so I forget where I fixed that. Check for diffs in my source code.

  • @AndrewDChristie
    @AndrewDChristie День назад

    Thanks!

  • @obelix8477
    @obelix8477 День назад

    Animation question. @20:55 you add a nice easeInOut animation to the HelpIndicatorView's HStack of page buttons. The animation is triggered whenever the struct's scrollID changes. Superb!
    Then @32:27 you debug the HelpIndicatorView button by updating the scrollID value with the ForEach index of the tapped Button. Why is it necessary to wrap the assignment in a withAnimation{} block? Since the entire HStack animates when the scrollID changes, why is it necessary to explicitly wrap the assignment statement at line 28? This student is curious! 🧐

    • @StewartLynch
      @StewartLynch  18 часов назад

      If you don't wrap in an animation block and you tap on one of those indicates, it jumps directly to that page without a smooth transition. Remove the animation block and you will notice the difference

  • @AndrewDChristie
    @AndrewDChristie День назад

    Thanks!

  • @AndrewDChristie
    @AndrewDChristie День назад

    Thanks!