/
Style.swift
66 lines (51 loc) · 1.96 KB
/
Style.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import UIKit
import MapboxMaps
/**
`Style` is a convenient wrapper for styling the appearance of various interface components throughout the Navigation UI.
Styles are applied globally using `UIAppearance`. You should call `Style.apply()` to apply the style to the `NavigationViewController`.
*/
@objc(MBStyle)
open class Style: NSObject {
// MARK: - General styling properties
/**
Sets the tint color for guidance arrow, highlighted text, progress bar and more.
*/
@objc public var tintColor: UIColor?
/**
Sets the status bar style.
`UIViewControllerBasedStatusBarAppearance` must be set to NO for this property to have any effect.
*/
public var statusBarStyle: UIStatusBarStyle?
/**
Sets the font family for all labels.
*/
@objc public var fontFamily: String?
/**
Describes the situations in which the style should be used. By default, the style will be used during the daytime.
*/
@objc public var styleType: StyleType = .day
/**
URL of the style to display on the map during turn-by-turn navigation.
*/
@objc open var mapStyleURL = URL(string: StyleURI.navigationDay.rawValue)!
/**
URL of the style to display on the map when previewing a route, for example on CarPlay or your own route preview map.
Defaults to same style as `mapStyleURL`.
*/
@objc open var previewMapStyleURL = URL(string: StyleURI.navigationDay.rawValue)!
var traitCollection: UITraitCollection = UITraitCollection(traitsFrom: [
UITraitCollection(userInterfaceIdiom: .phone),
UITraitCollection(userInterfaceIdiom: .pad),
])
class var defaultBorderWidth: CGFloat {
1 / UIScreen.main.scale
}
class var defaultCornerRadius: CGFloat {
10.0
}
/**
Applies the style for all changed properties.
*/
@objc open func apply() { }
@objc public required override init() { }
}