DEV Community

Rlogical Techsoft Pvt Ltd
Rlogical Techsoft Pvt Ltd

Posted on

How do I create a drag-able floating view on iOS?

Let ‘s see here the following steps for making a drag-able floating view

  1. Add a UIView to the view controller in storyboard.

  2. Put on pan gesture to the UIView which is just added to the view controller therefore the view become draggable.

  3. Create an IBAction for the pan gesture by making a connection to the storyboard to the view controller’s source code file.

  4. Set the type for the sender to UIPanGestureRecognizer.

Learn more with example here: https://rlogicaltech.medium.com/how-do-i-create-a-drag-able-floating-view-on-ios-e0e6733c2617

Top comments (0)