Latest 0.1.0
Homepage https://github.com/heroddaji/Dkit_Dragdrop
License MIT
Platforms ios 8.0, requires ARC
Authors

CI Status
Version
License
Platform

Overview

a simple subclass of UIImageview, written in Swift to enable drag and drop with animation.

Usage

let’s say you want to drag an apple(DKDraggableView) to cart(UIImageView), and perform some actions when you drop on cart.

you set the drop target with

apple.enableDragging = true
apple.setDropTarget(cart)

And get notified on drop by implement the method onDropedToTarget() of DKDraggableViewDelegate protocol

class DraggableViewController: UIViewController, DKDraggableViewDelegate {

@IBOutlet weak var apple:DKDraggableView!
@IBOutlet weak var cart: UIImageView!

override func viewDidLoad() {
    super.viewDidLoad()

    apple.delegate = self
    apple.enableDragging = true
    apple.setDropTarget(cart)
}

func onDropedToTarget(sender: DKDraggableView, target:UIView) {
        NSLog("Drop to target (target.tag)")
    }
}

Example Project

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 8.0

Installation

Dkit_Dragdrop is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "Dkit_Dragdrop"

Author

daitran, [email protected]

License

Dkit_Dragdrop is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "Dkit_Dragdrop",
    "version": "0.1.0",
    "summary": "A simple drag and drop lib",
    "description": "a simple subclass of UIImageview, written Swift for enabling drag and drop with animation.n",
    "homepage": "https://github.com/heroddaji/Dkit_Dragdrop",
    "license": "MIT",
    "authors": {
        "daitran": "[email protected]"
    },
    "source": {
        "git": "https://github.com/heroddaji/Dkit_Dragdrop.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "Dkit_Dragdrop": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This