Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added small improvements #321

Merged
merged 1 commit into from
Nov 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class RegistrationPreviewViewController: UIViewController, DisplayCollectionWith
didSet {
tableView.allowsMultipleSelection = true
let configuration = TableViewConfiguration(
bottomInset: 12 + BottomButton.constantHeight,
bottomInset: 16 + BottomButton.constantHeight,
bottomIndicatorInset: 8.0 + BottomButton.constantHeight,
estimatedRowHeight: 44)
tableView.configure(with: .custom(configuration))
Expand Down Expand Up @@ -207,11 +207,11 @@ extension RegistrationPreviewViewController: KeyboardHandlerDelegate {
let tableViewBottomContentInsets = info.endFrame.height + 15 + tableView.defaultBottomInset
tableView.contentInset.bottom = tableViewBottomContentInsets
tableView.scrollIndicatorInsets.bottom = info.endFrame.height + bottomButton.frame.height
buttonInsets = info.endFrame.height
buttonInsets = info.endFrame.height + 8
case .hidden:
tableView.contentInset.bottom = tableView.defaultBottomInset
tableView.scrollIndicatorInsets.bottom = BottomButton.constantHeight
buttonInsets = 0
buttonInsets = 8
}

bottomButton.bottomInsetsConstant = buttonInsets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ extension ProfileEditViewController: KeyboardHandlerDelegate {
let scrollViewBottomInset = info.endFrame.height + tableView.defaultBottomInset + bottomButton.frame.height
scrollViewContentInsets.bottom = scrollViewBottomInset
indicatorInsets.bottom = info.endFrame.height + bottomButton.frame.height
buttonInsets = info.endFrame.height
buttonInsets = info.endFrame.height + 8
case .hidden:
scrollViewContentInsets.bottom = 0
indicatorInsets.bottom = 0
buttonInsets = 0
buttonInsets = 8
}

tableView.contentInset = scrollViewContentInsets
Expand All @@ -140,13 +140,22 @@ extension ProfileEditViewController {
tableView.endEditing(true)
ProfileController.save { [weak self] success in
if success, let strongSelf = self {
let message = "Ваши прекрасные данные успешно обновлены.".localized
let notification = NotificationHelper.viewController(title: "Профиль изменён".localized,
description: "Ваши прекрасные данные успешно обновлены.".localized,
description: message,
emoji: "📋",
completion: {
strongSelf.navigationController?.popToRootViewController(animated: true)
})

self?.present(viewController: notification)
} else {
let message = "Мы всегда поможем решить вашу проблему, пишите в телеграм канал: @cocoaheads.".localized
let notification = NotificationHelper.viewController(title: "Что-то пошло не так".localized,
description: message,
emoji: "🔥",
completion: { })

self?.present(viewController: notification)
}
self?.dismissProgressHUD()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ extension GiveSpeechViewController: KeyboardHandlerDelegate {
let scrollViewBottomInset = info.endFrame.height + tableView.defaultBottomInset + bottomButton.frame.height
scrollViewContentInsets.bottom = scrollViewBottomInset
indicatorInsets.bottom = info.endFrame.height + bottomButton.frame.height
buttonInsets = info.endFrame.height
buttonInsets = info.endFrame.height + 8
case .hidden:
scrollViewContentInsets.bottom = 0
indicatorInsets.bottom = 0
buttonInsets = 0
buttonInsets = 8.0
}

tableView.contentInset = scrollViewContentInsets
Expand Down