Skip to content

Commit 760ed44

Browse files
Added localization of the word "Ready", added a terternary operator
1 parent 3dd81a3 commit 760ed44

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

ForPDA.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ForPDA/Resources/en.lproj/Localizable.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,4 @@
102102
"captcha.uploading.failed" = "Captcha uploading failed";
103103
"login.failed.unknown.reasons" = "Something went wrong, try again later";
104104
"login" = "Log In";
105+
"done" = "Ready";

ForPDA/Resources/ru.lproj/Localizable.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,4 @@
102102
"captcha.uploading.failed" = "Не получилось отправить капчу";
103103
"login.failed.unknown.reasons" = "Что-то пошло не так, попробуйте позже";
104104
"login" = "Войти";
105+
"done" = "Готово";

ForPDA/Sources/Modules/Login/LoginView.swift

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ final class LoginView: UIView {
9191

9292
addSubviews()
9393
makeConstraints()
94-
setupToolbarSettings()
94+
setupToolbar()
9595

9696
let tap = UITapGestureRecognizer(target: self, action: #selector(captchaImageTapped))
9797
captchaImageView.addGestureRecognizer(tap)
@@ -130,13 +130,10 @@ final class LoginView: UIView {
130130
}
131131

132132
private func makeConstraints() {
133+
let isSE = UIScreen.main.bounds.height < 680 ? 16 : 64
133134
loginTextField.snp.makeConstraints { make in
134135
make.leading.trailing.equalToSuperview().inset(16)
135-
if UIScreen.main.bounds.height < 680 {
136-
make.top.equalTo(safeAreaLayoutGuide).inset(16)
137-
} else {
138-
make.top.equalTo(safeAreaLayoutGuide).inset(64)
139-
}
136+
make.top.equalTo(safeAreaLayoutGuide).inset(isSE)
140137
}
141138

142139
passwordTextField.snp.makeConstraints { make in
@@ -171,11 +168,11 @@ final class LoginView: UIView {
171168
}
172169
}
173170

174-
private func setupToolbarSettings() {
171+
private func setupToolbar() {
175172
let toolbar = UIToolbar()
176173
toolbar.sizeToFit()
177174
let flexibleSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
178-
let doneButton = UIBarButtonItem(title: "Готово", style: .done, target: self, action: #selector(doneButtonTapped))
175+
let doneButton = UIBarButtonItem(title: R.string.localizable.done(), style: .done, target: self, action: #selector(doneButtonTapped))
179176
toolbar.items = [flexibleSpace, doneButton]
180177
captchaTextField.inputAccessoryView = toolbar
181178
loginTextField.inputAccessoryView = toolbar

0 commit comments

Comments
 (0)