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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:33:35+00:00 2026-05-23T10:33:35+00:00

Now before you get all antsy, this is Cocoa I’m talking about, not Cocoa-Touch

  • 0

Now before you get all antsy, this is Cocoa I’m talking about, not Cocoa-Touch. With that out of the way, lets begin. I have recently started programming for the Mac. Why? Because it’s cool. You know what’s not cool? Not being able to have nice fancy animations like the other cool kids. I can’t figure this out and if you can help me you will save the few hairs I have left on my head.

Alright, I have a NSCollectionView. Took me ages to figure that out, but whatever. I’ve made that NSCollectionView layer-backed in Interface Builder. I heard that’s supposed to make this magic work. I tried this to animate my collection view:

//usersView is my NSCollectionView
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"transform"];    
CATransform3D scale = CATransform3DMakeScale(2.0, 2.0, 0.0);
[anim setFromValue:[NSValue valueWithCATransform3D:CATransform3DIdentity]];
[anim setToValue:[NSValue valueWithCATransform3D:scale]];
[anim setDuration:1.0f];
[[usersView layer] addAnimation:anim forKey:nil];
[[usersView layer] setTransform:scale];

Now here’s the deal: it does transform the view, but not with a cool animation. I also tried this:

[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions];
[CATransaction setValue:[NSNumber numberWithFloat:3.0f] forKey:kCATransactionAnimationDuration];
[usersView layer].transform = CATransform3DMakeScale(2.0, 2.0, 0.0);
[CATransaction commit];

No dice. I do believe I need help. 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-23T10:33:35+00:00Added an answer on May 23, 2026 at 10:33 am

    I believe that for your second piece of code that attempts an implied animation (by assigning a new value for the transform property) you need to skip setting the kCATransactionDisableActions property to true since in effect that says not to animate the transition (which is exactly the opposite of your intention). To be explicit you could set that property to false. There could easily be some other issue at play too; I never seem to know exactly what’s needed until it’s coded and running. (With core animation I always find myself inching towards the result I want bit by bit. But after finally getting at least something to animate it really inspires me to continue tweaking the code till it works the way I want it!, i.e., core animation isn’t an easy one to pick up.)

    As for the first problem, the explicit animation, I believe one problem has to do with the last line where you set the layer’s transform property; I’d start by leaving that out (though it may have to be worked back in someplace else in the long run). Setting that transform immediately changes the layer to how it should look when the animation is complete (which is why you see the transformation occur immediately) but that doesn’t completely explain not seeing any animation since the transaction (which begins once your code is complete, i.e., after the immediate transition has occurred) does have both a ‘start’ and an ‘end’ value. To start, I’d begin by finding some example code that does a similar animation and changing it piece by piece to get what you want. (That’s how I learned to use core animation after trying to completely code an animation by myself and having it fail; it did take a long time to get it right but I really got a better feeling for it in doing so.) You might also want to go back to the documentation and really try to get the concept of the core animation rendering architecture, i.e., the layer-tree, the presentation-tree and the render-tree and what is displayed at different stages of the animation as well as how to affect it (which again will really only sink in after a bunch of trial and error). Just stick with it till it makes sense!

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

Sidebar

Related Questions

i use this method before 1 time. but Now i can not get video
Now I have something that I have not seen it before: the database is
I was clicking elements just fine before, and this all worked, however now when
Third try at fixing this tonight - trying a different approach than before now.
This is my current function to get all users: function get_all() { return $this->db->get($this->tableName)->result();
Before starting let me say: It's not homework, just plain, old, fun. Now, I'm
I have a SQL database that contains a field. I can get all of
My app is using htmlagility pack. As of right now I can get all
In my query I want to get all users of the same city. This
right_now = datetime.datetime.now() one_hour_before = ????? How can I use right_now to get one_hour_before?

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.