bitchat/Package.swift
callebtc 04995f68e4
Port the Android globe geohash picker to iOS (#1807)
* Port the Android globe geohash picker to iOS

Adds the 3D globe picker from bitchat-android: a map button next to the
geohash field opens a full-screen orthographic globe (Natural Earth land,
borders and cities, geohash grid, crosshair) with drag/fling, pinch, tap
and double-tap, precision buttons and a fly-in to the current geohash.
Selecting teleports like typing a geohash.

Beyond a straight port:
- Fix ocean painted as land: the point-in-ring test counted the
  antimeridian seam as a crossing for Eurasia, flipping its fill over the
  Pacific and Atlantic. Android has the same bug.
- Motion detail only steps down within one gesture, so layers no longer
  flash on and off while dragging.
- The geohash grid and city dots draw at every detail level instead of
  vanishing while the globe moves.

Extracts GeohashCoverage so the sheet and picker share the cell-size
string, and adds the picker strings in all locales.

* Let the globe reach polar targets past the drag limit

A polar cell's center can lie past the ±89° drag limit (zzzz is at
89.91°). The animated intro clamped its latitude there and selected
zzzf, while the Reduce Motion path kept zzzz. Animations now always
reach their target; dragging keeps the limit on the far side and never
snaps a polar view back to it.
2026-10-25 02:55:00 +02:00

78 lines
2.7 KiB
Swift

// swift-tools-version: 5.9
import PackageDescription
let package = Package(
name: "bitchat",
defaultLocalization: "en",
platforms: [
.iOS(.v16),
.macOS(.v13)
],
products: [
.executable(
name: "bitchat",
targets: ["bitchat"]
)
],
dependencies: [
.package(path: "localPackages/Arti"),
.package(path: "localPackages/BitFoundation"),
.package(path: "localPackages/BitLogger"),
.package(url: "https://github.com/21-DOT-DEV/swift-secp256k1", exact: "0.24.0")
],
targets: [
.executableTarget(
name: "bitchat",
dependencies: [
.product(name: "P256K", package: "swift-secp256k1"),
.product(name: "BitFoundation", package: "BitFoundation"),
.product(name: "BitLogger", package: "BitLogger"),
.product(name: "Tor", package: "Arti")
],
path: "bitchat",
exclude: [
"Info.plist",
"Assets.xcassets",
"_PreviewHelpers/PreviewAssets.xcassets",
"bitchat.entitlements",
"bitchat-macOS.entitlements",
"LaunchScreen.storyboard",
"ViewModels/Extensions/README.md",
// Globe picker geometry, bundled by the Xcode app targets and read
// from Bundle.main; the SwiftPM build only runs tests.
"Resources/Globe"
],
resources: [
.process("Localizable.xcstrings")
]
),
.testTarget(
name: "bitchatTests",
dependencies: [
"bitchat",
.product(name: "BitFoundation", package: "BitFoundation")
],
path: "bitchatTests",
exclude: [
"Info.plist",
"README.md",
// CI perf gate data (read by scripts/check-perf-floors.sh),
// not a test resource.
"Performance/perf-floors.json"
],
resources: [
.process("Localization"),
// Only the vector fixture: declaring the whole "Noise"
// directory would claim its .swift test files as resources
// and silently drop them from compilation.
.process("Noise/NoiseTestVectors.json"),
// Frozen envelopes produced by the released iOS (733098bb)
// and Android (b7f0b33d) private-DM implementations; prove
// receive compatibility independently of the local generator.
.process("Nostr/Fixtures")
]
)
]
)