Merge branch 'develop' of https://github.com/mssun/passforios into develop

This commit is contained in:
Yishi Lin 2017-10-08 21:38:53 +08:00
commit fad95208cc
12 changed files with 48 additions and 50 deletions

View file

@ -19,12 +19,6 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
private var shouldPopCurrentView = false
private let passwordStore = PasswordStore.shared
private let indicator: UIActivityIndicatorView = {
let indicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
indicator.center = CGPoint(x: UIScreen.main.bounds.width / 2, y: UIScreen.main.bounds.height * 0.382)
return indicator
}()
private lazy var editUIBarButtonItem: UIBarButtonItem = {
let uiBarButtonItem = UIBarButtonItem(barButtonSystemItem: .edit, target: self, action: #selector(pressEdit(_:)))
return uiBarButtonItem
@ -85,10 +79,11 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 52
indicator.startAnimating()
tableView.addSubview(indicator)
editUIBarButtonItem.isEnabled = false
navigationItem.rightBarButtonItem = editUIBarButtonItem
if #available(iOS 11.0, *) {
navigationItem.largeTitleDisplayMode = .never
}
if let imageData = passwordEntity?.image {
let image = UIImage(data: imageData as Data)
@ -174,7 +169,6 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
private func showPassword() {
DispatchQueue.main.async { [weak self] in
self?.indicator.stopAnimating()
self?.setTableData()
self?.tableView.reloadData()
self?.editUIBarButtonItem.isEnabled = true

View file

@ -75,6 +75,9 @@ class PasswordEditorTableViewController: UITableViewController, FillPasswordTabl
self.tableView.sectionFooterHeight = UITableViewAutomaticDimension;
self.tableView.estimatedSectionFooterHeight = 0;
}
override func viewDidLayoutSubviews() {
additionsCell?.contentTextView.setContentOffset(.zero, animated: false)
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cellData = tableData[indexPath.section][indexPath.row]

View file

@ -199,9 +199,6 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
} else {
searchController.searchBar.scopeButtonTitles = nil
}
if #available(iOS 11.0, *) {
navigationItem.hidesSearchBarWhenScrolling = true
}
}
override func viewDidLoad() {
@ -215,7 +212,7 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
navigationItem.searchController = searchController
navigationController?.navigationBar.prefersLargeTitles = true
navigationItem.largeTitleDisplayMode = .automatic
navigationItem.hidesSearchBarWhenScrolling = true
navigationItem.hidesSearchBarWhenScrolling = false
} else {
// Fallback on earlier versions
tableView.contentInset = UIEdgeInsetsMake(56, 0, 0, 0)
@ -240,9 +237,6 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
if let path = tableView.indexPathForSelectedRow {
tableView.deselectRow(at: path, animated: false)
}
if #available(iOS 11.0, *) {
navigationItem.hidesSearchBarWhenScrolling = false
}
}
override func viewWillLayoutSubviews() {