https://github.com/iosdevgarg/resizable-views
https://github.com/iosdevgarg/resizable-views
containerview gesture-recognizer pan-gesture swift swift-3 swift-4 table-view tableview
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/iosdevgarg/resizable-views
- Owner: iOSDevGarg
- Created: 2018-02-05T07:28:26.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-05T07:41:47.000Z (almost 8 years ago)
- Last Synced: 2025-01-20T08:23:10.694Z (about 1 year ago)
- Topics: containerview, gesture-recognizer, pan-gesture, swift, swift-3, swift-4, table-view, tableview
- Language: Swift
- Size: 28.3 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Resizable-Views
This sample Project make A View Being Dragged in View and Change its And other used views Height According to the Requirement and changes made
Project Hierarchy
--> Main View
--> 2 ContainerViews
--> Subviews in ContainerView
--> Container View At Bottom Draggable (Pan Gesture)
# Pan Gesture
func addPanGesture()
{
let gesture : UIPanGestureRecognizer = UIPanGestureRecognizer(target: self, action:#selector(ViewController.handlePanGesture(panGesture:)))
self.bottomContainerView.addGestureRecognizer(gesture)
}
# View Translation
///Move view to required Position
panGesture.view?.frame = CGRect(x: 0, y: currentPoint.y, width: self.view.frame.size.width, height: self.view.frame.size.height-currentPoint.y)
self.upContainerView.frame = CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: self.view.frame.size.height-(panGesture.view?.frame.height)!)
panGesture.setTranslation(CGPoint.zero, in: self.view)
# Output
