-
Notifications
You must be signed in to change notification settings - Fork 0
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
Rk2 #2
base: main
Are you sure you want to change the base?
Conversation
|
||
import UIKit | ||
|
||
class BaseController: UIViewController{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пробел перед "{"
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
view.backgroundColor = .systemBackground | ||
title = "History" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это для навигайшен бара?
view.backgroundColor = .systemBackground | ||
title = "History" | ||
setUpData() | ||
setUpCollectionView() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше еще сделать общий setup и вызывать оттуда другие setup и делать общие настройки
cellWidth = view.frame.width - 10 | ||
cellHeight = 50 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Константы лучше вынести, как и цвета в отдельный файл. В дальнейшем будет удобно, что в одном месте и едины для всего проекта
collectionView.widthAnchor.constraint(equalToConstant: cellWidth), | ||
collectionView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor), | ||
collectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 5), | ||
collectionView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь конфликта по констрейтам не будет? У вас сейчас получается и ширина задания и по краям он прибит к view
// tabBar.barTintColor = Resourses.Colors.inactive | ||
// tabBar.backgroundColor = .systemBackground | ||
tabBar.layer.borderColor = Resourses.Colors.separator.cgColor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно "// TODO" и комментарий какой-то чтобы в будущем не забыть выпилить подобное
|
||
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Много пустых строк
|
||
let tabBarController = TabBarController() | ||
|
||
window=UIWindow(frame: windowScene.coordinateSpace.bounds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
пробел до и после =
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
много пустых строк
contentView.addSubview(positionLabel) | ||
contentView.addSubview(driverLabel) | ||
contentView.addSubview(timeLabel) | ||
contentView.addSubview(pointsLabel) | ||
|
||
positionLabel.translatesAutoresizingMaskIntoConstraints = false | ||
driverLabel.translatesAutoresizingMaskIntoConstraints = false | ||
timeLabel.translatesAutoresizingMaskIntoConstraints = false | ||
pointsLabel.translatesAutoresizingMaskIntoConstraints = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно написать чуть более компактно
[positionLabel, driverLabel, timeLabel, pointsLabel].forEach {
$0.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview($0)
}
No description provided.