Skip to content

Commit 0585e6e

Browse files
author
Emilio Pavia
authored
Merge pull request #26 from arduino/sensor-info
Hide whatsGoingOnLabel if not needed
2 parents 15becb6 + 10a69c3 commit 0585e6e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ScienceJournal/UI/LearnMoreViewController.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ class LearnMoreViewController: MaterialHeaderViewController {
102102
scrollView.addSubview(stackView)
103103
stackView.pinToEdgesOfView(scrollView)
104104
stackView.widthAnchor.constraint(equalTo: scrollView.widthAnchor).isActive = true
105+
106+
if sensor.learnMore == nil || sensor.learnMore!.isEmpty {
107+
whatsGoingOnLabel.isHidden = true
108+
}
105109
}
106110

107111
override func accessibilityPerformEscape() -> Bool {
@@ -116,3 +120,9 @@ class LearnMoreViewController: MaterialHeaderViewController {
116120
}
117121

118122
}
123+
124+
extension Sensor.LearnMore {
125+
var isEmpty: Bool {
126+
firstParagraph.isEmpty && secondParagraph.isEmpty && imageName.isEmpty
127+
}
128+
}

0 commit comments

Comments
 (0)