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 8492425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:42:56+00:00 2026-06-10T22:42:56+00:00

I need to call the function animate dealing to player each time the for

  • 0

I need to call the function animate dealing to player each time the for loop runs.

  -(void)animateDealingToPlayer:(Player *)player withDelay:(NSTimeInterval)delay
{
self.frame = CGRectMake(-100.0f, -100.0f, CardWidth, CardHeight);
self.transform = CGAffineTransformMakeRotation(M_PI);


NSArray *position = [NSArray arrayWithObjects:

                     [NSValue valueWithCGPoint:CGPointMake(100, 100)],                               
                     [NSValue valueWithCGPoint:CGPointMake(0, 0)],                                             
                     [NSValue valueWithCGPoint:CGPointMake(0, 0)],                         
                     [NSValue valueWithCGPoint:CGPointMake(200, 100)],                          
                     [NSValue valueWithCGPoint:CGPointMake(200, 100)],                                                   


                     nil];              


for(int i=0; i<6; i++) {
    NSValue *value = [position objectAtIndex:i];
    CGPoint point = [value CGPointValue];
    NSLog(@"%@",NSStringFromCGPoint(point));

    _angle = [self angleForPlayer:player];

    [UIView animateWithDuration:0.2f
                          delay:delay
                        options:UIViewAnimationOptionCurveEaseOut
                     animations:^
     {





         self.center = point;              



         self.transform = CGAffineTransformMakeRotation(_angle);
     }
                     completion:nil];

Right now it is rewriting self.center over and over until it gives out the 5th object index instead of calling all of the index numbers individually.For example instead of dealing cards at all of the points it is dealing only at (200,100). I need some way to call animaitedealingwithplayer each time so it will deal at all the points,but how do I do that? Will appreciate any help I can get.

  • 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-06-10T22:42:58+00:00Added an answer on June 10, 2026 at 10:42 pm

    The problem is that you are creating multiple animation blocks that apply to a single view element, and you are applying these all at once.

    Instead, you can cause the animation block to trigger another animation on completion.

    There is an example in the Apple View Programming Documentation: “Listing 4-2 shows an example of an animation block that uses a completion handler to initiate a new animation after the first one finishes“

    I’m posting the example here so you can get a feel for it, but go read the documentation!:

    - (IBAction)showHideView:(id)sender
    {
        // Fade out the view right away
        [UIView animateWithDuration:1.0
            delay: 0.0
            options: UIViewAnimationOptionCurveEaseIn
            animations:^{
                 thirdView.alpha = 0.0;
            }
            completion:^(BOOL finished){
                // Wait one second and then fade in the view
                [UIView animateWithDuration:1.0
                     delay: 1.0
                     options:UIViewAnimationOptionCurveEaseOut
                     animations:^{
                        thirdView.alpha = 1.0;
                     }
                     completion:nil];
            }];
    }
    

    In your example, you should probably (in pseudocode):

    // center card on dealer
    Animate: ^{
       // move card to player1
    }, completion: ^{
       // center card on dealer
       Animate: ^{
         // move card to player2
       }, completion: ^{
         //center 
         // animate again, and again etc.
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following need: I want to call a js each time an
In PrimeFace's inputText , I need to call function ‍‍‍ f1() when any key
I need to call a function in an unmanaged .dll written in C lang
I need to call a function by clicking a button. The button is on
I need to call a function every 5 minutes for an 8 hour period.
I need to call a function whose name is available in a string in
I need to call a function in the following fashion: var f = 'fadeOut';
In my Application I need to call a function(Which update the valuesof textviews),I need
I have js file where i need to call the function defined in the
In my C# code, I need to call a function from a C++ Dll

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.