-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppDelegate.cs
37 lines (30 loc) · 937 Bytes
/
AppDelegate.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System.Net;
using NetCoreServer;
namespace test_ios;
[Register ("AppDelegate")]
public class AppDelegate : UIApplicationDelegate {
public override UIWindow? Window {
get;
set;
}
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
// create a new window instance based on the screen size
Window = new UIWindow (UIScreen.MainScreen.Bounds);
// create a UIViewController with a single UILabel
var vc = new UIViewController ();
vc.View!.AddSubview (new UILabel (Window!.Frame) {
BackgroundColor = UIColor.SystemBackground,
TextAlignment = UITextAlignment.Center,
Text = "Hello, iOS!",
AutoresizingMask = UIViewAutoresizing.All,
});
Window.RootViewController = vc;
// make the window visible
Window.MakeKeyAndVisible ();
// start the TCP server
var chatServer = new TcpServer(IPAddress.Any, 8989);
chatServer.Start();
return true;
}
}