Skip to content

Instantly share code, notes, and snippets.

@jfversluis
Created January 16, 2017 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfversluis/d16f4a745a91b60f4726e8b4b328780c to your computer and use it in GitHub Desktop.
Save jfversluis/d16f4a745a91b60f4726e8b4b328780c to your computer and use it in GitHub Desktop.
iOS platform specific SwitchEffect
using EffectsSample.iOS;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ResolutionGroupName ("MyCompany")]
[assembly: ExportEffect (typeof (SwitchEffect), "SwitchEffect")]
namespace EffectsSample.iOS
{
public class SwitchEffect : PlatformEffect
{
protected override void OnAttached ()
{
(Control as UISwitch).OnTintColor = Color.Red.ToUIColor ();
}
protected override void OnDetached ()
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment