Note that there are some explanatory texts on larger screens.

plurals
  1. PONo visible @interface for 'UIAttachmentBehavior' declares the selector initWithItem in DynamicsCatalog.xcodeproj
    primarykey
    data
    text
    <p>I just download DynamicsCatalog.xcodeproj from the apple developer portal but I'm getting this error:</p> <p>No visible @interface for 'UIAttachmentBejavior' decleares the selector initwititem</p> <p>on this line:</p> <pre><code>UIAttachmentBehavior *attachmentBehavior = [[UIAttachmentBehavior alloc] initWithItem:self.square1 point:attachmentPoint attachedToAnchor:squareCenterPoint]; </code></pre> <p>in APLAttachmentsViewController.m</p> <p>This the context of that line:</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; UIDynamicAnimator* animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view]; UICollisionBehavior* collisionBehavior = [[UICollisionBehavior alloc] initWithItems:@[self.square1]]; CGPoint squareCenterPoint = CGPointMake(self.square1.center.x, self.square1.center.y - 100.0); CGPoint attachmentPoint = CGPointMake(-25.0, -25.0); /* By default, an attachment behavior uses the center of a view. By using a small offset, we get a more interesting effect which will cause the view to have rotation movement when dragging the attachment. */ UIAttachmentBehavior *attachmentBehavior = [[UIAttachmentBehavior alloc] initWithItem:self.square1 point:attachmentPoint attachedToAnchor:squareCenterPoint]; collisionBehavior.translatesReferenceBoundsIntoBoundary = YES; // Show visually the attachment points self.redSquare.center = attachmentBehavior.anchorPoint; self.blueSquare.center = CGPointMake(25.0, 25.0); [animator addBehavior:attachmentBehavior]; self.animator = animator; self.attachmentBehavior = attachmentBehavior; } </code></pre> <p>Any of you knows why or how can I fix this demo code?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload