This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ChatCollectionViewFlowLayout: UICollectionViewFlowLayout { | |
| private var topMostVisibleItem = Int.max | |
| private var bottomMostVisibleItem = -Int.max | |
| private var offset: CGFloat = 0.0 | |
| private var visibleAttributes: [UICollectionViewLayoutAttributes]? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Function to pretty-print Json Object in Swift 3 | |
| func prettyPrint(with json: [String:Any]) -> String{ | |
| let data = try! JSONSerialization.data(withJSONObject: json, options: .prettyPrinted) | |
| let string = NSString(data: data, encoding: String.Encoding.utf8.rawValue) | |
| return string as! String | |
| } |