diff --git a/Chatto/Source/ChatController/ChatCollectionViewLayout.swift b/Chatto/Source/ChatController/ChatCollectionViewLayout.swift index d6c2219..3a0a811 100644 --- a/Chatto/Source/ChatController/ChatCollectionViewLayout.swift +++ b/Chatto/Source/ChatController/ChatCollectionViewLayout.swift @@ -84,7 +84,10 @@ public class ChatCollectionViewLayout: UICollectionViewLayout { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { () -> Void in // Dealloc of layout with 5000 items take 25 ms on tests on iPhone 4s // This moves dealloc out of main thread - oldLayoutModel = nil + if oldLayoutModel != nil { + // Use nil check above to remove compiler warning: Variable 'oldLayoutModel' was written to, but never read + oldLayoutModel = nil + } } }