diff --git a/README.md b/README.md index 64c71f7..454c9c3 100644 --- a/README.md +++ b/README.md @@ -27,18 +27,16 @@ ## Usage * Import `PackAPrefPane` Swift package -* Setup a var with `PrefPaneData` type and customize each variable to your needs +* Setup a `PrefPaneData` typed var and customize it to your needs * Setup your nested `appSettingsView` within a SwiftUI `Section` view -* Make sure you have a var for showing sheets `settingsSheetPresented: Bool` -* Use `PackAPrefPane` view with the above variables as in this example: +* Make sure you have a @State var for showing sheets `settingsSheetPresented: Bool` +* Use `PackAPrefPane` view as in the following example: ``` PackAPrefPane( - settingsSheetPresented: yourSheetbool, + settingsSheetPresented: $yourSheetBool, prefPaneData: yourPrefPaneData ) { - Section(header: Text("Your nested app settings view section")) { - YourNestedAppSettingsView() - } + YourNestedAppSettingsSectionView() } ``` diff --git a/Sources/PackAPrefPane/Documentation.docc/Documentation.md b/Sources/PackAPrefPane/Documentation.docc/Documentation.md index 47b98f8..bc0ea71 100644 --- a/Sources/PackAPrefPane/Documentation.docc/Documentation.md +++ b/Sources/PackAPrefPane/Documentation.docc/Documentation.md @@ -10,6 +10,22 @@ PackAPrefPane lets developers quickly implement a settings sheet for their apps. ![PackAPrefPane preview](PackAPrefPanePreview.png) +## Usage + +* Import ``PackAPrefPane/PackAPrefPane`` Swift package +* Setup a ``PrefPaneData`` typed var and customize it to your needs +* Setup your nested `appSettingsView` within a SwiftUI `Section` view +* Make sure you have a @State var for showing sheets `settingsSheetPresented: Bool` +* Use ``PackAPrefPane/PackAPrefPane`` view as in the following example: +``` +PackAPrefPane( + settingsSheetPresented: $yourSheetBool, + prefPaneData: yourPrefPaneData +) { + YourNestedAppSettingsSectionView() +} +``` + ## Topics ### Essentials diff --git a/Sources/PackAPrefPane/Views/PackAPrefPane.swift b/Sources/PackAPrefPane/Views/PackAPrefPane.swift index 1be616b..e173a83 100644 --- a/Sources/PackAPrefPane/Views/PackAPrefPane.swift +++ b/Sources/PackAPrefPane/Views/PackAPrefPane.swift @@ -46,7 +46,7 @@ public struct PackAPrefPane: View { if prefPaneData.legalSectionData.showLegalSection { Legal(legalSectionData: prefPaneData.legalSectionData) } - }.navigationTitle(NSLocalizedString(prefPaneData.prefPaneTitle, tableName: "Localizable", bundle: .module, value: "", comment: "")) + }.navigationTitle(NSLocalizedString(prefPaneData.prefPaneTitle, tableName: "Localizable", bundle: .main, value: "", comment: "")) .toolbar { // Toolbar with close button ToolbarItem(placement: .navigation) { Button(action: {