Skip to content

Commit

Permalink
Merge pull request #703 from nfgrilo/697-propagate_.options_on_View_u…
Browse files Browse the repository at this point in the history
…pdate

Propagate .options on View update
  • Loading branch information
rechsteiner committed Feb 17, 2024
2 parents 279c935 + 2a278d3 commit ac733ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Parchment/Classes/PagingViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ open class PagingViewController:

/// An instance that stores all the customization so that it's
/// easier to share between other classes.
public private(set) var options: PagingOptions {
public internal(set) var options: PagingOptions {
didSet {
if options.menuLayoutClass != oldValue.menuLayoutClass {
let layout = createLayout(layout: options.menuLayoutClass.self)
Expand Down
3 changes: 3 additions & 0 deletions Parchment/Structs/PagingControllerRepresentableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ struct PagingControllerRepresentableView: UIViewControllerRepresentable {
if pagingViewController.dataSource == nil {
pagingViewController.dataSource = context.coordinator
}

pagingViewController.options = options
pagingViewController.indicatorClass = PagingHostingIndicatorView.self

// We only want to reload the content views when the items have actually
// changed. For items that are added, a new view controller instance will
Expand Down

0 comments on commit ac733ce

Please sign in to comment.