Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
make button text customizable
Browse files Browse the repository at this point in the history
  • Loading branch information
tgymnich committed Apr 19, 2021
1 parent a5a4169 commit 4ee2972
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion TUM Campus App/Message/MessageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,20 @@ final class MessageViewController: UIViewController {
private func setupUI() {
self.titleLabel.text = config.configValue(forKey: "sunset_message_title").stringValue
self.messageLabel.text = config.configValue(forKey: "sunset_message_text").stringValue
self.primaryButton.setTitle("Show in AppStore", for: .normal)
self.secondaryButton.setTitle("Hide", for: .normal)

if let primaryTitle = self.config.configValue(forKey: "primary_button_title").stringValue {
self.primaryButton.setTitle(primaryTitle, for: .normal)
} else {
self.primaryButton.setTitle("Show in AppStore", for: .normal)
}

if let secondaryTitle = self.config.configValue(forKey: "secondary_button_title").stringValue {
self.secondaryButton.setTitle(secondaryTitle, for: .normal)
} else {
self.secondaryButton.setTitle("Hide", for: .normal)
}

if self.config.configValue(forKey: "sunset_message_can_hide").boolValue {
self.secondaryButton.isHidden = false
self.secondaryButton.isEnabled = true
Expand Down

0 comments on commit 4ee2972

Please sign in to comment.