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
Conversation
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) |
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.
12
is fine since Swift will just infer the type right?
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.
Also, can we rename the file to OnboardingScreen.swift
?
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.
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 |
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.
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.
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.
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.
This is great! The new onboarding screen looks amazing, I've also learned a lot from this. Thank you! |
LGTM @quanshousio! Can I merge this now? |
Awesome. Feel free to merge it at anytime. |
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. |
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. 🎉 |
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.
Hope you enjoy programming in SwiftUI.