A morphing effect when a shape is draged from its position, Developed using SwiftUI.
- Xcode 14.3 or Above
- Clone the repo
git clone https://github.com/Mobile-Apps-Academy/SideMenuSwiftUI.git
- How to create the side view
SideView(isShowing: $presentSideMenu, direction: .leading) { // presentSideMenu is state bool
SideMenuViewContents(presentSideMenu: $presentSideMenu)
.frame(width: 300)
}- How to create the content view
struct SideMenuViewContents: View {
@Binding var presentSideMenu: Bool
var body: some View {
ZStack {
VStack(alignment: .leading, spacing: 0) {
SideMenuTopView()
VStack {
Text("Side Menu")
.foregroundColor(.white)
}.frame( maxWidth: .infinity, maxHeight: .infinity)
}
.frame(maxWidth: .infinity)
.background(.gray)
}
}
func SideMenuTopView() -> some View {
VStack {
HStack {
Button(action: {
presentSideMenu.toggle()
}, label: {
Image(systemName: "x.circle")
.resizable()
.aspectRatio(contentMode: .fit)
.foregroundColor(.white)
})
.frame(width: 34, height: 34)
Spacer()
}
}
.frame(maxWidth: .infinity)
.padding(.leading, 40)
.padding(.top, 40)
.padding(.bottom, 30)
}
} 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.
