Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

goavega-software/mgswipetablecell-xamarin

Repository files navigation

Xamarin.iOS Bindings for MGSwipeTableCell

MGSwipeTableCell is an easy to use UITableViewCell subclass that allows to display swippable buttons with a variety of transitions. This project allows it to be used with Xamarin.iOS. Contains two projects:

  • MGSwipeCell.Xamarin.Binding (the actual binding)
  • MGSwipeCell.Xamarin.Demo (demo project with storyboard)

Sample usage

		public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath)
		{
			string Id = "programmaticCell";
			var cell = tableView.DequeueReusableCell(Id, indexPath) as MGSwipeTableCell;
			if (cell == null)
			{
				cell = new MGSwipeTableCell(UITableViewCellStyle.Default, Id);

			}
			var test = tests[indexPath.Row];
			cell.TextLabel.Text = test.Title;
			cell.RightSwipeSettings.Transition = MGSwipeTransition.Drag;
			cell.RightExpansion.ButtonIndex = 0;
			cell.RightExpansion.FillOnTrigger = true;
			cell.RightButtons = new MGSwipeButton[] {
				MGSwipeButton.ButtonWithTitle("", UIImage.FromBundle("Fav"), UIColor.Green, 15,
											  (tableCell) => {
					Console.WriteLine(tableView.IndexPathForCell(tableCell).Row);
					Console.WriteLine("hello clicked");
					return true;
				}),
				MGSwipeButton.ButtonWithTitle("", UIImage.FromBundle("Menu"), UIColor.Red, 15, (arg0) => {
					return false;
				})
			};
			return cell;
		}

License

Both MGSwipeTableCell and the Bindings are MIT Licensed.

About

Xamarin.iOS Bindings for MGSwipeTableCell

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published