Simple ExpandableView for iOS app.
Add this file to your project.
- You need to create a View object in your Storyboard and set its class to
ExpandableView. - Then create 2 UIView objects inside of it, create a height constraint for each and connect them as
firstViewandsecondView. (This class creates alignsfirstViewandsecondViewto self with constraints. You should not add those.)
Done. You can tap your expandableView or use expand() and collapse() methods to change its state.
If you don't want to have any warning inside of your Interface Builder, you can add all constraints you need and set them to remove at build time.
- Easier setup
- @IBDesignable