Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any progress towards supporting the iOS 17 Map inits? #365

Open
JOyo246 opened this issue Jan 21, 2025 · 0 comments
Open

Is there any progress towards supporting the iOS 17 Map inits? #365

JOyo246 opened this issue Jan 21, 2025 · 0 comments

Comments

@JOyo246
Copy link

JOyo246 commented Jan 21, 2025

I tried to give it a go, but it seems like there's a new type that needs to be handled called, StateOrBinding?

StateOrBinding will output State, which yields the following..

    @available(iOS 17.0, *)
    func cameraPositionBinding() throws -> State<MapCameraPosition> {
        return try Inspector.attribute(path: "provider|_position|state",
                                       value: content.view,
                                       type: State<MapCameraPosition>.self)
    }

Is it okay that State is used, rather than Binding?

here's a dump of the two maps

// pre iOS 17 
    view: Map<_DefaultAnnotatedMapContent<Array<CoordinateItem>>>
      provider: _DefaultAnnotatedMapContent<Array<CoordinateItem>>
        content: Optional<(CoordinateItem) -> _MapAnnotationData>
          some: (CoordinateItem) -> _MapAnnotationData = (Function)
        interactionModes: MapInteractionModes
          rawValue: Int = 15
        items: Optional<Array<CoordinateItem>>
          [0]
            coordinate: CLLocationCoordinate2D
              latitude: Double = 37.3349
              longitude: Double = -122.009
        regionBinding: RegionBinding
          coordinateRegion: Binding<MKCoordinateRegion>
            _value: MKCoordinateRegion
              center: CLLocationCoordinate2D
                latitude: Double = 37.3349
                longitude: Double = -122.009
              span: MKCoordinateSpan
                latitudeDelta: Double = 0.018020631024752858
                longitudeDelta: Double = 0.0225683367104779
            location: LocationBox<ConstantLocation<MKCoordinateRegion>>
              _cache: AtomicBox<LocationProjectionCache>
                buffer: AtomicBuffer<LocationProjectionCache>
                  header: os_unfair_lock_s
                    _os_unfair_lock_opaque: UInt32 = 0
              location: ConstantLocation<MKCoordinateRegion>
                value: MKCoordinateRegion
                  center: CLLocationCoordinate2D
                    latitude: Double = 37.3349
                    longitude: Double = -122.009
                  span: MKCoordinateSpan
                    latitudeDelta: Double = 0.018020631024752858
                    longitudeDelta: Double = 0.0225683367104779
            transaction: Transaction
              plist: PropertyList
                elements: Optional<Element> = nil
        showsUserLocation: Bool = false
        userTrackingMode: Optional<Binding<MapUserTrackingMode>> = nil
// iOS 17 +

    view: Map<MapContentView<Never, ModifiedContent<Marker<Text>, _EnvironmentKeyWritingMapContentModifier<Optional<AnyShapeStyle>>>>>
      provider: MapContentView<Never, ModifiedContent<Marker<Text>, _EnvironmentKeyWritingMapContentModifier<Optional<AnyShapeStyle>>>>
        _position: StateOrBinding<MapCameraPosition>
          state: State<MapCameraPosition>
            _location: Optional<AnyLocation<MapCameraPosition>> = nil
            _value: MapCameraPosition
              storage: Storage
                region: MKCoordinateRegion
                  center: CLLocationCoordinate2D
                    latitude: Double = 37.3349
                    longitude: Double = -122.009
                  span: MKCoordinateSpan
                    latitudeDelta: Double = 0.018020631024752858
                    longitudeDelta: Double = 0.0225683367104779

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant