A expandable view, Developed using SwiftUI.
- Xcode 14.3 or Above
- Clone the repo
git clone https://github.com/Mobile-Apps-Academy/ExpandableViewSwiftUI.git
- How to create the expandable view
ExpandableView(thumbnail: ThumbnailView {
VStack(alignment: .leading, spacing: 10) {
Text("The art of being an artist")
.frame(maxWidth: .infinity, alignment: .leading)
.foregroundStyle(.white)
.font(.custom("ArialRoundedMTBold", size: 20))
Text("Reading time: 3 mins")
.font(.custom("ArialRoundedMTBold", size: 8))
.foregroundStyle(.white)
}
.padding()
}, expanded: ExpandedView {
VStack(alignment: .leading, spacing: 12) {
Text("The art of being an artist")
.frame(maxWidth: .infinity, alignment: .leading)
.foregroundStyle(.white)
.font(.custom("ArialRoundedMTBold", size: 28))
Text("Reading time: 3 mins")
.font(.custom("ArialRoundedMTBold", size: 14))
.foregroundStyle(.white)
Text("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore aliqua.")
.font(.custom("ArialRoundedMT", size: 14))
.foregroundStyle(.white)
Spacer()
}
.padding()
}, thumbnailViewBackgroundColor: Color("Gray").opacity(0.7), expandedViewBackgroundColor: Color("Gray"))}Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt for more information.
