initial commit: Proximity iOS app proposal, full Swift code scaffold, reference backend, testing docs, generated Xcode project

This commit is contained in:
2026-08-12 00:22:01 +00:00
commit 9d1b0f8dd9
52 changed files with 6271 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
import Foundation
/// The physical range band a user is open to connecting within.
///
/// Each tier maps to a different sensing technology. The tiers are ordered so
/// higher tiers *include* lower ones (being open "in the area" also means
/// you're open "nearby" and "right here").
enum DistanceTier: Int, CaseIterable, Identifiable, Codable {
/// 09 m. Ultra-wideband (Nearby Interaction). "This exact person."
case rightHere = 1
/// 10100 m. Bluetooth Low Energy / iBeacon. "This room, this block."
case nearby = 2
/// 100 m50 mi. Server-relayed, opt-in coarse location. "This neighborhood."
case inTheArea = 3
var id: Int { rawValue }
var title: String {
switch self {
case .rightHere: return "Right Here"
case .nearby: return "Nearby"
case .inTheArea: return "In the Area"
}
}
var subtitle: String {
switch self {
case .rightHere: return "09 m · UWB"
case .nearby: return "10100 m · BLE"
case .inTheArea: return "100 m50 mi · Network"
}
}
/// The primary engine used for this tier.
var engine: ProximityEngine {
switch self {
case .rightHere: return .uwb
case .nearby: return .ble
case .inTheArea: return .beacon
}
}
/// Higher tiers include lower ones.
func includes(_ other: DistanceTier) -> Bool {
self.rawValue >= other.rawValue
}
}