BouncyLayout icon indicating copy to clipboard operation
BouncyLayout copied to clipboard

Flipped CollectionView (Chat)

Open beamercola opened this issue 7 years ago • 4 comments

This pod looks great, super clean. I'm having an issue with a flipped collectionview and cell (chat app) though and not sure why.

I've tried both:

let layout = BouncyLayout()
collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
collectionView!.transform = CGAffineTransform.init(rotationAngle: (-(CGFloat)(Double.pi)))
// ...

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
  // ...
  cell.transform = CGAffineTransform(rotationAngle: CGFloat.pi)
  return cell
}

and

let layout = BouncyLayout()
collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
collectionView!.transform = CGAffineTransform(a: 1, b: 0, c: 0, d: -1, tx: 0, ty: 0)
// ...

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
  // ...
  cell.transform = collectionView.transform
  return cell
}

Both create different results. Any ideas? Thanks!

beamercola avatar Apr 27 '18 04:04 beamercola

Any ideas for how to achieve this?

Given that messaging is one of the core use cases for this having the reverse items show up properly is key – and hopefully supported by the lib.

Kind thanks.

marchy avatar Aug 16 '18 19:08 marchy

I'm trying to do the same effect, does aynone has achieved this successfully ?

fmirault avatar May 16 '19 09:05 fmirault

Same issue here any update?

aminosman avatar Jul 10 '19 17:07 aminosman

I think flipping around the views is hacky...there are other options available such as updating the content offset

timothyerwin avatar Mar 04 '21 17:03 timothyerwin