Skip to content

Commit

Permalink
Merge pull request #321 from cocoaheadsru/hotfix/fix-small-issues
Browse files Browse the repository at this point in the history
Added small improvements
  • Loading branch information
smejl authored Nov 6, 2017
2 parents 271be36 + e13affc commit 7cf4cad
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
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

0 comments on commit 7cf4cad

Please sign in to comment.