Let ‘s see here the following steps for making a drag-able floating view
Add a UIView to the view controller in storyboard.
Put on pan gesture to the UIView which is just added to the view controller therefore the view become draggable.
Create an IBAction for the pan gesture by making a connection to the storyboard to the view controller’s source code file.
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)