Skip to content

Commit

Permalink
Add leave a review button to about page
Browse files Browse the repository at this point in the history
  • Loading branch information
robbiet480 committed Nov 19, 2017
1 parent 8f76deb commit a60550b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions HomeAssistant/Resources/SwiftGen/Strings.swift
Expand Up @@ -65,6 +65,11 @@ enum L10n {
static let tagline = L10n.tr("Localizable", "about.logo.tagline")
}

enum Review {
/// Leave a review
static let title = L10n.tr("Localizable", "about.review.title")
}

enum Website {
/// Website
static let title = L10n.tr("Localizable", "about.website.title")
Expand Down
1 change: 1 addition & 0 deletions HomeAssistant/Resources/en.lproj/Localizable.strings
Expand Up @@ -95,6 +95,7 @@ send notifications to your device.";
"about.logo.app_title" = "Home Assistant for iOS";
"about.logo.tagline" = "Awaken Your Home";
"about.acknowledgements.title" = "Acknowledgements";
"about.review.title" = "Leave a review";
"about.website.title" = "Website";
"about.forums.title" = "Forums";
"about.chat.title" = "Chat";
Expand Down
11 changes: 11 additions & 0 deletions HomeAssistant/Views/AboutViewController.swift
Expand Up @@ -44,6 +44,17 @@ class AboutViewController: FormViewController {
_ = vc.navigationController?.popViewController(animated: true)
})
}
<<< ButtonRow {
$0.title = L10n.About.Review.title
}.cellUpdate { cell, _ in
cell.textLabel?.textAlignment = .left
cell.accessoryType = .disclosureIndicator
cell.editingAccessoryType = cell.accessoryType
cell.textLabel?.textColor = nil
}.onCellSelection({ _, _ in
let urlStr = "https://itunes.apple.com/app/id1099568401?action=write-review&mt=8"
UIApplication.shared.openURL(URL(string: urlStr)!)
})
+++ Section()
<<< ButtonRow {
$0.title = L10n.About.Website.title
Expand Down

0 comments on commit a60550b

Please sign in to comment.