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)
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⁉ 😕
@@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.
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! 🧐
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
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)
Thank you Stewart. This solves a problem I was having in an app and adding a help button to screens.
Very well thought out idea. This sort of help would be a great addition to a large percentage of iOS apps.
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⁉ 😕
Looks OK to me in the completed source code so I am not sure I understand what you are referring to
@@StewartLynch Didn't mean to be obtuse. In the video, @31:41 it seems the indicator is flush with the bottom edge, No?
@@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.
Thanks!
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! 🧐
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
Thanks!
Thanks!