Skip to content

Commit

Permalink
made priority public, added inline doc for addNewStatus()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jill Cardamon committed Jan 20, 2021
1 parent 27d867a commit 7460c54
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion MapboxNavigation/StatusView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ public class StatusView: UIControl {
}

public struct Priority: RawRepresentable {
public typealias RawValue = Int

public var rawValue: Int

public init(rawValue: Int) {
self.rawValue = rawValue
}
// — Highest Priority —
// rerouting (rawValue = 0)
// enable precise location (rawValue = 1)
Expand Down Expand Up @@ -145,6 +151,9 @@ public class StatusView: UIControl {
hide(delay: duration, animated: animated)
}

/**
Adds a new status to statuses array.
*/
func addNewStatus(status: Status) {
guard let firstWord = status.id.components(separatedBy: " ").first else { return }
if let row = statuses.firstIndex(where: {$0.id.contains(firstWord)}) {
Expand All @@ -156,7 +165,7 @@ public class StatusView: UIControl {
}

/**
Manages showing and hiding Statuses and the status view.
Manages showing and hiding Statuses and the status view itself.
*/
func manageStatuses(status: Status? = nil) {
if statuses.isEmpty {
Expand Down

0 comments on commit 7460c54

Please sign in to comment.