Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Problem to create a touch plugin

$
0
0

I'm trying to create a plugin to use touch events in forms.

I'll use iOS as exemple, so i've created the classes, ViewTouch and CrossTouch extended to UIView and Interface respectively

public class ViewTouch : UIView { //The overridden methods here! }

public class CrossTouch : ITouch { //The implementation and others here. }

On the interface I created a single event which is called everytime the overridden touch methods on ViewTouch is executed.

public interface ITouch
{
      event EventHandler<EventArgs> TouchChanged;
}

On iOS library I use the Init() method to get the UIView from AppDelegate;
CrossTouch.Init (UIApplication.SharedApplication.KeyWindow.RootViewController.View);

The problem is "How I get the UIView from iOS?" (or maybe the UIViewController), cause the View on init is null.


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>