EC Sliding View Controller is a customizable container view controller that allows for a sliding main view and a side menu view. Providing a sleek and intuitive navigation experience, it is a great choice for building modern and user-friendly iOS applications.
Features
- Sliding navigation with a main view and side menu view
- Customizable animation and transition effects
- Support for dynamic sizing and autolayout
- Gesture-based interactive sliding
- Support for both left and right side menus
- Effortless integration with existing view controllers
Installation
You can easily integrate EC Sliding View Controller into your project using either Swift Package Manager or CocoaPods.
Swift Package Manager
To add EC Sliding View Controller to your project using Swift Package Manager, follow these steps:
- In Xcode, select your project and navigate to the “Swift Packages” tab.
- Click the “+” button and enter the Git URL of EC Sliding View Controller repository.
- Specify the desired version or leave it as “Up to Next Major” for the latest version.
- Click “Next” and let Xcode resolve the package and complete the integration.
- Import the module in your code using
import ECSlidingViewController
.
CocoaPods
To include EC Sliding View Controller using CocoaPods, follow these steps:
- Add
pod 'ECSlidingViewController'
to your Podfile. - Run
pod install
in the terminal to install the pod. - Ensure you open the project using the newly created
.xcworkspace
file. - Import the module in your code using
import ECSlidingViewController
.
Usage
To use EC Sliding View Controller in your project, follow these steps:
Initialize and Configure
First, create an instance of ECSlidingViewController
in your view controller:
let slidingViewController = ECSlidingViewController()
Then, configure the main view controller and side menu view controller:
let mainViewController = // Your main view controller
let menuViewController = // Your side menu view controller
slidingViewController.mainViewController = mainViewController
slidingViewController.menuViewController = menuViewController
Add Gesture Support
To enable gesture-based sliding, add the following code:
mainViewController.view.addGestureRecognizer(slidingViewController.panGestureRecognizer)
Transition Animation
You can customize the transition animation by implementing the ECSlidingViewControllerDelegate
protocol in your main view controller:
class MainViewController: UIViewController, ECSlidingViewControllerDelegate {
// ...
func slidingViewController(_ slidingViewController: ECSlidingViewController, animateOperation operation: ECOperation, forTransitionTo topViewController: UIViewController, from fromViewController: UIViewController) {
// Customize animation based on the operation
}
// ...
}
Documentation
For detailed information on the API and usage examples, refer to the EC Sliding View Controller documentation.
With EC Sliding View Controller, you can easily create a smooth and interactive sliding navigation experience in your iOS application. Enjoy the flexibility and customization options it offers to enhance your user interface.