FUIMapDetailPanel
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 tableView.
## 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
: ABool
that determines if the child views will have a blurred background.isSearchEnabled
: A Boolean value to instantiate search.searchResults
: AFUIMapDetailPanelSearchResultsViewController
used for the search function. Manipulate itstableView
to show search results. The developer must set the datasource and delegate methods.content
: AFUIMapDetailPanelContentViewController
used for showing the details. The developer must set the datasource and 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
#if swift(>=4.2)
container.content.tableView.rowHeight = UITableView.automaticDimension
#else
container.content.tableView.rowHeight= UITableViewAutomaticDimension
#endif
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
public var passThroughViews: [UIView] { get }
-
A Boolean that determines if the child views will have a blurred background
Declaration
Swift
public var isApplyingBlurBackground: Bool { get set }
-
A Boolean value to instantiate search
Declaration
Swift
public var isSearchEnabled: Bool { get set }
-
A
FUIMapDetailPanelSearchResultsViewController
used for the search function. It is up to the devleoper to set the datasource and delegate methods.Declaration
Swift
public let searchResults: FUIMapDetailPanelSearchResultsViewController
-
A
FUIMapDetailPanelContentViewController
used to show a view controller with additional details. It is up to the devleoper to set the datasource and delegate methods.Declaration
Swift
public let content: FUIMapDetailPanelContentViewController
-
An initializer to create a
FUIMapDetailPanel
. It takes in aparentViewController
to properly present the child view controller dependent on its platform.Declaration
Swift
public init(parentViewController parent: UIViewController, mapView pinnedView: UIView? = nil)
Parameters
parent
A
UIViewController
that instantiated theFUIMapDetailPanel
mapView
An optional view reference, which will be used for pinning constraints for the detail panel container’s managed views. If
nil
, theparentViewController.view
property 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
public func presentContainer()
-
A method to resize the container that must be called when a childViewController is reloaded. A correct
preferredContentSize
is required to get the correct resizing.Declaration
Swift
public func fitToContent()
-
A method to present the contentViewContrller as a detail view within the device specific container.
Note
Implementing the correct
preferredContentSize
will allow for correct dynamic resizing. If a child view controller gets updated or reloaded, it is required to call thefitToContent
method.Declaration
Swift
public func pushChildViewController()
-
A method to pop the presented ChildView Controller.
Declaration
Swift
public func popChildViewController()
-
The
FUIMapDetailPanel.ActionTableViewCell
is aUITableViewCell
consisting of aUILabel
and aUIImageView
. This cell is intended to be used as a call to action in the map detail panel.Available:
actionTitleLabel
: AUILabel
describing the intended action.actionImageView
: AUIImageView
that will have an icon image and a tint color.
Initialization and Configuration:
Register the cell within the
viewDidLoad
methodself.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 cell
theming:
See morefdlFUIMapDetailActionTableViewCell_actionTitleLabel { font-style: body; font-color: @tintColorDark; } fdlFUIMapDetailActionTableViewCell_actionImageView { tint-color: @primary5; }
Declaration
Swift
@IBDesignable open class ActionTableViewCell : FUIBaseTableViewCell, FUIBackgroundSchemeSupporting
-
The
FUIMapDetailButtonTableViewCell
is aUITableViewCell
consisting of aFUIButton
and aFUILabel
within a verticalUIStackView
.Available:
button
: AnFUIButton
with access to custom headline text and subheadline text.buttonHeadlineText
: AString
to describe the main function of the buttonbuttonSubheadlineText
: AString
to add additional details to thebuttonHeadlineText
descriptionLabel
: AnFUILabel
used as a description beneath thebutton
. The label can wrap up to 2 lines.
Initialization and Configuration:
Register the cell within the
viewDidLoad
methodself.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 cell
theming
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
open class ButtonTableViewCell : UITableViewCell
-
UITableViewCell
subclass 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 {} // deprecated
Supported
TEXT
class paths:fdlFUIMapDetailPanel.StatusTableViewCell_status {} fdlFUIMapDetailStatusTableViewCell_status {} // deprecated
Supported
TEXT
properties:font-color: Color; font-style: UIFontTextStyle; text-line-clamp: Integer; text-align: NSTextAlignment;
Supported
IMAGE
class paths:fdlFUIMapDetailPanel.StatusTableViewCell_statusImage {} fdlFUIMapDetailStatusTableViewCell_statusImage {} // deprecated
Supported
IMAGE
properties:
See moretint-color: Color;
Declaration
Swift
@IBDesignable open class StatusTableViewCell : FUIBaseDrawingTableViewCell<FUIMapDetailStatusView>