I'm trying to replicate this at the moment:
If you're familiar with Google's app, it looks like a UICollectionView with a custom flow layout.
I'm expanding on a question that has been closed with some additional code.
Here's the link to the other question.
In the custom flow layout class, I can create a "stacked" effect by setting a negative minimum line spacing value, and using the following:
- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect
{
NSArray *allAttributesInRect = [super layoutAttributesForElementsInRect:rect];
CGPoint centerPoint = CGPointMake(CGRectGetMidX(self.collectionView.bounds), CGRectGetMidY(self.collectionView.bounds));
for (UICollectionViewLayoutAttributes *cellAttributes in allAttributesInRect)
{
if (CGRectContainsPoint(cellAttributes.frame, centerPoint))
{
cellAttributes.transform = CGAffineTransformIdentity;
cellAttributes.zIndex = 1.0;
}
else
{
cellAttributes.transform = CGAffineTransformMakeScale(0.75, 0.75);
}
}
return allAttributesInRect;
}
The swiping to delete animations are working alright, but I'm having trouble creating the "stacked" look, and then dragging just 1 cell up into the view, while keeping the remaining cards stacked, like what you see above.