-
-
Save rolfbjarne/c74db61dd4601c873ab787e0acf10702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Foundation; | |
using ObjCRuntime; | |
using UIKit; | |
class TID : NSObject, IUITextInputDelegate | |
{ | |
public void SelectionDidChange (IUITextInput uiTextInput) | |
{ | |
throw new NotImplementedException (); | |
} | |
public void SelectionWillChange (IUITextInput uiTextInput) | |
{ | |
throw new NotImplementedException (); | |
} | |
public void TextDidChange (IUITextInput textInput) | |
{ | |
throw new NotImplementedException (); | |
} | |
public void TextWillChange (IUITextInput textInput) | |
{ | |
throw new NotImplementedException (); | |
} | |
} | |
[Register ("AppDelegate")] | |
public partial class AppDelegate : UIApplicationDelegate | |
{ | |
UIWindow window; | |
UIViewController dvc; | |
UIButton button; | |
public void TickOnce () | |
{ | |
var field = new UITextField (); | |
var obj = new TID (); | |
field.InputDelegate = obj; | |
Console.WriteLine (field.InputDelegate); | |
} | |
void Tapped () | |
{ | |
TickOnce (); | |
} | |
public override bool FinishedLaunching (UIApplication app, NSDictionary options) | |
{ | |
window = new UIWindow (UIScreen.MainScreen.Bounds); | |
NSTimer.CreateScheduledTimer (0.1, (v) => Tapped ()); | |
dvc = new UIViewController (); | |
dvc.View.BackgroundColor = UIColor.White; | |
button = new UIButton (window.Bounds); | |
button.TouchDown += (object sender, EventArgs e) => { | |
Tapped (); | |
}; | |
button.SetTitleColor (UIColor.Blue, UIControlState.Normal); | |
button.SetTitleColor (UIColor.Gray, UIControlState.Highlighted); | |
button.SetTitle ("Click here", UIControlState.Normal); | |
dvc.Add (button); | |
window.RootViewController = dvc; | |
window.MakeKeyAndVisible (); | |
return true; | |
} | |
static void Main (string [] args) | |
{ | |
UIApplication.Main (args, null, "AppDelegate"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment