• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CGAffineTransformScale does not send it's scale when using UIDynamicAnimator
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CGAffineTransformScale does not send it's scale when using UIDynamicAnimator


  • Subject: CGAffineTransformScale does not send it's scale when using UIDynamicAnimator
  • From: colo0logo <email@hidden>
  • Date: Fri, 08 Nov 2013 17:46:02 -0500

I am simply trying to understand the way to use updateItemUsingCurrentState
and how to send a scaled UIView or UIImageView to the animator so I can
have a large box and small box for physics tests on viewDidLoad. I want to
learn how to pass it this info so I can dynamically change the size later
in other events.

I saw a post about updateItemUsingCurrentState from a stackoverflow
question and within Apples docs for it, but I can't find a hard example
using scale with it. The docs at Apple say it updates the rotation.

Im sure ill find out that I need to change the bounds or something else
later, but for now I just wanna get past this barrier.

Sample code below:

@property (strong, nonatomic) IBOutlet UIView *CatBox;


@property (strong, nonatomic) IBOutlet UIImageView *catFishBox;

@property (nonatomic) UIDynamicAnimator* animator;


@property (strong, nonatomic) IBOutlet UIView *wrapperWolfBox;


@end


@implementation CatFishViewController


UIDynamicAnimator* _animator;

UIGravityBehavior* _gravity;

UICollisionBehavior* _collision;


- (void)viewDidLoad

{

    [super viewDidLoad];

// Do any additional setup after loading the view, typically from a nib.



    _animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view];

    _gravity = [[UIGravityBehavior alloc] initWithItems:@[_wrapperWolfBox]];

    [_animator addBehavior:_gravity];



    _collision = [[UICollisionBehavior alloc]

                  initWithItems:@[_wrapperWolfBox]];

    _collision.translatesReferenceBoundsIntoBoundary = YES;

    [_animator addBehavior:_collision];

//

//



    CGAffineTransform maybeGetTransform = CGAffineTransformScale(
_wrapperWolfBox.transform, 2.2, 2.2);

    _wrapperWolfBox.transform = maybeGetTransform;



    [_animator updateItemUsingCurrentState:self.wrapperWolfBox];









//    _animator.updateItemUsingCurrentState:self.catFishBox;




}
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Prev by Date: Re: Resolving a file reference from the iTunes plist
  • Next by Date: NSStackView basics
  • Previous by thread: Re: Apple Sample Code WWDC 2010 session 114 (2551)
  • Next by thread: NSStackView basics
  • Index(es):
    • Date
    • Thread