-
-
Notifications
You must be signed in to change notification settings - Fork 721
/
DescriptionWelcomeContentsViewController.swift
36 lines (30 loc) 路 1.37 KB
/
DescriptionWelcomeContentsViewController.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
class DescriptionWelcomeContentsViewController: UIViewController, Themeable {
private var theme = Theme.standard
func apply(theme: Theme) {
self.theme = theme
guard viewIfLoaded != nil else {
return
}
descriptionLabel.textColor = theme.colors.primaryText
}
@IBOutlet private var descriptionLabel:UILabel!
var pageType:DescriptionWelcomePageType = .intro
override func viewDidLoad() {
super.viewDidLoad()
updateUIStrings()
apply(theme: theme)
view.wmf_configureSubviewsForDynamicType()
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
adjustTheme(previousTraitCollection)
}
private func updateUIStrings(){
switch pageType {
case .intro:
descriptionLabel?.text = WMFLocalizedString("description-welcome-descriptions-sub-title", value:"Summarizes an article to help readers understand the subject at a glance", comment:"Subtitle text explaining title descriptions")
case .exploration:
descriptionLabel?.text = WMFLocalizedString("description-welcome-concise-sub-title", value:"Ideally one line, between two to twelve words", comment:"Subtitle text explaining descriptions should be concise")
}
}
}