Skip to content

Commit f95c972

Browse files
committed
feat: show app version in Account tab and in support email body
1 parent 4c22145 commit f95c972

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

LockdowniOS/AccountVC.swift

+16
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,23 @@ final class AccountViewController: BaseViewController, Loadable {
355355
}
356356
})
357357
tableView.addCell(fixVPNConfig)
358+
359+
let inspect = DefaultCell(title: "_Enable VPN", height: buttonHeight, dismissOnTap: true) {
360+
VPNController.shared.setEnabled(true)
361+
}
362+
tableView.addCell(inspect)
358363
#endif
364+
365+
tableView.addRowCell { (cell) in
366+
cell.textLabel?.text = Bundle.main.versionString
367+
cell.textLabel?.font = fontSemiBold17
368+
cell.textLabel?.textColor = UIColor.systemGray
369+
cell.textLabel?.textAlignment = .right
370+
371+
// removing the bottom separator
372+
cell.separatorInset = .init(top: 0, left: 0, bottom: 0, right: .greatestFiniteMagnitude)
373+
cell.directionalLayoutMargins = .zero
374+
}
359375
}
360376

361377
func startTutorial() {

LockdowniOS/BaseViewController.swift

+1
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ open class BaseViewController: UIViewController, MFMailComposeViewControllerDele
299299
if messageErrorBody != "" {
300300
message = messageBody + "\n\nError Details: " + messageErrorBody
301301
}
302+
message += "\n\n\n \(Bundle.main.versionString)"
302303
composeVC.setMessageBody(message, isHTML: false)
303304
let attachmentData = NSMutableData()
304305
for logFileData in logFileDataArray {

LockdowniOS/UIKit+Extensions.swift

+6
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ extension UIDevice {
1414
return UIScreen.main.nativeBounds.height == 1136
1515
}
1616
}
17+
18+
extension Bundle {
19+
var versionString: String {
20+
return "v" + (infoDictionary?["CFBundleShortVersionString"] as? String ?? "")
21+
}
22+
}

Shared.swift

+1
Original file line numberDiff line numberDiff line change
@@ -282,5 +282,6 @@ let fontMedium16 = UIFont(name: "Montserrat-Medium", size: 16)!
282282
let fontMedium18 = UIFont(name: "Montserrat-Medium", size: 18.0)!
283283
let fontSemiBold15_5 = UIFont(name: "Montserrat-SemiBold", size: 15.5)!
284284
let fontSemiBold17 = UIFont(name: "Montserrat-SemiBold", size: 17)!
285+
let fontBold11 = UIFont(name: "Montserrat-Bold", size: 11)!
285286
let fontBold15 = UIFont(name: "Montserrat-Bold", size: 15)!
286287
let fontBold18 = UIFont(name: "Montserrat-Bold", size: 18)!

0 commit comments

Comments
 (0)