GoldPrice is a native SwiftUI macOS menu bar app for tracking live international gold prices in USD / OZ and RMB / g, with a desktop widget and a dedicated detail window.
- Persistent menu bar entry for quick price lookup
- Second-level refresh in the main app
USD / OZandRMB / gprimary price display- Manual source switching:
Auto,Kitco,Gold API - Detail window with a short-range price chart
systemSmallandsystemMediumdesktop widgets- Native SwiftUI implementation without third-party dependencies
- macOS 14 or later
- Xcode 15 or later
- Network access to public price sources
- Open
GoldPrice.xcodeprojin Xcode. - Select the
GoldPricescheme. - In
Signing & Capabilities, assign a Team for bothGoldPriceandGoldPriceWidgetExtension. - If the default
com.example.*bundle identifiers conflict, replace them with your own. - Choose
My Macas the run destination. - Press
Cmd + R.
After the first launch, the main entry lives in the macOS menu bar. Click the live price item to open the panel, then use Detail to open the full window.
Chinese versions:
The app currently supports the following modes:
Auto: prefersKitco, falls back toGold APIKitco: parses live data directly from the Kitco chart pageGold API: useshttps://api.gold-api.com/price/XAU
RMB / g is calculated from USD/CNY data parsed alongside the quote source. If exchange-rate parsing fails, the RMB price is shown as --.
- Menu bar panel and detail window: refresh every second
- Widget: refresh frequency is controlled by
WidgetKit
That means true second-level updates only apply to the main app, not to the widget. The short-range line chart only advances when the quote source delivers a fresh sample.
GoldPriceApp/
GoldPriceApp.swift
MenuBarViews.swift
ContentView.swift
GoldPriceViewModel.swift
GoldPriceWidget/
GoldPriceWidget.swift
Shared/
GoldPriceService.swift
GoldPriceModels.swift
Formatting.swift
GoldPriceTheme.swift
docs/
assets/
USAGE.md
USAGE.zh-CN.md
BUILD_AND_RELEASE.md
BUILD_AND_RELEASE.zh-CN.md
scripts/
generate_app_icon.swift
generate_icon_concepts.swift
generate_readme_previews.swift
render_menu_header_preview.swift
Unsigned local build:
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer \
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild \
-project GoldPrice.xcodeproj \
-scheme GoldPrice \
-configuration Debug \
-derivedDataPath ./.build/DerivedData \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
build- Widgets cannot refresh every second
- Price parsing depends on third-party page structure and public endpoints
- The repository does not include signing or notarization automation
- The repository does not currently include a
LICENSE
Issues and pull requests are welcome. Read Contributing before making larger changes.
No license file is included yet. If you plan to publish the repository publicly, define the license before release.

