Skip to main content

Logo

In ChartScreen, you can add a custom logo to the chart.

You can add a logo in two ways:

  • Pass Logo when initializing via makeScreen.
  • Set the logo property on the ChartScreen.ViewController returned by makeScreen.

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

  • imageUIImage to display
  • position — 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 only
let logo = Logo(image: UIImage(named: "companyLogo")!)
// All properties
let 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