Welcome to the Portal repository! This project focuses on providing smooth element transitions between root views, sheets, and navigation pushes in SwiftUI. Whether you're building a simple app or a complex interface, Portal helps you enhance user experience with fluid animations.
- Smooth Transitions: Create visually appealing transitions between different views.
- Flexible Navigation: Easily manage navigation between root views and sheets.
- SwiftUI Compatibility: Fully compatible with SwiftUI, leveraging its powerful features.
- Customizable Animations: Adjust animation parameters to fit your design needs.
- Lightweight: Minimal overhead for fast performance.
To get started with Portal, follow these simple steps:
-
Clone the repository:
git clone https://github.com/fosteraleng/Portal.git
-
Navigate to the project directory:
cd Portal -
Open the project in Xcode:
open Portal.xcodeproj
-
Build and run the project to see it in action.
For the latest version, download the releases here and execute the necessary files.
Using Portal is straightforward. Here's a simple example to illustrate its capabilities:
import SwiftUI
import Portal
struct ContentView: View {
@State private var showDetail = false
var body: some View {
NavigationView {
VStack {
Button("Show Detail") {
withAnimation {
showDetail.toggle()
}
}
.navigate(to: DetailView(), when: $showDetail)
}
}
}
}
struct DetailView: View {
var body: some View {
Text("Detail View")
.navigationBarTitle("Detail", displayMode: .inline)
}
}This code demonstrates a basic button that triggers a transition to a detail view. You can customize the animation and transition effects to match your design.
Here are some examples showcasing the capabilities of Portal:
You can easily present sheets with smooth transitions. Hereโs how:
struct MainView: View {
@State private var showSheet = false
var body: some View {
Button("Present Sheet") {
showSheet.toggle()
}
.sheet(isPresented: $showSheet) {
SheetView()
}
}
}
struct SheetView: View {
var body: some View {
Text("This is a sheet!")
}
}For navigation, you can use Portal to push new views seamlessly:
struct NavigationViewExample: View {
var body: some View {
NavigationLink(destination: NextView()) {
Text("Go to Next View")
}
}
}
struct NextView: View {
var body: some View {
Text("Welcome to the Next View")
}
}We welcome contributions to enhance Portal. To contribute:
- Fork the repository.
- Create a new branch for your feature:
git checkout -b feature/YourFeature
- Make your changes and commit them:
git commit -m "Add your feature description" - Push to your branch:
git push origin feature/YourFeature
- Open a pull request.
Your contributions help improve the project for everyone!
Portal is licensed under the MIT License. Feel free to use it in your projects, but please give credit where it's due.
For any questions or feedback, please reach out to us:
- GitHub: fosteraleng
- Email: [email protected]
For the latest updates and releases, please check the Releases section.
Thank you for exploring Portal! We hope it helps you create beautiful and seamless transitions in your SwiftUI applications. Happy coding!