AWFMapOptionsViewController

Objective-C

@interface AWFMapOptionsViewController : UIViewController

Swift

class AWFMapOptionsViewController : UIViewController

An AWFMapOptionsViewController object displays and manages the options available for an AWFWeatherMap instance, such as toggling the visibility of weather data layers, adjusting the timeline range or changing the forecast model used for future data layers.

An AWFMapOptionsViewController instance can be customized by changing the array of sections that are displayed, overriding configureCell:forRow:atIndexPath: to customize the configuration of table view cells and setting the cellIdentifier on each row’s associated AWFTableViewSectionRow instance.

  • An array of AWFTableSection instances that correspond to the table view sections. Each item in each section must be an instance of AWFTableViewSectionRow.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSArray<AWFTableSection *> *sections;

    Swift

    var sections: [AWFTableSection]? { get set }
  • The table view used to display the map options.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UITableView *_Nonnull tableView;

    Swift

    var tableView: UITableView { get }
  • The weather map instance associated with the map options.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) AWFWeatherMap *weatherMap;

    Swift

    weak var weatherMap: AWFWeatherMap? { get set }
  • Determines whether the legend should display metric label values.

    Declaration

    Objective-C

    @property (nonatomic, getter=isMetric) BOOL metric;

    Swift

    var isMetric: Bool { get set }
  • Whether or not changes to the map options should be applied to the weatherMap immediately, or if they should only be applied when the view controller is dismissed. The default is YES, meaning map updates will only be applied upon dismissal.

    Setting this to NO is useful when this options controller is displayed at the same time as the weather map, such as an iPad split view controller or popover.

    Declaration

    Objective-C

    @property (nonatomic) BOOL shouldDeferUpdatingWeatherMapOnDismissal;

    Swift

    var shouldDeferUpdatingWeatherMapOnDismissal: Bool { get set }
  • A Boolean value that determines if multiple layer options can be selected at once. Default value is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL allowsMultipleSelection;

    Swift

    var allowsMultipleSelection: Bool { get set }
  • Initializes and returns an options controller that is associated with a specific weatherMap.

    The options controller will be setup with the default map options and sections. To customize the options and sections displayed, assign a new array to the sections property.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithWeatherMap:(nullable AWFWeatherMap *)weatherMap;

    Swift

    init(weatherMap: AWFWeatherMap?)

    Parameters

    weatherMap

    The weather map instance this controller manages.

    Return Value

    An initialized options controller or nil if the object couldn’t be created.

  • Creates a new table section with the specified title by automatically generating the section rows for the specified layer types. This method generates a section used for toggling the appearance of map data layers on the weather map.

    Declaration

    Objective-C

    - (nonnull AWFTableSection *)sectionWithTitle:(nullable NSString *)title
                                       layerTypes:(nonnull NSArray<AWFMapLayer> *)
                                                      layerTypes;

    Swift

    func section(withTitle title: String?, layerTypes: [AWFMapLayer]) -> AWFTableSection

    Parameters

    title

    The title for the section

    layerTypes

    An array of AWFMapLayer values to create row options for

    Return Value

    A table section initialized with the specified title and layer types

  • Creates a new AWFTableSection with the specified title by automatically generating the section rows for the specified time intervals. This method generates a section that works with setting the map’s timeline start and end time offsets.

    Declaration

    Objective-C

    - (nonnull AWFTableSection *)
        sectionWithTitle:(nullable NSString *)title
           timeIntervals:(nonnull NSArray<NSNumber *> *)intervals
            rowFormatter:(nullable NSString *_Nonnull (^)(NSInteger))formatter;

    Swift

    func section(withTitle title: String?, timeIntervals intervals: [NSNumber], rowFormatter formatter: ((Int) -> String)? = nil) -> AWFTableSection

    Parameters

    title

    The title for the section

    intervals

    An array of intervals as integers to create row options for

    formatter

    A block used to format the row titles for the section

    Return Value

    A table section initialized with the specified title and time intervals

  • Assigns a AWFTableSection for the specified map option.

    Declaration

    Objective-C

    - (void)setSection:(nullable AWFTableSection *)section
          forMapOption:(AWFMapOption)mapOption;

    Swift

    func setSection(_ section: AWFTableSection?, for mapOption: AWFMapOption)

    Parameters

    section

    The section to use for the option

    mapOption

    The map option

  • Removes a section from the options menu by referencing the associated AWFMapOption value.

    Declaration

    Objective-C

    - (void)removeSectionForMapOption:(AWFMapOption)mapOption;

    Swift

    func removeSection(for mapOption: AWFMapOption)

    Parameters

    mapOption

    The map option value to remove the associated section for

  • Updates the list of weather layer sections and options in the menu.

    Declaration

    Objective-C

    - (void)setWeatherSections:(nonnull NSArray<AWFTableSection *> *)sections;

    Swift

    func setWeatherSections(_ sections: [AWFTableSection])

    Parameters

    sections

    An array of table sections that provide the list of weather options to display

  • Returns the AWFTableSection for the specified map option.

    Declaration

    Objective-C

    - (nullable AWFTableSection *)sectionForMapOption:(AWFMapOption)mapOption;

    Swift

    func section(for mapOption: AWFMapOption) -> AWFTableSection?

    Parameters

    mapOption

    The map option

    Return Value

    The table section associated with the map option or nil if the section doesn’t exist

  • Returns the AWFTableSection for the specified index.

    Declaration

    Objective-C

    - (nullable AWFTableSection *)sectionAtIndex:(NSInteger)index;

    Swift

    func section(at index: Int) -> AWFTableSection?
  • Returns the AWFTableSectionRow for the specified index path.

    Declaration

    Objective-C

    - (nullable AWFTableSectionRow *)rowAtIndexPath:
        (nonnull NSIndexPath *)indexPath;

    Swift

    func row(at indexPath: IndexPath) -> AWFTableSectionRow?
  • Called from tableView:cellForRowAtIndexPath: to setup the table view cell for the appropriate section and row. Override this method if you need to provide additional or alternative customization.

    Declaration

    Objective-C

    - (void)configureCell:(nonnull UITableViewCell *)cell
                   forRow:(nonnull AWFTableSectionRow *)row
              atIndexPath:(nonnull NSIndexPath *)indexPath;

    Swift

    func configureCell(_ cell: UITableViewCell, for row: AWFTableSectionRow, at indexPath: IndexPath)

    Parameters

    cell

    The table view cell being configured

    row

    The AWFTableSectionRow associated with the row

    indexPath

    The index path

  • Dismisses the options controller. If shouldDeferUpdatingWeatherMapOnDismissal is YES, then changes to the weather map will be applied when this method is called.

    Declaration

    Objective-C

    - (void)close;

    Swift

    func close()