mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-10 21:36:49 +10:00
no ConversationLayout
This commit is contained in:
@@ -11,48 +11,48 @@ import QuartzCore
|
||||
|
||||
class ConversationLayout: UICollectionViewFlowLayout {
|
||||
|
||||
var lastTimeContentSize: CGSize?
|
||||
|
||||
var itemsDeleteIndexPaths = [NSIndexPath]()
|
||||
|
||||
override func collectionViewContentSize() -> CGSize {
|
||||
var contentSize = super.collectionViewContentSize()
|
||||
|
||||
if let lastTimeContentSize = lastTimeContentSize {
|
||||
if lastTimeContentSize.height > contentSize.height {
|
||||
contentSize.height = lastTimeContentSize.height
|
||||
}
|
||||
} else {
|
||||
lastTimeContentSize = contentSize
|
||||
}
|
||||
|
||||
return contentSize
|
||||
}
|
||||
|
||||
override func finalLayoutAttributesForDisappearingItemAtIndexPath(itemIndexPath: NSIndexPath) -> UICollectionViewLayoutAttributes? {
|
||||
var attr = super.finalLayoutAttributesForDisappearingItemAtIndexPath(itemIndexPath)
|
||||
|
||||
for (index, indexPath) in enumerate(itemsDeleteIndexPaths) {
|
||||
if indexPath == itemIndexPath {
|
||||
|
||||
if let cell = collectionView?.cellForItemAtIndexPath(indexPath) as? ChatStateCell {
|
||||
var scale: CGFloat = 0.8
|
||||
var offsetScale: CGFloat = (1-scale)*0.5
|
||||
|
||||
attr?.transform = CGAffineTransformMakeScale(scale, scale)
|
||||
attr?.alpha = 0
|
||||
|
||||
println("Frame width \(cell.stateLabel.frame.width)")
|
||||
|
||||
attr?.center = CGPointMake(attr!.center.x + attr!.size.width*offsetScale - cell.stateLabel.frame.width*offsetScale, attr!.center.y - cell.stateLabel.frame.height*scale*0.5)
|
||||
}
|
||||
// var lastTimeContentSize: CGSize?
|
||||
//
|
||||
// var itemsDeleteIndexPaths = [NSIndexPath]()
|
||||
//
|
||||
// override func collectionViewContentSize() -> CGSize {
|
||||
// var contentSize = super.collectionViewContentSize()
|
||||
//
|
||||
// if let lastTimeContentSize = lastTimeContentSize {
|
||||
// if lastTimeContentSize.height > contentSize.height {
|
||||
// contentSize.height = lastTimeContentSize.height
|
||||
// }
|
||||
// } else {
|
||||
// lastTimeContentSize = contentSize
|
||||
// }
|
||||
//
|
||||
// return contentSize
|
||||
// }
|
||||
//
|
||||
// override func finalLayoutAttributesForDisappearingItemAtIndexPath(itemIndexPath: NSIndexPath) -> UICollectionViewLayoutAttributes? {
|
||||
// var attr = super.finalLayoutAttributesForDisappearingItemAtIndexPath(itemIndexPath)
|
||||
//
|
||||
// for (index, indexPath) in enumerate(itemsDeleteIndexPaths) {
|
||||
// if indexPath == itemIndexPath {
|
||||
//
|
||||
// if let cell = collectionView?.cellForItemAtIndexPath(indexPath) as? ChatStateCell {
|
||||
// var scale: CGFloat = 0.8
|
||||
// var offsetScale: CGFloat = (1-scale)*0.5
|
||||
//
|
||||
// attr?.transform = CGAffineTransformMakeScale(scale, scale)
|
||||
// attr?.alpha = 0
|
||||
//
|
||||
// println("Frame width \(cell.stateLabel.frame.width)")
|
||||
//
|
||||
// attr?.center = CGPointMake(attr!.center.x + attr!.size.width*offsetScale - cell.stateLabel.frame.width*offsetScale, attr!.center.y - cell.stateLabel.frame.height*scale*0.5)
|
||||
// }
|
||||
//
|
||||
// itemsDeleteIndexPaths.removeAtIndex(index)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// return attr
|
||||
// }
|
||||
|
||||
itemsDeleteIndexPaths.removeAtIndex(index)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return attr
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user