Skip to content

Dumping CLLocation #139

@tomaskraina

Description

@tomaskraina

Describe the bug
CustomDump is not partially useful when dumping CLLocation: customDump(location) prints just "CLLocation()".

import Testing
import CoreLocation
import CustomDump

struct CustomDumpTests {

    @Test
    func testCustomDump() async throws {
        let location = CLLocation(
            coordinate: .init(latitude: 49.8397, longitude: 18.2900),
            altitude: 256.0,
            horizontalAccuracy: 30.0,
            verticalAccuracy: 40.0,
            course: 100.0,
            speed: 3.6,
            timestamp: .now
        )

        customDump(location) // prints: CLLocation()
        dump(location) // prints: - <+49.83970000,+18.29000000> +/- 30.00m (speed 3.60 mps / course 100.00) @ 10.07.2025, 11:03:14 Central European Summer Time #0 - super: NSObject
    }
}

Expected behavior
CustomDump prints all properties of CLLocation including accuracy, speed, etc.: https://developer.apple.com/documentation/corelocation/cllocation#Getting-the-location-attributes

Environment

  • swift-custom-dump version [e.g. 1.3.3]
  • Xcode [e.g. 16.4]
  • Swift [e.g. 6.1.2]
  • OS: [e.g. macOS 15.5]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions