Logo
In ChartScreen
, you can add a custom logo to the chart.
You can add a logo in two ways:
- Pass
Logo
when initializing viamakeScreen
. - Set the
logo
property on theChartScreen.ViewController
returned bymakeScreen
.
Logo as data model
Logo
is a data model that describes the image to display, its position, insets, and visibility. You can construct it with just an image or specify all properties.
Logo fields and defaults
image
—UIImage
to displayposition
— anchor inside the view (default:.bottomLeading
)insets
— offsets from the anchored edges (default:.zero
)isHidden
— controls visibility (default:false
)
Examples
Below are the examples of initializing Logo
:
// Image onlylet logo = Logo(image: UIImage(named: "companyLogo")!)// All propertieslet logo = Logo(image: UIImage(named: "companyLogo")!,position: .bottomLeading,insets: UIEdgeInsets(top: 10, left: 5, bottom: 50, right: 55),isHidden: false)
Configuring ChartScreen
with Logo
:
let chartScreenViewController = ChartScreen.makeScreen(dataProvider: dataProvider,delegate: quoteOperationsHandler,logo: logo,shouldShowToolbar: true)
Configuring ChartScreen.ViewController
with Logo
:
chartScreenViewController.logo = logo