AWFLegendView
Objective-C
@interface AWFLegendView : UIView
Swift
class AWFLegendView : UIView
AWFLegendView is a container view used for managing and displaying multiple AWFLegendItemView instances for a weather map.
-
An array of
AWFLegendItemViewinstances currently displayed.Declaration
Objective-C
@property (nonatomic, strong, readonly) NSArray<AWFLegendItemView *> *legends;Swift
var legends: [AWFLegendItemView]! { get } -
The text style to apply to the legend row title labels.
Declaration
Objective-C
@property (nonatomic, strong) AWFTextStyleSpec *titleTextStyle -
The text style to apply to the legends, which controls legend value labels and titles.
Declaration
Objective-C
@property (nonatomic, strong) AWFTextStyleSpec *legendTextStyle -
A Boolean value indicating whether the legend view should display the legends with Metric values when applicable.
Declaration
Objective-C
@property (nonatomic, getter=isMetric) BOOL metric;Swift
var isMetric: Bool { get set } -
The padding to use around the legend views relative to the view’s bounds.
Declaration
Objective-C
@property (nonatomic) UIEdgeInsets contentEdgeInsets;Swift
var contentEdgeInsets: UIEdgeInsets { get set } -
The outer margins for the container view.
Declaration
Objective-C
@property (nonatomic) UIEdgeInsets outerEdgeInsets;Swift
var outerEdgeInsets: UIEdgeInsets { get set } -
The position orientation of the view relative to its superview, which controls where the expand/collapse button and indicator are positioned.
Declaration
Objective-C
@property (nonatomic) AWFWeatherMapLegendPosition position;Swift
var position: AWFWeatherMapLegendPosition { get set } -
The button used to toggle the view’s visibility and expand/collapse state.
Declaration
Objective-C
@property (nonatomic, strong, readonly) UIButton *toggleButton;Swift
var toggleButton: UIButton! { get } -
A Boolean value indicating whether the view should show the close arrow indicator on the
toggleButton. Default isYES.Declaration
Objective-C
@property (nonatomic) BOOL showsCloseIndicator;Swift
var showsCloseIndicator: Bool { get set } -
A Boolean value indicating whether the view is currently shown/expanded or hidden/collapsed.
Use
show:animated:to set the expanded/collapsed state.Declaration
Objective-C
@property (nonatomic, readonly, getter=isExpanded) BOOL expanded;Swift
var isExpanded: Bool { get } -
Initializes and returns a newly allocated
AWFWeatherMapLegendViewassociated with the specified weather map’sconfig.Declaration
Objective-C
- (instancetype)initWithMapStyle:(AWFWeatherMapStyle *)style frame:(CGRect)frame;Swift
init!(mapStyle style: AWFWeatherMapStyle!, frame: CGRect)Parameters
styleThe weather map style
frameThe initial frame for the view
Return Value
An initialized
AWFWeatherMapLegendView, ornilif one couldn’t be created -
Adds an legend view for the specified layer type.
Declaration
Objective-C
- (void)addLegendForLayerType:(AWFMapLayer)layerType;Swift
func addLegend(forLayerType layerType: AWFMapLayer!)Parameters
layerTypeThe layer type code to add a legend for
-
Removes the legend view for the specified layer type.
Declaration
Objective-C
- (void)removeLegendForLayerType:(AWFMapLayer)layerType;Swift
func removeLegend(forLayerType layerType: AWFMapLayer!)Parameters
layerTypeThe layer type code to remove the legend for
-
A Boolean value indicating whether a legend is currently displayed for the specified layer type.
Declaration
Objective-C
- (BOOL)hasLegendForLayerType:(AWFMapLayer)layerType;Swift
func hasLegend(forLayerType layerType: AWFMapLayer!) -> BoolParameters
layerTypeThe layer type code to check
Return Value
YESif the legend exists, otherwiseNO. -
Shows or hides the view, which is either expanded or collapsed respectively.
Use
expandedto get the current shown/hidden state.Declaration
Objective-C
- (void)show:(BOOL)show animated:(BOOL)animated;Swift
func show(_ show: Bool, animated: Bool)Parameters
showA Boolean indiciating whether to show the view
animatedA Boolean indicating whether the action should be animated
-
Tells the legend view to update any legend item views that require updating when a map’s coordinate bounds have changed, such as updating an advisories legend to only show active advisories within a specific region.
Declaration
Objective-C
- (void)updateItemsForMapBoundsIfNeeded:(AWFMapCoordinateBounds *)bounds;Swift
func updateItems(forMapBoundsIfNeeded bounds: AWFMapCoordinateBounds!)Parameters
boundsThe coordinate bounds to use when updating.
View on GitHub
AWFLegendView Class Reference