Skip to content

Commit

Permalink
Update readme. Update documentation. Fix localization.
Browse files Browse the repository at this point in the history
  • Loading branch information
W1W1-M committed Dec 6, 2021
1 parent fe2c080 commit 651cc12
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
```

Expand Down
16 changes: 16 additions & 0 deletions Sources/PackAPrefPane/Documentation.docc/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/PackAPrefPane/Views/PackAPrefPane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public struct PackAPrefPane<Content: View>: 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: {
Expand Down

0 comments on commit 651cc12

Please sign in to comment.