Use | operator to concatenate multiline strings
This commit is contained in:
parent
2fdd3fd6ec
commit
08c91599b6
5 changed files with 6 additions and 6 deletions
|
|
@ -357,7 +357,7 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
|
||||||
} catch {
|
} catch {
|
||||||
Utils.alert(title: "Error".localize(), message: error.localizedDescription, controller: self, completion: nil)
|
Utils.alert(title: "Error".localize(), message: error.localizedDescription, controller: self, completion: nil)
|
||||||
}
|
}
|
||||||
SVProgressHUD.showSuccess(withStatus: "PasswordCopied".localize() + "\n" + "CounterUpdated".localize())
|
SVProgressHUD.showSuccess(withStatus: "PasswordCopied".localize() | "CounterUpdated".localize())
|
||||||
SVProgressHUD.dismiss(withDelay: 1)
|
SVProgressHUD.dismiss(withDelay: 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,6 @@ class PasswordEditorTableViewController: UITableViewController, FillPasswordTabl
|
||||||
memorablePasswordGeneratorCell?.accessoryType = .disclosureIndicator
|
memorablePasswordGeneratorCell?.accessoryType = .disclosureIndicator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
if navigationItemTitle != nil {
|
if navigationItemTitle != nil {
|
||||||
|
|
|
||||||
|
|
@ -176,9 +176,9 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
|
||||||
let error = error as NSError
|
let error = error as NSError
|
||||||
var message = error.localizedDescription
|
var message = error.localizedDescription
|
||||||
if let underlyingError = error.userInfo[NSUnderlyingErrorKey] as? NSError {
|
if let underlyingError = error.userInfo[NSUnderlyingErrorKey] as? NSError {
|
||||||
message = "\(message)\n\("UnderlyingError".localize(underlyingError.localizedDescription))"
|
message = message | "UnderlyingError".localize(underlyingError.localizedDescription)
|
||||||
if underlyingError.localizedDescription.contains("WrongPassphrase".localize()) {
|
if underlyingError.localizedDescription.contains("WrongPassphrase".localize()) {
|
||||||
message = "\(message)\n\("RecoverySuggestion".localize())"
|
message = message | "RecoverySuggestion".localize()
|
||||||
gitCredential.delete()
|
gitCredential.delete()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import UIKit
|
||||||
import AVFoundation
|
import AVFoundation
|
||||||
import OneTimePassword
|
import OneTimePassword
|
||||||
import SVProgressHUD
|
import SVProgressHUD
|
||||||
|
import passKit
|
||||||
|
|
||||||
protocol QRScannerControllerDelegate {
|
protocol QRScannerControllerDelegate {
|
||||||
func checkScannedOutput(line: String) -> (accept: Bool, message: String)
|
func checkScannedOutput(line: String) -> (accept: Bool, message: String)
|
||||||
|
|
@ -130,7 +131,7 @@ class QRScannerController: UIViewController, AVCaptureMetadataOutputObjectsDeleg
|
||||||
|
|
||||||
func presentCameraSettings() {
|
func presentCameraSettings() {
|
||||||
let alertController = UIAlertController(title: "Error".localize(),
|
let alertController = UIAlertController(title: "Error".localize(),
|
||||||
message: "CameraAccessDenied.".localize() + "\n" + "WarningToggleCameraPermissionsResetsApp.".localize(),
|
message: "CameraAccessDenied.".localize() | "WarningToggleCameraPermissionsResetsApp.".localize(),
|
||||||
preferredStyle: .alert)
|
preferredStyle: .alert)
|
||||||
alertController.addAction(UIAlertAction(title: "Cancel".localize(), style: .default))
|
alertController.addAction(UIAlertAction(title: "Cancel".localize(), style: .default))
|
||||||
alertController.addAction(UIAlertAction(title: "Settings".localize(), style: .cancel) { _ in
|
alertController.addAction(UIAlertAction(title: "Settings".localize(), style: .cancel) { _ in
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ public extension String {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension String {
|
extension String {
|
||||||
static func | (left: String, right: String) -> String {
|
public static func | (left: String, right: String) -> String {
|
||||||
return right.isEmpty ? left : left + "\n" + right
|
return right.isEmpty ? left : left + "\n" + right
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue