From fedea91087364e6499211b2d203547edb245a1e1 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sun, 3 Feb 2019 22:07:10 +0100 Subject: [PATCH] Add FAQ in About --- .../Scenes/Organizer/AboutViewController.swift | 16 +++++++++++++++- .../Resources/en.lproj/Localizable.strings | 1 + Passepartout/Sources/AppConstants.swift | 2 ++ Passepartout/Sources/SwiftGen+Strings.swift | 4 ++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Passepartout-iOS/Scenes/Organizer/AboutViewController.swift b/Passepartout-iOS/Scenes/Organizer/AboutViewController.swift index efeeca3b..67410fd6 100644 --- a/Passepartout-iOS/Scenes/Organizer/AboutViewController.swift +++ b/Passepartout-iOS/Scenes/Organizer/AboutViewController.swift @@ -39,7 +39,7 @@ class AboutViewController: UITableViewController, TableModelHost { model.setHeader(L10n.About.Sections.Share.header, for: .share) model.setHeader(L10n.About.Sections.Feedback.header, for: .feedback) model.set([.version], in: .info) - model.set([.website, .disclaimer, .privacyPolicy], in: .web) + model.set([.website, .faq, .disclaimer, .privacyPolicy], in: .web) model.set([.shareTwitter, .shareGeneric], in: .share) model.set([.joinCommunity, .writeReview], in: .feedback) return model @@ -72,6 +72,10 @@ class AboutViewController: UITableViewController, TableModelHost { UIApplication.shared.open(AppConstants.URLs.website, options: [:], completionHandler: nil) } + private func visitFAQ() { + UIApplication.shared.open(AppConstants.URLs.faq, options: [:], completionHandler: nil) + } + private func visitDisclaimer() { UIApplication.shared.open(AppConstants.URLs.disclaimer, options: [:], completionHandler: nil) } @@ -127,6 +131,8 @@ extension AboutViewController { case website + case faq + case disclaimer case privacyPolicy @@ -169,6 +175,11 @@ extension AboutViewController { cell.leftText = L10n.About.Cells.Website.caption return cell + case .faq: + let cell = Cells.setting.dequeue(from: tableView, for: indexPath) + cell.leftText = L10n.About.Cells.Faq.caption + return cell + case .disclaimer: let cell = Cells.setting.dequeue(from: tableView, for: indexPath) cell.leftText = L10n.About.Cells.Disclaimer.caption @@ -209,6 +220,9 @@ extension AboutViewController { case .website: visitWebsite() + case .faq: + visitFAQ() + case .disclaimer: visitDisclaimer() diff --git a/Passepartout/Resources/en.lproj/Localizable.strings b/Passepartout/Resources/en.lproj/Localizable.strings index 3d5d0f8a..e8e2f9d0 100644 --- a/Passepartout/Resources/en.lproj/Localizable.strings +++ b/Passepartout/Resources/en.lproj/Localizable.strings @@ -191,6 +191,7 @@ "about.sections.share.header" = "Share"; "about.sections.feedback.header" = "Feedback"; "about.cells.website.caption" = "Home page"; +"about.cells.faq.caption" = "FAQ"; "about.cells.disclaimer.caption" = "Disclaimer"; "about.cells.privacy_policy.caption" = "Privacy policy"; "about.cells.share_twitter.caption" = "Tweet about it!"; diff --git a/Passepartout/Sources/AppConstants.swift b/Passepartout/Sources/AppConstants.swift index 328214bd..1f486e32 100644 --- a/Passepartout/Sources/AppConstants.swift +++ b/Passepartout/Sources/AppConstants.swift @@ -122,6 +122,8 @@ class AppConstants { class URLs { static let website = URL(string: "https://\(Domain.name)")! + static let faq = website.appendingPathComponent("faq") + static let disclaimer = website.appendingPathComponent("disclaimer") static let privacyPolicy = website.appendingPathComponent("privacy") diff --git a/Passepartout/Sources/SwiftGen+Strings.swift b/Passepartout/Sources/SwiftGen+Strings.swift index 8e3584ee..576297b8 100644 --- a/Passepartout/Sources/SwiftGen+Strings.swift +++ b/Passepartout/Sources/SwiftGen+Strings.swift @@ -20,6 +20,10 @@ internal enum L10n { /// Disclaimer internal static let caption = L10n.tr("Localizable", "about.cells.disclaimer.caption") } + internal enum Faq { + /// FAQ + internal static let caption = L10n.tr("Localizable", "about.cells.faq.caption") + } internal enum JoinCommunity { /// Join community internal static let caption = L10n.tr("Localizable", "about.cells.join_community.caption")