Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Make custom callout views easier to use [WIP] #4948

Closed
wants to merge 9 commits into from

Conversation

friedbunny
Copy link
Contributor

@friedbunny friedbunny commented May 5, 2016

Following on from #4392, this pull request aims to simplify custom callout view creation and usage.

Changes

MGLCalloutView protocol

  • Simplified.
  • Most properties are optional, including accessory views and title strings.
  • Adds -detailAccessoryView.

MGLCalloutViewDelegate

  • Removed.

MGLAnnotation (Really, only MGLPointAnnotation)

  • Adds -canShowCallout boolean property.
  • Adds -calloutView property that conforms to MGLCalloutView protocol.

MGLCompactCalloutView

screen shot 2016-05-04 at 9 45 43 pm

Todo

  • Interface Builder support.
  • Accessibility.
  • Hook-up accessory views.
  • Handle gestures for callouts.
    • Re-enable -[MGLMapView mapView:annotation:calloutAccessoryControlTapped:].
    • Add custom gesture handlers to custom callout example.
  • Fit the default callout view to the viewport.
  • Add MGLCalloutView.annotation?
    • Instead of manually re-setting the title and subtitle properties, maybe let the callout implementation do that directly with a passed-in annotation.
  • Audit MGLMapView for dead delegate methods; remove or deprecate.
    • -mapView:annotationCanShowCallout:
    • -mapView:calloutViewForAnnotation:
    • -mapView:tapOnCalloutForAnnotation:
    • -mapView:rightCalloutAccessoryViewForAnnotation:
    • -mapView:leftCalloutAccessoryViewForAnnotation:

Stretch goals

/cc @1ec5 @boundsj

@friedbunny friedbunny self-assigned this May 5, 2016
@friedbunny friedbunny added iOS Mapbox Maps SDK for iOS refactor ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold labels May 5, 2016
@friedbunny friedbunny added this to the ios-v3.3.0 milestone May 5, 2016
@friedbunny
Copy link
Contributor Author

friedbunny commented May 5, 2016

This is still a big work-in-progress; b6c0c9f is my stopping point for tonight.

My approach so far has been to go through with a machete, showing wanton disregard for backwards compatibility, but clearly we’ll have to address deprecation one way or another before this is ready to go.

*/
- (void)calloutViewDidAppear:(UIView<MGLCalloutView> *)calloutView;
@property (nonatomic, weak) id<MGLCalloutViewDelegate> delegate;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is slated for removal.

@friedbunny friedbunny modified the milestones: ios-v3.4.0, ios-v3.3.0 May 23, 2016
@friedbunny
Copy link
Contributor Author

Pushing this off of v3.3.0 — haven’t made enough progress and there’s a lot of other validation to do for that release. I may keep picking at this in the meantime, though.

@andrewstay
Copy link

andrewstay commented Jun 23, 2016

Please clarify if that means I have to allocate all the callout views for all the annotations on the map and keep those views in the memory even though user may never click on those?

@1ec5
Copy link
Contributor

1ec5 commented Jun 23, 2016

@andrewstay, by the time this feature lands, it’ll work similarly to annotation views. Callout views will go into a reuse queue, so the number of allocated views will be limited.

@friedbunny
Copy link
Contributor Author

This has been rebased onto the current master — will be picking up work on this again this week.

@friedbunny friedbunny modified the milestones: ios-v3.4.0, ios-future Aug 19, 2016
@friedbunny
Copy link
Contributor Author

So stale. Hopefully this will happen eventually!

@friedbunny friedbunny closed this Sep 15, 2017
@friedbunny friedbunny deleted the fb-callouts-4392 branch September 15, 2017 23:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
annotations Annotations on iOS and macOS or markers on Android ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold iOS Mapbox Maps SDK for iOS refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants