mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-30 17:31:58 +00:00
19 lines
453 B
Swift
19 lines
453 B
Swift
|
|
typealias PeerInfoItemSectionId = UInt32
|
|
|
|
protocol PeerInfoItem {
|
|
var sectionId: PeerInfoItemSectionId { get }
|
|
}
|
|
|
|
func peerInfoItemInsets(item: PeerInfoItem, topItem: PeerInfoItem?, bottomItem: PeerInfoItem?) -> UIEdgeInsets {
|
|
var insets = UIEdgeInsets()
|
|
if let topItem = topItem, topItem.sectionId != item.sectionId {
|
|
insets.top += 22.0
|
|
}
|
|
if bottomItem == nil {
|
|
insets.bottom += 22.0
|
|
}
|
|
|
|
return insets
|
|
}
|