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

Rk2 #2

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Rk2 #2

wants to merge 5 commits into from

Conversation

Hexxet
Copy link
Contributor

@Hexxet Hexxet commented Dec 10, 2023

No description provided.


import UIKit

class BaseController: UIViewController{
Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это для навигайшен бара?

Comment on lines +31 to +34
view.backgroundColor = .systemBackground
title = "History"
setUpData()
setUpCollectionView()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лучше еще сделать общий setup и вызывать оттуда другие setup и делать общие настройки

Comment on lines +47 to +48
cellWidth = view.frame.width - 10
cellHeight = 50
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Константы лучше вынести, как и цвета в отдельный файл. В дальнейшем будет удобно, что в одном месте и едины для всего проекта

Comment on lines +53 to +56
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь конфликта по констрейтам не будет? У вас сейчас получается и ширина задания и по краям он прибит к view

Comment on lines +29 to +31
// tabBar.barTintColor = Resourses.Colors.inactive
// tabBar.backgroundColor = .systemBackground
tabBar.layer.borderColor = Resourses.Colors.separator.cgColor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно "// TODO" и комментарий какой-то чтобы в будущем не забыть выпилить подобное

Comment on lines +33 to +37





Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

пробел до и после =

Comment on lines +13 to +14


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

много пустых строк

Comment on lines +44 to +52
contentView.addSubview(positionLabel)
contentView.addSubview(driverLabel)
contentView.addSubview(timeLabel)
contentView.addSubview(pointsLabel)

positionLabel.translatesAutoresizingMaskIntoConstraints = false
driverLabel.translatesAutoresizingMaskIntoConstraints = false
timeLabel.translatesAutoresizingMaskIntoConstraints = false
pointsLabel.translatesAutoresizingMaskIntoConstraints = false
Copy link
Contributor

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)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants