I created a Snackbar style messages in Swift for iOS. I need to understand to which view I add the Snackbar as a subview. Example for one of the problems: I have a scrollview with a lot of content. When you press a button somewhere inside the UIScrollView I want the message to pop from the bottom of screen and it will stay at the bottom of the screen even if the user keeps scrolling the UIScrollView. How do I determine which view is above the scrollview for me to add snackbar as a subview to it?
Asked
Active
Viewed 464 times
0
-
self.view .bringSubviewToFront(yourview) – Gokul G Aug 10 '16 at 13:08
2 Answers
1
You need to create a separate view which will be hidden until you populate it, that floats over the scrollview. It needs to be out of the context of the scrollview so that it doesn't move with all the rest of the content. you will still be able to scroll though so this should do the trick.

AMAN77
- 6,218
- 9
- 45
- 60