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

Update onboarding screen and code cleanup #1

Merged
merged 8 commits into from Jun 9, 2022
Merged

Update onboarding screen and code cleanup #1

merged 8 commits into from Jun 9, 2022

Conversation

quanshousio
Copy link
Collaborator

I'd like to contribute to the project as I much enjoyed this simple but hauntingly beautiful app. This is my first contribution to the project so any feedback would be greatly appreciated.

  • Update the onboarding screen based on Apple stock apps (e.g. Apple News).
  • Fix an overflow case where the user chooses a combination of birthday and life expectancy that results in negative life progress.
  • Minor code cleanup for conciseness.

Hope you enjoy programming in SwiftUI.

@quanshousio quanshousio changed the title Add new icon Update onboarding screen and code cleanup Jun 8, 2022
@phamfoo
Copy link
Owner

phamfoo commented Jun 8, 2022

Really appreciate you taking the time to contribute to the project! I do want to have more experienced people on the project as I'm still very new to iOS dev. Will review this as soon as I can.

Image("icon")
.resizable()
.frame(width: 100, height: 100)
.cornerRadius(12.0)
Copy link
Owner

Choose a reason for hiding this comment

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

12 is fine since Swift will just infer the type right?

Copy link
Owner

Choose a reason for hiding this comment

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

Also, can we rename the file to OnboardingScreen.swift?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

12 is fine since Swift will just infer the type right?

Yep, Swift will implicitly refer the type.

Also, can we rename the file to OnboardingScreen.swift?

Sure.

to: .now
)

return (ageComponents.year ?? 0) + 1
Copy link
Owner

Choose a reason for hiding this comment

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

I know I did this too but should we just force unwrap and crash if year is nil instead? 1 for life expectancy doesn't make a lot of sense.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Force unwrap generally is not a good practice in Swift. However, I'm not sure in what condition the year component would return nil here. I will force unwrap it for now and you can decide what's the best way to handle those later.

@phamfoo
Copy link
Owner

phamfoo commented Jun 8, 2022

This is great! The new onboarding screen looks amazing, I've also learned a lot from this. Thank you!

@phamfoo
Copy link
Owner

phamfoo commented Jun 9, 2022

LGTM @quanshousio! Can I merge this now?

@quanshousio
Copy link
Collaborator Author

Awesome. Feel free to merge it at anytime.

@phamfoo phamfoo merged commit 7e967d9 into phamfoo:main Jun 9, 2022
@phamfoo
Copy link
Owner

phamfoo commented Jun 9, 2022

Thanks again for the great contribution! By the way, I'm preparing for the app launch and will be updating many files in the project. So please hold off any PRs you might be working on until after the app is released to avoid merge conflicts.

@phamfoo
Copy link
Owner

phamfoo commented Jun 10, 2022

Are you on twitter @quanshousio?

@quanshousio
Copy link
Collaborator Author

Are you on twitter @quanshousio?

I do, but not often. I just saw your mention and I really appreciate that. Congratulations on the release by the way. 🎉

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.

None yet

2 participants