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

Score updates #7

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

Score updates #7

wants to merge 6 commits into from

Conversation

AnaPeshevska
Copy link
Collaborator

No description provided.

var tmp = 0
if let field = fieldsDict[indexPath.section]?[indexPath.item] {
if (field.score != nil) {
tmp = field.score!
Copy link
Collaborator

Choose a reason for hiding this comment

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

never force unwrap! Use if let fieldScore = field.score {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Screenshot 2022-10-20 at 12 02 27

@@ -198,7 +220,8 @@ class YambDataSource {
}

func clear(indexPath: IndexPath) {
if let field = fieldsDict[indexPath.section]?[indexPath.item] {
if let field = fieldsDict[indexPath.section]?[indexPath.row] {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why did you switch to .row?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wasn't sure what the difference was between .item and .row and was testing out, I changed it back to .item

return stackView
}()

lazy var button: UIButton = {
lazy var NewGameButton: UIButton = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

names start with non-capital letter

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Screenshot 2022-10-20 at 12 04 06

@@ -79,11 +79,17 @@ class YambDataSource {
return [0:topFields, 1:middleFields, 2:bottomFields]
}()

var totalScore: Int {
lazy var totalScore: Int = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

lazy var initializers are only called once. this should be a computed property. it is enough to say
var totalScore: Int = { getTotalScore() }

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Screenshot 2022-10-20 at 12 05 03

//self.navigationController?.navigationBar.isHidden = true

}


Copy link
Collaborator

Choose a reason for hiding this comment

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

dobule new line

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.

2 participants