Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/docc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Documentation

on:
push:
branches: [master]
pull_request:

permissions:
contents: read

jobs:
docbuild:
name: Build DocC documentation
runs-on: macos-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Emit symbol graph
run: |
mkdir -p .build/symbol-graphs
swift build --target SystemSoundsLibrary \
-Xswiftc -emit-symbol-graph \
-Xswiftc -emit-symbol-graph-dir -Xswiftc .build/symbol-graphs

- name: Convert documentation
run: |
xcrun docc convert Sources/SystemSoundsLibrary/SystemSoundsLibrary.docc \
--fallback-display-name SystemSoundsLibrary \
--fallback-bundle-identifier com.github.tuner88.SystemSoundsLibrary \
--additional-symbol-graph-dir .build/symbol-graphs \
--output-path .build/SystemSoundsLibrary.doccarchive \
--warnings-as-errors

- name: Check that symbols were documented
run: |
ls .build/symbol-graphs
data=.build/SystemSoundsLibrary.doccarchive/data/documentation/systemsoundslibrary
for page in systemsound systemsoundplayer filesound gettingstarted soundsorhaptics appreview; do
test -f "$data/$page.json" || { echo "::error::Missing documentation page $page"; exit 1; }
done
echo "Documented pages: $(find "$data" -name '*.json' | wc -l)"
27 changes: 27 additions & 0 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Example app

on:
push:
branches: [master]
pull_request:

permissions:
contents: read

jobs:
build:
name: Build SoundBrowser (iOS Simulator)
runs-on: macos-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Show toolchain
run: xcodebuild -version

- name: Build
run: |
xcodebuild build \
-project Examples/SoundBrowser/SoundBrowser.xcodeproj \
-scheme SoundBrowser \
-destination 'generic/platform=iOS Simulator' \
CODE_SIGNING_ALLOWED=NO
55 changes: 55 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Swift package

on:
push:
branches: [master]
pull_request:

permissions:
contents: read

jobs:
test:
name: swift build + swift test (macOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Show toolchain
run: |
xcodebuild -version
swift --version

- name: Check generated Swift catalog is up to date
run: python3 scripts/generate_swift.py --check

- name: Build
run: swift build

- name: Test
run: swift test

platforms:
name: Build for ${{ matrix.destination }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
destination:
- generic/platform=iOS Simulator
- generic/platform=tvOS Simulator
- generic/platform=visionOS Simulator
- generic/platform=macOS,variant=Mac Catalyst
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

# The repository root also contains the legacy SystemSoundLibrary.xcodeproj, so
# build the package from a copy that only contains the package files.
- name: Build package
run: |
set -o pipefail
PKG="$RUNNER_TEMP/package"
mkdir -p "$PKG"
cp -R Package.swift Sources Tests "$PKG/"
cd "$PKG"
xcodebuild build -scheme SystemSoundsLibrary -destination '${{ matrix.destination }}' CODE_SIGNING_ALLOWED=NO -quiet
17 changes: 17 additions & 0 deletions Examples/SoundBrowser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# SoundBrowser

A small SwiftUI app that uses the `SystemSoundsLibrary` Swift package from this repository.

- Search by name, ID, file name or category
- Sounds grouped by folder (`UISounds`, `UISounds/New`, `UISounds/Modern`, `UISounds/nano`)
- Tap a row to play the sound; the info button shows ID, path, category, availability and confidence
- Share or save the sound file from the details screen

Open `SoundBrowser.xcodeproj` in Xcode 16 or later and run it on a device with iOS 17 or later.
The iOS Simulator doesn't play system sounds, and the sound files can't be read there, so
sharing is only available on a device.

The app reads files from `/System/Library/Audio/UISounds` to share them. That's fine for a
developer tool, but don't ship it in an App Store app (App Review Guideline 2.5.2).

The original Objective-C demo app is still at the repository root (`SystemSoundLibrary.xcodeproj`).
Loading
Loading