1 year ago

#119822

test-img

Faheem

Swipe up and swipe down the viewController when user tap on ViewController swift

Two viewControllers one is aboutViewController and second one is customViewController.Added customViewController in aboutViewController as an subView on bottom position now I want when user swipe up the whole controller swipe up and show all the content of viewController and swipe down to get the same position through animation.

AboutViewController:

class AboutViewController: UIViewController {
    @IBOutlet weak var customsController:CustomViewController!
    override func viewDidLoad() {
        super.viewDidLoad()
        
    }
    
    override func viewDidAppear(_ animated: Bool) {
        customController()
    }
    
    func customController(){
        guard let vc = self.storyboard?.instantiateViewController(withIdentifier: String(describing: CustomViewController.self)) as? CustomViewController else {return}
        let screnSize = UIScreen.main.bounds
        let frame:CGRect = .init(x: 0, y: screnSize.height - 300, width: screnSize.width, height: 300)
        vc.view.frame = frame
        self.view.addSubview(vc.view)
    }

}

enter image description here enter image description here enter image description here

Here is the example I want to achieve like this one see the pics below see second controller on bottom position when user swipe up the whole controlller swipe up I want this functionality

ios

swift

subview

uiswipegesturerecognizer

0 Answers

Your Answer

Accepted video resources