RoCry's personal Swift 6.2 + SwiftUI helpers for iOS/macOS projects. Tuist-first.
This project uses Swift 6.2's Approachable Concurrency features:
SWIFT_APPROACHABLE_CONCURRENCY: YES- Enables SE-0461 (nonisolated async runs on caller's actor) and SE-0470 (infer isolated conformances)- RCKit framework:
nonisolatedby default (appropriate for libraries) - RCKitDemo app:
MainActorby default viaSWIFT_DEFAULT_ACTOR_ISOLATION(SE-0466)
RCKitframeworkRCKitDemoapp (SwiftUI demo)RCKitTestsunit tests
Dependency:
.dependencies: [
.project(target: "RCKit", path: "../RCKit")
]import RCKit
// Create a logger alias (recommended pattern)
private let logger = Log.default
logger.info("message")
logger.debug("debug info")
logger.error("failed", metadata: ["code": 500])
// Or create custom logger with specific category
private let networkLogger = Log(category: "network")
networkLogger.info("request sent")Output format: message (File.swift:42 functionName())
Streams logs to NSLogger desktop viewer via Bonjour.
- Start NSLogger and bootstrap its Destination early in app launch:
let nsLogger = NSLoggerSupport.start(minimumLevel: .debug)
Log.bootstrap([nsLogger])- Add to Info.plist:
<key>NSBonjourServices</key>
<array><string>_nslogger._tcp</string></array>
<key>NSLocalNetworkUsageDescription</key>
<string>Discover NSLogger viewer on local network for live logging.</string>Logs go to both OSLog and NSLogger simultaneously. Domain format: subsystem:category.
NSLoggerSupport.start(useBonjourForBuildUser: true)— returns a Destination using a per-user Bonjour service nameNSLoggerSupport.start(useSSL: true)— returns a Destination using SSL
- Fail-fast: invalid inputs preconditionFailure