polish code

This commit is contained in:
Bob Sun 2017-02-09 15:58:32 +08:00
parent c76f1c24b0
commit 95de38988b
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
2 changed files with 4 additions and 4 deletions

View file

@ -7,6 +7,7 @@
// //
import UIKit import UIKit
import SafariServices
class OpenSourceComponentsTableViewController: BasicStaticTableViewController { class OpenSourceComponentsTableViewController: BasicStaticTableViewController {
let openSourceComponents = [ let openSourceComponents = [
@ -43,7 +44,8 @@ class OpenSourceComponentsTableViewController: BasicStaticTableViewController {
func actOnDetailDisclosureButton(_ sender: Any?) { func actOnDetailDisclosureButton(_ sender: Any?) {
if let link = sender as? String { if let link = sender as? String {
UIApplication.shared.open(URL(string: link)!, options: [:], completionHandler: nil) let svc = SFSafariViewController(url: URL(string: link)!, entersReaderIfAvailable: false)
self.present(svc, animated: true, completion: nil)
} }
} }

View file

@ -42,9 +42,7 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
tableView.register(UINib(nibName: "LabelTableViewCell", bundle: nil), forCellReuseIdentifier: "labelCell") tableView.register(UINib(nibName: "LabelTableViewCell", bundle: nil), forCellReuseIdentifier: "labelCell")
tableView.register(UINib(nibName: "PasswordDetailTitleTableViewCell", bundle: nil), forCellReuseIdentifier: "passwordDetailTitleTableViewCell") tableView.register(UINib(nibName: "PasswordDetailTitleTableViewCell", bundle: nil), forCellReuseIdentifier: "passwordDetailTitleTableViewCell")
let passwordCategoryArray = passwordCategoryEntities?.map({ (value: PasswordCategoryEntity) -> String in let passwordCategoryArray = passwordCategoryEntities?.map { $0.category! }
value.category!
})
passwordCategoryText = (passwordCategoryArray?.joined(separator: " > "))! passwordCategoryText = (passwordCategoryArray?.joined(separator: " > "))!
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(PasswordDetailTableViewController.tapMenu(recognizer:))) let tapGesture = UITapGestureRecognizer(target: self, action: #selector(PasswordDetailTableViewController.tapMenu(recognizer:)))