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

5. Creating the Habit Model #5

Closed
lvreynoso opened this issue Nov 15, 2018 · 0 comments
Closed

5. Creating the Habit Model #5

lvreynoso opened this issue Nov 15, 2018 · 0 comments
Assignees

Comments

@lvreynoso
Copy link

lvreynoso commented Nov 15, 2018

When defaults are added to the Habit struct, you need to give it a custom init function if you want to initialize a new instance of the struct without passing in values for every parameter, as the tutorial does at the end of this page. Mine looks like this:

init(title: String, image: Habit.Images) {
        self.title = title
        self.selectedImage = image
    }

Not a breaking problem but it would probably be helpful to include it in the tutorial.

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

No branches or pull requests

2 participants