-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from macblazer/improve-documentation
Improve documentation
- Loading branch information
Showing
17 changed files
with
352 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build and Publish Docs | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
# Kill any previous run still executing | ||
concurrency: | ||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_docs: | ||
name: Build and Archive Docs | ||
runs-on: macos-12 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Generate docs | ||
run: | | ||
swift package \ | ||
--allow-writing-to-directory github-pages \ | ||
generate-documentation \ | ||
--target ManagedAppConfigLib \ | ||
--disable-indexing \ | ||
--transform-for-static-hosting \ | ||
--hosting-base-path ManagedAppConfigLib/ \ | ||
--output-path github-pages | ||
- name: Upload docs archive | ||
uses: actions/upload-pages-artifact@main | ||
with: | ||
path: github-pages | ||
|
||
deploy: | ||
name: Deploy Docs | ||
needs: build_docs | ||
|
||
permissions: | ||
pages: write | ||
id-token: write | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Run unit tests | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
paths: | ||
- '**.swift' | ||
|
||
# Kill any previous run still executing | ||
concurrency: | ||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
spm_tests: | ||
name: Run package tests | ||
runs-on: macos-12 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Unit Test | ||
run: swift test -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
xcuserdata | ||
.DS_Store | ||
.swiftpm | ||
.build | ||
Package.resolved |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
Pod::Spec.new do |s| | ||
s.name = "ManagedAppConfigLib" | ||
s.version = "1.0.0" | ||
s.summary = "A facade that simplifies working with Managed App Configuration and Feedback." | ||
s.version = "1.1.0" | ||
s.summary = "Simplify working with Managed App Configuration and Feedback." | ||
|
||
s.description = <<-DESC | ||
The purpose of ManagedAppConfigLib is to make it that much easier to work with Apple's [Managed App Configuration](https://developer.apple.com/library/content/samplecode/sc2279/Introduction/Intro.html) by providing a few convenience methods. | ||
The purpose of ManagedAppConfigLib is to make it easier to work with Apple's [Managed App Configuration](https://developer.apple.com/library/content/samplecode/sc2279/Introduction/Intro.html) by providing a couple property wrappers and an object-based approach. | ||
DESC | ||
|
||
s.homepage = "https://appconfig.org/" | ||
s.license = { :type => "MIT", :file => "LICENSE" } | ||
s.author = { "James Felton" => "[email protected]" } | ||
s.author = "Kyle Hammond", "James Felton" | ||
|
||
s.swift_versions = "5.1" | ||
s.platform = :ios, "8.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
Sources/ManagedAppConfigLib/Documentation.docc/AppConfig.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# ``ManagedAppConfigLib/AppConfig`` | ||
|
||
## Example | ||
|
||
Here is an example view that displays some text based on Managed App Configuration. If the | ||
key `title` doesn't exist or is not a String, the property will have the value "Default title". | ||
The subtitle is optional and will only display if the key `subtitle` is present. | ||
|
||
```swift | ||
import ManagedAppConfigLib | ||
import SwiftUI | ||
|
||
struct ContentView: View { | ||
@AppConfig("title") private var displayTitle = "Default title" | ||
@AppConfig("subtitle") private var subTitle: String? | ||
|
||
var body: some View { | ||
VStack { | ||
Text(displayTitle).font(.headline) | ||
if let text = subTitle { | ||
Text(text).font(.subheadline) | ||
} | ||
} | ||
.padding() | ||
} | ||
} | ||
``` | ||
|
||
## Topics | ||
|
||
### Reading a Managed App Configuration value with default | ||
|
||
- ``init(wrappedValue:_:store:)`` | ||
|
||
### Reading an optional Managed App Configuration value | ||
|
||
- ``init(_:store:)`` | ||
|
||
### Getting the value | ||
|
||
- ``wrappedValue`` | ||
|
||
### DynamicProperty Implementation | ||
|
||
- ``update()`` |
31 changes: 31 additions & 0 deletions
31
Sources/ManagedAppConfigLib/Documentation.docc/AppConfigPlain.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# ``ManagedAppConfigLib/AppConfigPlain`` | ||
|
||
## Example | ||
|
||
This example has the property wrapper being used in a struct that represents the application | ||
settings. This lets an IT organization override the default title and the starting quantity. | ||
|
||
```swift | ||
import ManagedAppConfigLib | ||
|
||
struct AppSettings { | ||
@AppConfigPlain("title") var defaultTitle = "Default title" | ||
@AppConfigPlain("quantity") var startingAmount: Int = 0 | ||
|
||
var actualAmount: Int | ||
} | ||
``` | ||
|
||
## Topics | ||
|
||
### Reading a Managed App Configuration value with default | ||
|
||
- ``init(wrappedValue:_:store:)`` | ||
|
||
### Reading an optional Managed App Configuration value | ||
|
||
- ``init(_:store:)`` | ||
|
||
### Getting the value | ||
|
||
- ``wrappedValue`` |
Oops, something went wrong.