Swiftgram/Display/GridItem.swift
2017-09-26 02:59:04 +03:00

28 lines
590 B
Swift

import Foundation
public protocol GridSection {
var height: CGFloat { get }
var hashValue: Int { get }
func isEqual(to: GridSection) -> Bool
func node() -> ASDisplayNode
}
public protocol GridItem {
var section: GridSection? { get }
func node(layout: GridNodeLayout) -> GridItemNode
func update(node: GridItemNode)
var aspectRatio: CGFloat { get }
var fillsRowWithHeight: CGFloat? { get }
}
public extension GridItem {
var aspectRatio: CGFloat {
return 1.0
}
var fillsRowWithHeight: CGFloat? {
return nil
}
}