Skip to content

joekndy/RubberDrag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RubberDrag

A gesture that enables dragging on a view with a "rubberband" effect. Similar to Apple's native scrollview or half sheet interaction.

RubberDrag Demo

Usage

Download RubberDrag.swift and drop it into your project.

import SwiftUI

struct ContentView: View {    
    var body: some View {
   	Circle()
	.rubberDrag(dragLimit: 100)
   }
}

You can optionally disable horizontal or vertical dragging

import SwiftUI

struct ContentView: View {    
    var body: some View {
   	Circle()
	.rubberDrag(dragLimit: 100, horizontalEnabled: false, verticalEnabled: true)
   }
}

License

You can use this software under the terms and conditions of the MIT License.

Joe Kennedy © 2021

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages