たぶん一番書くやつを

  • Android-Java
  • Android-Xamarin
  • iOS-Swift
  • iOS-Xamarin

で比較。


Android-Java

//MainActivity.java
button1.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        label1.setText("pushed!!");        
    }
});

Xamarin.Android(C#)

//MainActivity.cs
buttonOk.Click += (_, e)
    => label1.Text = "pushed!!";

iOS-Swift

//ViewController.swift
buttonOK.addTarget(self, action: 
    #selector(ViewController.onTouch(_:)), 
    forControlEvents: .TouchUpInside)
・・・
func onTouch(sender: AnyObject) {
    label1.text = "pushed!!"
}

Xamarin.iOS(C#)

//ViewColtroller.cs
buttonOk.TouchUpInside += (_, e) 
    => label1.Text = "pushed!!";

まとめ

Xamarin はいいぞ!

Android
Xamarin
Swift
C#
iOS

published

Ads

Read more!

amay077

Microsoft MVP(Xamarin). フルリモートワーカー. Geospatial Mobile app developer. Love C#.

amay077 amay077