Skip to content
James Barrow edited this page Jan 29, 2017 · 4 revisions

MapViewController

The map view controller is made to contain a map view and map controller and allow them to be presnted as a view controller.

mapController

The map controller related to the map view controller.

Declaration

Swift

@IBOutlet public weak var mapController: MapController!

---

<br>

### locationButton
Dictates if the location button should be shown.

**Declaration**
> <sub>**Swift**</sub>  
> ```swift  
@IBInspectable public var locationButton: Bool = true


searchButton

Dictates if the search button should be shown. Note: Search is only available on iOS 8+.

Declaration

Swift

@IBInspectable public var searchButton: Bool = true

---

<br>

### searchController
The search controller for using in iOS 8+ projects.

**Declaration**
> <sub>**Swift**</sub>  
> ```swift  
public var searchController: UISearchController!


activeLocationIcon

Overridden by a subclass to define the icon to use in thenavgation bar button item when the locationButton is active. Both this and the inactiveLocationIcon need to be overriden for the default icon to be overridden.

Declaration

Swift

open var activeLocationIcon: UIImage?

---

<br>

### inactiveLocationIcon
Overridden by a subclass to define the icon to use in thenavgation bar button item when the locationButton is inactive. Both this and the activeLocationIcon need to be overriden for the default icon to be overridden.

**Declaration**
> <sub>**Swift**</sub>  
> ```swift  
open var inactiveLocationIcon: UIImage?


zoomedToShowAll

Declaration

Swift

private var zoomedToShowAll = false

---

<br>

### shouldZoomToShowAllOnViewDidAppear
Ditermines if the map view should zoom to show all on the first view did appear.

**Declaration**
> <sub>**Swift**</sub>  
> ```swift  
@IBInspectable public var shouldZoomToShowAllOnViewDidAppear: Bool = true


searchScopeButtonTitles

Overridden by a subclass to define actual scope titles for the search bar. If an empty array is returned then the scope selector is not shown. By default this is set to Markers and Locations.

Declaration

Swift

open var searchScopeButtonTitles: [String]

---

<br>

### showsSearchScopeBar


**Declaration**
> <sub>**Swift**</sub>  
> ```swift  
@IBInspectable public var showsSearchScopeBar: Bool = true


searchTableViewController

Declaration

Swift

public var searchTableViewController: MapSearchViewController?

---

<br>

### viewDidLoad()


**Declaration**
> <sub>**Swift**</sub>  
> ```swift  
open override func viewDidLoad()


viewDidAppear(_:)

Declaration

Swift

open override func viewDidAppear(_ animated: Bool)


---


<br>
## Update Methods  <br>

### updateNavigationButtons(animated:)
Updates the navigation bar buttons.

**Declaration**
> <sub>**Swift**</sub>  
> ```swift  
public func updateNavigationButtons(animated: Bool = true)

Parameters

`animated` If the buttons should animate when they update.


updateAddresses()

Update objects to be plotted on the map. This method is to be overriden by a subclass to specify the specific methods to call new objects from the server.

Declaration

Swift

open func updateAddresses()


---


<br>
## Action Methods  <br>

### locationButtonPressed(_:)
Show the options for the map view controller when the location button is pressed.

**Declaration**
> <sub>**Swift**</sub>  
> ```swift  
@IBAction open func locationButtonPressed(_ sender: UIBarButtonItem)

Parameters

`sender` The location button pressed.


searchButtonPressed(_:)

Shows the map search view controller.

Declaration

Swift

@IBAction open func searchButtonPressed(_ sender: UIBarButtonItem)


**Parameters**
<table>
<tr><td> `sender` </td><td> The search button pressed. </td></tr>
<table>

---

<div class="footer" align="center"><sub>Built with <a href="https://github.com/Baza207/LittleHedgehogDocs" target="_blank">Little Hedgehog Docs</a> by <a href="mailto:james@pigonahill.com" target="_blank">James Barrow</a> - <a href="http://pigonahill.com" target="_blank">Pig on a Hill Productions</a>.</sub></div>

Clone this wiki locally