public void DidReceiveNotificationResponse(UNNotificationResponse response, Action <UNNotificationContentExtensionResponseOption> completionHandler)
        {
            var rotationAction = ExtensionContext.GetNotificationActions()[0];

            if (response.ActionIdentifier == "rotate-twenty-degrees-action")
            {
                rotationButtonTaps += 1;

                double radians = (20 * rotationButtonTaps) * (2 * Math.PI / 360.0);
                Xamagon.Transform = CGAffineTransform.MakeRotation((float)radians);

                // 9 rotations * 20 degrees = 180 degrees. No reason to
                // show the reset rotation button when the image is half
                // or fully rotated.
                if (rotationButtonTaps % 9 == 0)
                {
                    ExtensionContext.SetNotificationActions(new UNNotificationAction[] { rotationAction });
                }
                else if (rotationButtonTaps % 9 == 1)
                {
                    var resetRotationAction = UNNotificationAction.FromIdentifier("reset-rotation-action", "Reset rotation", UNNotificationActionOptions.None);
                    ExtensionContext.SetNotificationActions(new UNNotificationAction[] { rotationAction, resetRotationAction });
                }
            }

            if (response.ActionIdentifier == "reset-rotation-action")
            {
                rotationButtonTaps = 0;

                double radians = (20 * rotationButtonTaps) * (2 * Math.PI / 360.0);
                Xamagon.Transform = CGAffineTransform.MakeRotation((float)radians);

                ExtensionContext.SetNotificationActions(new UNNotificationAction[] { rotationAction });
            }

            completionHandler(UNNotificationContentExtensionResponseOption.DoNotDismiss);
        }