I’m constructing an app, but I’m having a bit of trouble figuring out the best way to construct this relatively simple UI element:
At first I was creating the views programmatically and adding them as a subview - but was running into some Auto Layout troubles. Then I decided to simply create a couple of views on the Storyboard, then just animated them up and down like this:
This works - but seems kinda kludgy - and there’s one bug. If you close the app then come back to it (and if the second option is selected (the views are moved up) the last time you were in it), then the Auto Layout vertical space kicks in and pushes everything down while the second option’s alpha is 1.
I’m sure there’s a more elegant way to do this. Here are some of the ways I’ve thought of…
• create Xibs of the two views so I can reuse them someone else if I have to.
• use a collectionview and just scroll to the indexPath.
Any thoughts on the best way to approach something like this?