 <p>To fix the first block issue:</p> <blockquote> <p>Value of type '<code>UIDynamicBehavior</code>' has no member 'items'</p> </blockquote> <pre><code>let attachmentBehavior:UIAttachmentBehavior = behavior as! UIAttachmentBehavior </code></pre> <p>To fix the second issue:</p> <blockquote> <p>Cannot convert return expression of type '<code>[UIDynamicItem]</code>' to return type '<code>[UICollectionViewLayoutAttributes]?</code>'</p> </blockquote> <pre><code>return self.dynamicAnimator.itemsInRect(rect) as? [UICollectionViewLayoutAttributes] </code></pre>