Example #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ImageView.Layer.BorderColor = UIColor.Green.CGColor;
            ImageView.Layer.BorderWidth = 0.0f;
            View.Layer.BorderColor      = UIColor.Red.CGColor;

            // 'UserInteractionEnabled' is needed for drag and drop.
            ImageView.UserInteractionEnabled = true;

            // Allow dragging.
            var dragInteraction = new UIDragInteraction(this);

            ImageView.AddInteraction(dragInteraction);

            // Allow dropping.
            var dropInteraction = new UIDropInteraction(this);

            View.AddInteraction(dropInteraction);
        }