跳轉到主要內容
InsForge Swift SDK 為從 iOS、macOS、tvOS 和 watchOS 應用與 InsForge 服務互動提供了原生 Swift 用戶端。

安裝

Swift Package Manager

Add InsForge to your Swift Package Manager dependencies:

Enable Logging (Optional)

For debugging, you can configure the SDK log level and destination:
Log Levels:
LevelDescription
.traceMost verbose, includes all internal details
.debugDetailed information for debugging
.infoGeneral operational information (default)
.warningWarnings that don’t prevent operation
.errorErrors that affect functionality
.criticalCritical failures
Log Destinations:
DestinationDescription
.consoleStandard output (print)
.osLogApple’s unified logging system (recommended for iOS/macOS)
.noneDisable logging
.customProvide your own LogHandler factory
Use .info or .error in production to avoid exposing sensitive data in logs.
或透過 Xcode 新增:
  1. File → Add Packages…
  2. 輸入:https://github.com/insforge/insforge-swift.git

CocoaPods(即將推出)

快速入門

功能

  • 資料庫 - 支援 Codable 的類型安全 CRUD 操作
  • 驗證 - 電子郵件/密碼和 OAuth 驗證
  • 儲存體 - 檔案上傳、下載和管理
  • AI - 聊天完成和影像生成
  • 即時 - 基於 WebSocket 的發佈/訂閱訊息
  • SwiftUI 整合 - 屬性包裝和環境值

平台支援

平台最低版本
iOS15.0+
macOS12.0+
tvOS15.0+
watchOS8.0+

SDK 參考

Database

CRUD operations with Codable models

Authentication

Sign up, sign in, OAuth, and user management

Storage

File upload, download, and management

AI

Chat completions and image generation

Realtime

WebSocket pub/sub messaging