From 2a278d3f4a6396316820bcbe36bb8e7b07909ba3 Mon Sep 17 00:00:00 2001 From: Nuno Grilo Date: Sat, 17 Feb 2024 15:37:53 +0000 Subject: [PATCH] #697: Propagate .options modifier on SwiftUI View update --- Parchment/Classes/PagingViewController.swift | 2 +- Parchment/Structs/PagingControllerRepresentableView.swift | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Parchment/Classes/PagingViewController.swift b/Parchment/Classes/PagingViewController.swift index bb08d2cb..785683f5 100644 --- a/Parchment/Classes/PagingViewController.swift +++ b/Parchment/Classes/PagingViewController.swift @@ -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) diff --git a/Parchment/Structs/PagingControllerRepresentableView.swift b/Parchment/Structs/PagingControllerRepresentableView.swift index 36d1a0a4..c0675fe7 100644 --- a/Parchment/Structs/PagingControllerRepresentableView.swift +++ b/Parchment/Structs/PagingControllerRepresentableView.swift @@ -46,6 +46,9 @@ struct PagingControllerRepresentableView: UIViewControllerRepresentable { if pagingViewController.dataSource == nil { pagingViewController.dataSource = context.coordinator } + + pagingViewController.options = options + pagingViewController.indicatorClass = PagingHostingIndicatorView.self pagingViewController.reloadData()