Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mihaelisaev/ecswiftslidingviewcontroller
Translated to Swift ECSlidingViewController
https://github.com/mihaelisaev/ecswiftslidingviewcontroller
Last synced: 4 months ago
JSON representation
Translated to Swift ECSlidingViewController
- Host: GitHub
- URL: https://github.com/mihaelisaev/ecswiftslidingviewcontroller
- Owner: MihaelIsaev
- Created: 2014-12-16T11:00:06.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-17T16:14:42.000Z (about 2 years ago)
- Last Synced: 2024-04-14T07:11:37.660Z (10 months ago)
- Language: Swift
- Homepage:
- Size: 29.3 KB
- Stars: 10
- Watchers: 6
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ECSlidingViewController in Swift!
============================Translated into Swift ECSlidingViewController
Hello everyone!
I rewrote [the whole library](https://github.com/ECSlidingViewController/ECSlidingViewController) into Swift.
I've fixed critical bugs, but I still need help. Now the most nasty problem is not smoothly opening menu with slide gesture..Any help is welcome!
How it works:
```swift
let topViewController = self.storyboard?.instantiateViewControllerWithIdentifier("topView") as UIViewControllerlet underViewController = self.storyboard?.instantiateViewControllerWithIdentifier("leftView") as UITableViewController
slidingController = ECSlidingViewController(topViewController: topViewController)
slidingController.setUnderLeftViewController(underViewController)self.view.addSubview(slidingController.view)
```Now this can work with `UITabBar`, with `delegate2`
Delegate of the class
```swift
ECSlidingViewControllerDelegate2
```add the `delegate2`
```swift
slidingController.delegate2 = self
```Add this methods to properly work with UITabBar
```swift
// Tap gesture, to add it to the view and remove you dont need it
var resetTapGesture: UIGestureRecognizer!var gesturesView: UIView! // Overlay view to TopViewController to prevent other taps, scrolls in other screens
override func viewDidLoad() {
// Initalize gesturesView
gesturesView = UIView(frame: CGRectMake(0, 0, self.view.frame.width, self.view.frame.height))
}func slidingViewControllerDidAppear(slidingViewController: ECSlidingViewController) {
// Add gestures view to TopView
topViewController.view.addSubview(gesturesView)// Add Tap Gesture, for reset
gesturesView.addGestureRecognizer(resetTapGesture)
}
func slidingViewControllerDidDisappear(slidingViewController: ECSlidingViewController) {
// Remove gestures view to TopView
gesturesView.removeFromSuperview()// Remove Tap Gesture
gesturesView.removeGestureRecognizer(resetTapGesture)
}
```