FUIMapDetailPanel
@MainActor
open class FUIMapDetailPanel : UIView
A View Component that wraps the FUIMapDetailPanelSearchResultsViewController as the searchResultsController and the FUIMapDetailPanelContentViewController as the content. Switching between the two view controllers should be driven by the pushChildViewController and popChildViewController methods in the developer’s mapView(_:didSelect:) and mapView(_:didDeselect:) methods.
## iPhone
The searchResults and content will be presented on cards that can be swipe and panned to a bottom, middle, or top position.
## iPad
The view is placed in the top left corner of the iPad and will dynamically resize based on the preferredContentSize. The view is pinned to the given pinMapView and will resize accordingly. The fitToContent method must be called when reloading the table view.
## Available:
passThroughViews: A[UIView]that contains the views that are interactable when the map legend is presented on iPad. This prevents the popover from being dismissed while interacting with views in this list (ex. aMKMapView).isApplyingBlurBackground: ABoolthat determines if the child views will have a blurred background.isSearchEnabled: A Boolean value to instantiate search.searchResults: AFUIMapDetailPanelSearchResultsViewControllerused for the search function. Manipulate itstableViewto show search results. The developer must set thedatasourceand delegate methods.content: AFUIMapDetailPanelContentViewControllerused for showing the details. The developer must set thedatasourceand delegate methods.
## Usage
container = FUIMapDetailPanel(parentViewController: self, mapView: mapView)
favoritesData = Array(sampleData[3..<sampleData.count])
container.isSearchEnabled = true
container.isApplyingBlurBackground = true
container.search.tableView.dataSource = searchResultsDataSource
container.search.tableView.delegate = searchResultsDelegate
container.search.tableView.register(FUIObjectTableViewCell.self, forCellReuseIdentifier: FUIObjectTableViewCell.reuseIdentifier)
container.search.searchBar.delegate = searchResultsDelegate
container.content.headlineText = "VA Palo Alto Health Care Sys wraps to two lines..."
container.content.didSelectTitleHandler = {
print("Developer Select Handler Called!")
}
container.content.subheadlineText = "Medical Center"
container.content.tableView.dataSource = contentDataSource
container.content.tableView.delegate = contentDelegate
container.content.tableView.register(FUIObjectTableViewCell.self, forCellReuseIdentifier: FUIObjectTableViewCell.reuseIdentifier)
container.content.tableView.estimatedRowHeight = 100
container.content.tableView.rowHeight = UITableView.automaticDimension
Manage presenting the controller on iPhone in viewDidAppear(_:).
DispatchQueue.main.async {
self.container!.presentContainer()
}
Manage dismissing the controller on iPhone in viewWillDisappear(_:)
self.presentedViewController?.dismiss(animated: false, completion: nil)
Present the detailPanel by managing selecting and deselecting map annotations in mapView(_:didSelect:) and mapView(_:didDeselect:)
open func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
let selectedAnnotation = view.annotation
if selectedAnnotation is MKUserLocation {
return
}
self.devUpdateDetailVC(annotation: selectedAnnotation!)
DispatchQueue.main.async {
container.pushChildViewController()
}
for annotation in mapView.annotations {
if let annotation = annotation as? MKAnnotation, !annotation.isEqual(selectedAnnotation) {
self.container.content.tableView.dataSource = newDataSource
self.container.fitToContent()
DispatchQueue.main.async {
self.container.pushChildViewController()
}
return
}
}
}
open func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) {
let selectedAnnotation = view.annotation
if selectedAnnotation is MKUserLocation {
return
}
DispatchQueue.main.async {
if self.mapView.selectedAnnotations.isEmpty {
self.container.popChildViewController()
} else {
self.container.content.tableView.dataSource = newDataSource
self.container.fitToContent()
self.container.content.tableView.reloadData()
}
}
}
-
An array of UIView that wraps the views that are interactable when map legend is presented on iPad.
Declaration
Swift
@MainActor public var passThroughViews: [UIView] { get } -
A Boolean that determines if the child views will have a blurred background
Declaration
Swift
@MainActor public var isApplyingBlurBackground: Bool { get set } -
A Boolean value to instantiate search
Declaration
Swift
@MainActor public var isSearchEnabled: Bool { get set } -
An optional closure function used by developer to define preparations before content is pushed to detail panel
Declaration
Swift
@MainActor public var prepareForPushChildViewController: ((FUIMapDetailPanelContentViewController) -> Void)? -
An optional closure function used by developer to define preparations before content is popped from detail panel
Declaration
Swift
@MainActor public var prepareForPopChildViewController: ((FUIMapDetailPanelContentViewController) -> Void)? -
A
FUIMapDetailPanelSearchResultsViewControllerused for the search function. It is up to the developer to set the datasource and delegate methods.Declaration
Swift
@MainActor public let searchResults: FUIMapDetailPanelSearchResultsViewController -
A
FUIMapDetailPanelContentViewControllerused to show a view controller with additional details. It is up to the developer to set the datasource and delegate methods.Declaration
Swift
@MainActor public let content: FUIMapDetailPanelContentViewController
-
An initializer to create a
FUIMapDetailPanel. It takes in aparentViewControllerto properly present the child view controller dependent on its platform.Declaration
Swift
@MainActor public init(parentViewController parent: UIViewController, mapView pinnedView: UIView? = nil)Parameters
parentA
UIViewControllerthat instantiated theFUIMapDetailPanelmapViewAn optional view reference, which will be used for pinning constraints for the detail panel container’s managed views. If
nil, theparentViewController.viewproperty is used.
-
A method to present the container onto the parent view controller. This method must be explicitly called in
viewDidAppear(_:)to show the container on iPhone.Declaration
Swift
@MainActor public func presentContainer() -
A method to resize the container that must be called when a childViewController is reloaded. A correct
preferredContentSizeis required to get the correct resizing.Declaration
Swift
@MainActor public func fitToContent() -
A method to present the contentViewContrller as a detail view within the device specific container.
Note
Implementing the correct
preferredContentSizewill allow for correct dynamic resizing. If a child view controller gets updated or reloaded, it is required to call thefitToContentmethod.Declaration
Swift
@MainActor public func pushChildViewController(completion: (() -> Void)? = nil, in position: FUICompactCardPosition? = nil)Parameters
completionAn optional closure function used by developer to define post processing behavior after content is pushed to detail panel.
inAn optional parameter defines the relative postiton that a detail view will be animated to. This will only take effect in compact mode, allowing changed to
.middleor.topposition. Defaults to.bottom. -
A method to pop the presented ChildView Controller.
Declaration
Swift
@MainActor public func popChildViewController(completion: (() -> Void)? = nil)Parameters
completionAn optional closure function used by developer to define post processing behavior after content is popped from detail panel.
-
The
FUIMapDetailPanel.ActionTableViewCellis aUITableViewCellconsisting of aUILabeland aUIImageView. This cell is intended to be used as a call to action in the map detail panel.Available:
actionTitleLabel: AUILabeldescribing the intended action.actionImageView: AUIImageViewthat will have an icon image and a tint color.
Initialization and Configuration:
Register the cell within the
viewDidLoadmethodself.tableView.register(FFUIMapDetailPanel.ActionTableViewCell.self, forCellReuseIdentifier: FUIMapDetailPanel.ActionTableViewCell.reuseIdentifier)Within the
tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath):let cell = tableView.dequeueReusableCell(withIdentifier: FUIMapDetailPanel.ActionTableViewCell.reuseIdentifier, for: indexPath) as! FUIMapDetailPanel.ActionTableViewCell cell.actionTitleLabel.text = "Add Notification" cell.actionImageView.image = FUIIconLibrary.system.create.withRenderingMode(.alwaysTemplate) return celltheming:
See morefdlFUIMapDetailActionTableViewCell_actionTitleLabel { font-style: body; font-color: @tintColorDark; } fdlFUIMapDetailActionTableViewCell_actionImageView { tint-color: @primary5; }Declaration
Swift
@IBDesignable @MainActor open class ActionTableViewCell : FUIBaseTableViewCell, FUIBackgroundSchemeSupporting -
The
FUIMapDetailButtonTableViewCellis aUITableViewCellconsisting of aFUIButtonand aFUILabelwithin a verticalUIStackView.Available:
button: AnFUIButtonwith access to custom headline text and subheadline text.buttonHeadlineText: AStringto describe the main function of the buttonbuttonSubheadlineText: AStringto add additional details to thebuttonHeadlineTextdescriptionLabel: AnFUILabelused as a description beneath thebutton. The label can wrap up to 2 lines.
Initialization and Configuration:
Register the cell within the
viewDidLoadmethodself.tableView.register(FUIMapDetailButtonTableViewCell.self, forCellReuseIdentifier: FUIMapDetailButtonTableViewCell.reuseIdentifier)Within the
tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath):let cell = tableView.dequeueReusableCell(withIdentifier: FUIMapDetailButtonTableViewCell.reuseIdentifier, for: indexPath) as! FUIMapDetailButtonTableViewCell cell.button.titleLabel?.numberOfLines = 0 cell.buttonHeadlineText = "Directions" cell.buttonSubheadlineText = "22 minute drive" cell.button.backgroundColor = UIColor.preferredFioriColor(forStyle: .tintColor) cell.descriptionLabel.text = "ABC Drive, Cupertino, CA" return celltheming
See morefdlFUIMapDetailButtonTableViewCell_button { font-name: semiboldSystem; font-size: 13; font-color: @primary1; background-color-normal: @tintColorDark; background-color-highlighted: @tintColorTapStateDark; } fdlFUIMapDetailButtonTableViewCell_descriptionLabel { font-style: footnote; font-color: @primary1; }Declaration
Swift
@MainActor open class ButtonTableViewCell : UITableViewCell -
UITableViewCellsubclass used for displaying business object status in Map Floorplan Detail Panel.Supports optional image & text. Images are left aligned and placed to the left of the text. Images are expected to be 16px by 16px.
Usage
let cell = tableView.dequeueReusableCell(withIdentifier: FUIMapDetailPanel.StatusTableViewCell.reuseIdentifier, for: indexPath) as! FUIMapDetailPanel.StatusTableViewCell cell.statusImage = FUIIconLibrary.indicator.veryHighPriority cell.status.text = “High”
Theming
nuiClass:fdlFUIMapDetailPanel.StatusTableViewCell {} fdlFUIMapDetailStatusTableViewCell {} // deprecatedSupported
TEXTclass paths:fdlFUIMapDetailPanel.StatusTableViewCell_status {} fdlFUIMapDetailStatusTableViewCell_status {} // deprecatedSupported
TEXTproperties:font-color: Color; font-style: UIFontTextStyle; text-line-clamp: Integer; text-align: NSTextAlignment;Supported
IMAGEclass paths:fdlFUIMapDetailPanel.StatusTableViewCell_statusImage {} fdlFUIMapDetailStatusTableViewCell_statusImage {} // deprecatedSupported
IMAGEproperties:
See moretint-color: Color;Declaration
Swift
@IBDesignable @MainActor open class StatusTableViewCell : FUIBaseDrawingTableViewCell<FUIMapDetailStatusView>