ExpansionPanel
public class ExpansionPanel : UIView
Undocumented
-
An enum that represents which actions performed by the component can receive a completion handler
See moreDeclaration
Swift
public enum ExpansionAction
-
Undocumented
Declaration
Swift
public typealias ExpansionHandler = () -> Void
-
Undocumented
Declaration
Swift
public convenience init(theme: AvailableTheme = .none)
-
Defines a text for the subtitle (the main text in the component)
Declaration
Swift
public func setSubtitle(_ subtitle: String, color: UIColor = NatColors.onSurface)
Parameters
subtitle
a string for the subtitle
-
Adds a detail view into the bottom content of the panel This detail view is going to be showed or hidden as the panel expands or collapses, respectively.
Declaration
Swift
public func setDetailView(_ detailView: UIView?)
Parameters
detailView
an UIView with your content
-
Adds a completion handler to be executed when the component expands, collapses, or both
Declaration
Swift
public func setHandlerForTap(withAction action: ExpansionAction, completionHandler: @escaping ExpansionHandler)
Parameters
action
the action that will be the trigger to execute the completion handler.
completionHandler
the block of code to be run
-
Sets custom color for the component active and inactive borders
Declaration
Swift
public func setColorForBorders(active: UIColor, inactive: UIColor)
Parameters
active
an UIColor
inactive
an UIColor
-
Undocumented
Declaration
Swift
public func setCustomAnimationForExpand(animation: @escaping ActionHandler)
-
Undocumented
Declaration
Swift
public func setCustomAnimationForCollapse(animation: @escaping ActionHandler)
-
Margin is an enum that represents margin spacing values for the panel component.
This is the spacing available for a ExpansionPanel margin:
- horizontalMargin
Usage example:
expansionPanel.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: ExpansionPanel.Margin.horizontalMargin)
Requires
It’s necessary to configure the Design System with a theme or fatalError will be raised.
DesignSystem().configure(with: AvailableTheme)
Declaration
Swift
public enum Margin
-
Undocumented
Declaration
Swift
public func expand()
-
Undocumented
Declaration
Swift
public func collapse()