Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

axiom-core-location-ref

БесплатноБез исполняемых скриптовНе проверен

Use for Core Location API reference - CLLocationUpdate, CLMonitor, CLServiceSession, authorization, background location, geofencing

ComeOnOliverот ComeOnOliver★ 67 звёзд на GitHub

Об этом скилле

Core Location Reference

Comprehensive API reference for modern Core Location (iOS 17+).

When to Use

  • Need API signatures for CLLocationUpdate, CLMonitor, CLServiceSession
  • Implementing geofencing or region monitoring
  • Configuring background location updates
  • Understanding authorization patterns
  • Debugging location service issues

Related Skills

  • axiom-core-location — Anti-patterns, decision trees, pressure scenarios
  • axiom-core-location-diag — Symptom-based troubleshooting
  • axiom-energy-ref — Location as battery subsystem (accuracy vs power)

Part 1: Modern API Overview (iOS 17+)

Four key classes replace legacy CLLocationManager patterns:

Class Purpose iOS
CLLocationUpdate AsyncSequence for location updates 17+
CLMonitor Condition-based geofencing/beacons 17+
CLServiceSession Declarative authorization goals 18+
CLBackgroundActivitySession Background location support 17+

Migration path: Legacy CLLocationManager still works, but new APIs provide:

  • Swift concurrency (async/await)
  • Automatic pause/resume
  • Simplified authorization
  • Better battery efficiency

Part 2: CLLocationUpdate API

Basic Usage

import CoreLocation

Task {
    do {
        for try await update in CLLocationUpdate.liveUpdates() {
            if let location = update.location {
                // Process location
            }
            if update.isStationary {
                break // Stop when user stops moving
            }
        }
    } catch {
        // Handle location errors
    }
}

LiveConfiguration Options

CLLocationUpdate.liveUpdates(.default)
CLLocationUpdate.liveUpdates(.automotiveNavigation)
CLLocationUpdate.liveUpdates(.otherNavigation)
CLLocationUpdate.liveUpdates(.fitness)
CLLocationUpdate.liveUpdates(.airborne)

Choose based on use case. If unsure, use .default or omit parameter.

Key Properties

Property Type Description
location CLLocation? Current location (nil if unavailable)
isStationary Bool True when device stopped moving
authorizationDenied Bool User denied location access
authorizationDeniedGlobally Bool Location services disabled system-wide
authorizationRequestInProgress Bool Awaiting user authorization decision
accuracyLimited Bool Reduced accuracy (updates every 15-20 min)
locationUnavailable Bool Cannot determine location
insufficientlyInUse Bool Can't request auth (not in foreground)

Automatic Pause/Resume

When device becomes stationary:

  1. Final update delivered with isStationary = true and valid location
  2. Updates pause (saves battery)
  3. When device moves, updates resume with isStationary = false

No action required—happens automatically.

AsyncSequence Operations

// Get first location with speed > 10 m/s
let fastUpdate = try await CLLocationUpdate.liveUpdates()
    .first { $0.location?.speed ?? 0 > 10 }

// WARNING: Avoid filters that may never match (e.g., horizontalAccuracy < 1)

Part 3: CLMonitor API

Swift actor for monitoring geographic conditions and beacons.

Basic Geofencing

let monitor = await CLMonitor("MyMonitor")

// Add circular region
let condition = CLMonitor.CircularGeographicCondition(
    center: CLLocationCoordinate2D(latitude: 37.33, longitude: -122.01),
    radius: 100
)
await monitor.add(condition, identifier: "ApplePark")

// Await events
for try await event in monitor.events {
    switch event.state {
    case .satisfied:  // User entered region
        handleEntry(event.identifier)
    case .unsatisfied:  // User exited region
        handleExit(event.identifier)
    case .unknown:
        break
    @unknown default:
        break
    }
}

CircularGeographicCondition

CLMonitor.CircularGeographicCondition(
    center: CLLocationCoordinate2D,
    radius: CLLocationDistance  // meters, minimum ~100m effective
)

BeaconIdentityCondition

Three granularity levels:

// All beacons with UUID (any site)
CLMonitor.BeaconIdentityCondition(uuid: myUUID)

// Specific site (UUID + major)
CLMonitor.BeaconIdentityCondition(uuid: myUUID, major: 100)

// Specific beacon (UUID + major + minor)
CLMonitor.BeaconIdentityCondition(uuid: myUUID, major: 100, minor: 5)

Condition Limit

Maximum 20 conditions per app. Prioritize what to monitor. Swap regions dynamically based on user location if needed.

Adding with Assumed State

// If you know initial state
await monitor.add(condition, identifier: "Work", assuming: .unsatisfied)

Core Location will correct if assumption wrong.

Accessing Records

// Get single record
if let record = await monitor.record(for: "ApplePark") {
    let condition = record.condition
    let lastEvent = record.lastEvent
    let state = lastEvent.s
Полный SKILL.md на GitHub

Установить axiom-core-location-ref в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл axiom-core-location-ref?

Use for Core Location API reference - CLLocationUpdate, CLMonitor, CLServiceSession, authorization, background location, geofencing

Как установить скилл axiom-core-location-ref?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл axiom-core-location-ref запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить axiom-core-location-ref с