AWFMapCallout

Objective-C

@interface AWFMapCallout : NSObject

Swift

class AWFMapCallout : NSObject

An AWFMapCallout object is a controller responsible for managing the presentation of an AWFCalloutView instance on a map.

  • The callout view for map callout.

    Declaration

    Objective-C

    @property (nonatomic, readonly) AWFCalloutView *_Nonnull calloutView;

    Swift

    var calloutView: AWFCalloutView { get }
  • The map strategy for the map callout.

    Declaration

    Objective-C

    @property (nonatomic, weak, readonly) id<AWFMapStrategy> _Nullable strategy;
  • The receiver’s data source.

    A map callout controller requests information from its data source that is specific to the map strategy currently being used by a weather map.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id<AWFMapCalloutDataSource> dataSource;

    Swift

    weak var dataSource: AWFMapCalloutDataSource? { get set }
  • The receiver’s delegate.

    A map callout controller informs its delegate about events regarding its associated map annotation and interactions with callout accessory views.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id<AWFMapCalloutDelegate> delegate;

    Swift

    weak var delegate: AWFMapCalloutDelegate? { get set }
  • The map annotation object currently associated with the callout.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) id<AWFAnnotation> currentAnnotationForCallout;

    Swift

    var currentAnnotationForCallout: AWFAnnotation? { get }
  • The callout information view currently being used.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) AWFMapCalloutInfo *_Nonnull currentCalloutInfo;

    Swift

    var currentCalloutInfo: AWFMapCalloutInfo { get }
  • Instantiates a map callout controller associated with the specified map strategy.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithMapStrategy:
        (nonnull id<AWFMapStrategy>)mapStrategy;

    Parameters

    mapStrategy

    The map strategy to associate this callout with

    Return Value

    A map callout instance initialized with the map strategy.

  • Presents the map callout from the annotation using the specified title and subtitle.

    Declaration

    Objective-C

    - (void)showFromAnnotation:(nonnull id)annotation
                     withTitle:(nonnull NSString *)title
                      subtitle:(nullable NSString *)subtitle;

    Swift

    func show(fromAnnotation annotation: Any, withTitle title: String, subtitle: String?)

    Parameters

    annotation

    The annotation from which to present the callout.

    title

    The primary textual content.

    subtitle

    The secondary textual content. If not provided, the title will only be displayed.

  • Presents the map callout from the annotation using the specified contentView.

    Declaration

    Objective-C

    - (void)showFromAnnotation:(nonnull id)annotation
               withContentView:(nonnull UIView *)contentView;

    Swift

    func show(fromAnnotation annotation: Any, withContentView contentView: UIView)

    Parameters

    annotation

    The annotation from which to present the callout.

    contentView

    The view to display within the callout.

  • Presents the map callout from the coordinate using the specified title and subtitle.

    Declaration

    Objective-C

    - (void)showAtCoordinate:(CLLocationCoordinate2D)coordinate
                   withTitle:(nonnull NSString *)title
                    subtitle:(nullable NSString *)subtitle;

    Swift

    func show(at coordinate: CLLocationCoordinate2D, withTitle title: String, subtitle: String?)

    Parameters

    coordinate

    The map coordinate from which to present the callout.

    title

    The primary textual content.

    subtitle

    The secondary textual content. If not provided, the title will only be displayed.

  • Presents the map callout from the coordinate using with specified title and subtitle and optional accessory views.

    Declaration

    Objective-C

    - (void)showAtCoordinate:(CLLocationCoordinate2D)coordinate
                   withTitle:(nonnull NSString *)title
                    subtitle:(nullable NSString *)subtitle
           leftAccessoryView:(nullable UIView *)leftAccessoryView
          rightAccessoryView:(nullable UIView *)rightAccessoryView;

    Swift

    func show(at coordinate: CLLocationCoordinate2D, withTitle title: String, subtitle: String?, leftAccessoryView: UIView?, rightAccessoryView: UIView?)

    Parameters

    coordinate

    The map coordinate from which to present the callout

    title

    The callout title

    subtitle

    The callout subtitle. If not provided, the title will only be displayed

    leftAccessoryView

    The view to display to the left of the title

    rightAccessoryView

    The view to display to the right of the title

  • Presents the map callout from the coordinate using the specified contentView.

    Declaration

    Objective-C

    - (void)showAtCoordinate:(CLLocationCoordinate2D)coordinate
             withContentView:(nonnull UIView *)contentView;

    Swift

    func show(at coordinate: CLLocationCoordinate2D, withContentView contentView: UIView)

    Parameters

    coordinate

    The map coordinate from which to present the callout.

    contentView

    The view to display within the callout.

  • Presents the map callout from the coordinate using the specified contentView and optional accessory views.

    Declaration

    Objective-C

    - (void)showAtCoordinate:(CLLocationCoordinate2D)coordinate
             withContentView:(nonnull UIView *)contentView
           leftAccessoryView:(nullable UIView *)leftAccessoryView
          rightAccessoryView:(nullable UIView *)rightAccessoryView;

    Swift

    func show(at coordinate: CLLocationCoordinate2D, withContentView contentView: UIView, leftAccessoryView: UIView?, rightAccessoryView: UIView?)

    Parameters

    coordinate

    The map coordinate from which to present the callout

    contentView

    The view to display within the callout

    leftAccessoryView

    The view to display to the left of the content view

    rightAccessoryView

    The view to display to the right of the content view

  • Presents the map callout from the specified rect within the target view and constrained to the bounds of the specified constrainedView.

    Declaration

    Objective-C

    - (void)showFromRect:(CGRect)rect
                   inView:(nonnull UIView *)view
        constrainedToView:(nonnull UIView *)constrainedView
                 animated:(BOOL)animated;

    Swift

    func show(from rect: CGRect, in view: UIView, constrainedTo constrainedView: UIView, animated: Bool)

    Parameters

    rect

    The bounds within the view coordinate space from which to present the callout

    view

    The target view whose coordinate space is being used

    constrainedView

    The view to constrain the callout within, meaning the callout will not appear outside the bounds of this view.

    animated

    Whether or not to animation the presentation.

  • Presents the map callout from the specified rect within the target view and constrained to the bounds of the specified constrainedView.

    Declaration

    Objective-C

    - (void)showFromView:(nonnull UIView *)fromView
                   inView:(nonnull UIView *)view
        constrainedToView:(nonnull UIView *)constrainedView
                 animated:(BOOL)animated;

    Swift

    func show(from fromView: UIView, in view: UIView, constrainedTo constrainedView: UIView, animated: Bool)

    Parameters

    fromView

    The view whose bounds are within the view coordinate space from which to present the callout

    view

    The target view whose coordinate space is being used

    constrainedView

    The view to constrain the callout within, meaning the callout will not appear outside the bounds of this view.

    animated

    Whether or not to animation the presentation.

  • Dismisses the active callout, if any, from the map.

    Declaration

    Objective-C

    - (void)dismiss:(BOOL)animated;

    Swift

    func dismiss(_ animated: Bool)