diff --git a/Yep/ViewControllers/Conversation/ConversationLayout.swift b/Yep/ViewControllers/Conversation/ConversationLayout.swift index fb96a6b2..53e93e23 100644 --- a/Yep/ViewControllers/Conversation/ConversationLayout.swift +++ b/Yep/ViewControllers/Conversation/ConversationLayout.swift @@ -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 - } - }