Class
Card
public final class Card: UIView
Cards contain content and tasks about a single subject to make it easier to scan, read, and take action.
Prefer to use make(header:content:footer:)
rather than the default constructor.
Cards are essentially structured containers that layout a header, content, and footer. Cards also allow you to only provide specific sections, such as the header and content, without a footer for example.
Some interesting layouts include CardHeader for the header, VerticalCenteredImageTextContent for the content, and an ActionsLayout for the footer. These views will give you what CreationUI calls an Awareness Card.
Relationships
Nested Types
Card.State
The state of the card.
Conforms To
UIView
Initializers
Properties
header
public private(set) var header: UIView?
content
public private(set) var content: UIView?
state
public var state: State = .normal
The state of the card. You can use this to set as a loading state to show that you are loading the content, or an error state if the card content fails to load. Set to normal when you want to cards content to display.
Methods
make(with:state:)
public static func make(with size: CGSize, state: State) -> Card
Creates a new Card with a preferred size and state.
Note that Cards have a max width and will be clamped to
that value. You should use this factory method when you don't have the content for the card yet, such as when
you are loading the content, and you want to display a loading card in it's place. Then update the card when the
content has been loaded. If you already have the content, then you should use
init(header:,content:,footer:)
instead.