Timeline
Timeline
is a selectable view intended for timelines that require open, inProgress and complete status that displays timeline details.
It uses a vertical line and timelineNode
as a separator. To the left of the vertical line is the timeline timestamp stack view that contains timestamp
and secondaryTimestamp
. To the right of the vertical line is the main stack view that contains title view and attribute view. Title view contains title
, ‘subtitle’, ‘status’, ‘substatus’, below the title view is an attribute view with ‘ attribute’ and ‘subAttribute’. There is a divider line as separator under main stack.
## Notes
Separator between Timeline Items in the List
All list styles in SwiftUI include separators by default. That is why there is a separator between two timeline items in the list. To get rid of the separator, set ‘listRowSeparator’ modifier to hidden.
Usage
Timeline(timestamp: "06/21/24", secondaryTimestamp: .icon(Image(systemName: "sun.max")), timelineNode: .complete, title: "Complete(Disabled)", subtitle: "abc", attribute: "attr", status: .text("Info"), substatus: .icon(Image(systemName: "exclamationmark.circle")), subAttribute: "subAttr", isPast: true)
Timeline(timestamp: "06/21/24", secondaryTimestamp: .text("Sunny"), timelineNode: .open, title: "Open", subtitle: "abc", attribute: "attr", status: .text("Info"), substatus: .icon(Image(systemName: "exclamationmark.circle")), subAttribute: "subAttr")
-
init(timestamp:
secondaryTimestamp: timelineNode: icon: title: subtitle: attribute: status: substatus: subAttribute: isPast: isPresent: ) Undocumented
Declaration
Swift
public init(@ViewBuilder timestamp: () -> any View = { EmptyView() }, @ViewBuilder secondaryTimestamp: () -> any View = { EmptyView() }, @ViewBuilder timelineNode: () -> any View, @ViewBuilder icon: () -> any View = { EmptyView() }, @ViewBuilder title: () -> any View, @ViewBuilder subtitle: () -> any View = { EmptyView() }, @ViewBuilder attribute: () -> any View = { EmptyView() }, @ViewBuilder status: () -> any View = { EmptyView() }, @ViewBuilder substatus: () -> any View = { EmptyView() }, @ViewBuilder subAttribute: () -> any View = { EmptyView() }, isPast: Bool = false, isPresent: Bool = false)
-
init(timestamp:
secondaryTimestamp: timelineNode: icon: title: subtitle: attribute: status: substatus: subAttribute: isPast: isPresent: ) Undocumented
Declaration
Swift
init(timestamp: AttributedString? = nil, secondaryTimestamp: TextOrIcon? = nil, timelineNode: TimelineNodeType, icon: Image? = nil, title: AttributedString, subtitle: AttributedString? = nil, attribute: AttributedString? = nil, status: TextOrIcon? = nil, substatus: TextOrIcon? = nil, subAttribute: AttributedString? = nil, isPast: Bool = false, isPresent: Bool = false)
-
Undocumented
Declaration
Swift
init(_ configuration: TimelineConfiguration)
-
Declaration
Swift
public var body: some View { get }
-
Undocumented
Declaration
Swift
public var isEmpty: Bool { get }