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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:11:17+00:00 2026-05-31T05:11:17+00:00

I need help with CABasicAnimation. I am trying to move a NSView left by

  • 0

I need help with CABasicAnimation. I am trying to move a NSView left by 300 pixels. I found this SO thread: How to animate the frame of an layer with CABasicAnimation?

Turns out animating the frame is not possible and one of the answer points to a link to QA on Apple’s website but it takes me a to a generic page:
http://developer.apple.com/library/mac/#qa/qa1620/_index.html

So, how can I do something as simple as translation of my NSView/CALyer?
Thanks!

  • 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-31T05:11:18+00:00Added an answer on May 31, 2026 at 5:11 am

    NSView has a protocol called NSAnimatablePropertyContainer which allows you to create basic animations for views:

    The NSAnimatablePropertyContainer protocol defines a way to add
    animation to an existing class with a minimum of API impact …
    Sending of key-value-coding compliant “set” messages to the proxy will
    trigger animation for automatically animated properties of its target
    object.

    The NSAnimatablePropertyContainer protocol can be found here

    I recently used this technique to change the origin of a frame:

    -(void)setOrigin:(NSPoint)aPoint {
        [[self animator] setFrameOrigin:aPoint];
    }
    

    Instead of calling the [view setFrameOrigin:], I created another method called setOrigin: which then applies the setFrameOrigin: call to the view’s animator.

    If you need to change the duration of the animation, you can do so like this (similar to CATransactions):

    -(void)setOrigin:(NSPoint)aPoint {
        [NSAnimationContext beginGrouping];
        [[NSAnimationContext currentContext] setCompletionHandler:^{
            ...Completion Callback Code goes here...
        }];
        [[NSAnimationContext currentContext] setDuration:1.0];
        [[self animator] setFrameOrigin:aPoint];
        [NSAnimationContext endGrouping];
    }
    

    The NSAnimationContext is described here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

need help on this, trying to upload images from IE9 I get an C:fakepath/name_of_my_file
Need help writing a script downloads data from google insight using c# this is
I need help on this following aspx code aspx Code: <asp:Label ID =lblName runat
I need help with this route map routes.MapRoute(Blog_Archive, Blog/Archive/{year}/{month}/{day}, new { controller = Blog,
i need help with disk_total_space function.. i have this on my code <?php $sql=select
Need help trying to figure out why the button onCLick event isn't working. I
Need help with this error. Can't see what's wrong. Error: Warning: mysql_query() expects parameter
Need help with below code. I am trying to query from same table and
Need Help in converting this to VB.NET public void GetCustomers(Action<IEnumerable<Customer>> onSuccess, Action<Exception> onFail) {
need help with this please: @follows = Follow.where(admin_user_id = ?, session[:id]) This returns records

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.