Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 593021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:48:04+00:00 2026-05-13T15:48:04+00:00

My code works and I animate, but I’m not sure how to do this:

  • 0

My code works and I animate, but I’m not sure how to do this:

Animation End Callback for CALayer?

…in MonoTouch.

Here’s what i’ve got:

public partial class MyCustomView: UIView
{
    // Code Code Code

    private void RunAnimation()
    {        
         CAKeyFrameAnimation pathAnimation = new CAKeyFrameAnimation();
         pathAnimation.KeyPath = "position";
         pathAnimation.Path = trail; //A collection of PointFs
         pathAnimation.Duration = playbackSpeed;
         Character.Layer.AddAnimation(pathAnimation,"MoveCharacter");
    }

    //Code Code Code
}

MyCustomView is already inheriting from UIView and I can’t inherit from two classes. How would I call a function called “AnimationsComplete()” when this is done animating?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:48:04+00:00Added an answer on May 13, 2026 at 3:48 pm

    I’m not in front of my dev machine, but I think you create a class descending from CAAnimationDelegate, implement the “void AnimationStopped(CAAnimation anim, bool finished) method” and then assign an instance of this class to pathAnimation.Delegate (in your sample).

    So, something like this (warning – untested code):

    public partial class MyCustomView: UIView
    {
        private void RunAnimation()
        {        
            CAKeyFrameAnimation pathAnimation = new CAKeyFrameAnimation();
    
            // More code.
    
            pathAnimation.Delegate = new MyCustomViewDelegate();
    
       }
    }
    
    public class MyCustomViewDelegate : CAAnimationDelegate
    {
        public void AnimationStopped(CAAnimation anim, bool finished)
        {
            // More code.
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code works is FF and IE but not in Chrome. Any help would
This code works in IE8, Crome and Safari, but not in firefox: <script src=@Url.Content(~/Scripts/jquery-1.5.1.min.js)
here is my old code which works: $('.logo').hover(function(){ $(this).addClass('animated swing')}, function(){$(this).removeClass('animated swing') }); here
This code works well for displaying separate xml items in my main.xml. But is
This code works fine, but I'll want to handle exception if any thing goes
This slider code works fine with older version of jquery, such as jquery-1.5. But
This piece of code works in Firefox and IE: $('input').click(function() { $(group).animate({ 'width' :
I have some JavaScript code that works in FireFox but not in Chrome or
I have this code jQuery('.button').click(function() { jQuery('.div1').animate({width: 'toggle'}); jQuery('.div2').animate({width: '100%'}); }); Works fine for
Silverlight 4, but I'm not sure if this applys to WPF also. This is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.