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

support SVGView and css file init from local file, made init methods more safety #2

Merged
merged 2 commits into from
Jun 17, 2019

Conversation

InnaLMC
Copy link
Contributor

@InnaLMC InnaLMC commented Jun 7, 2019

support SVGView and css file init from local file, not only bundle, made init methods more safety to not get crash if there is no SVG or CSS file

…ade init methods more safety to not get crash if there is no SVG or CSS file
@@ -32,43 +32,78 @@ public final class SVGLoader {
}
""")
}

public func buildHtml(svg: String) -> String {
Copy link
Owner

Choose a reason for hiding this comment

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

I felt strange that this method is in a Style struct.
What do you think of moving this method to an SVG Loader member function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kzumu I fixed it, could you check it?

@s2mr
Copy link
Owner

s2mr commented Jun 10, 2019

Thanks for your contributing!
I made one comment.
I want to hear your opinion.

@InnaLMC
Copy link
Contributor Author

InnaLMC commented Jun 11, 2019

Yep, at first I wanted to keep it as SVG Loader method, but html should be built in init method, so we can't call this method in init, because at that moment self is not defined as well. If you try to do it you'll see error.

@InnaLMC
Copy link
Contributor Author

InnaLMC commented Jun 13, 2019

@kzumu I moved html building from Style to separated struct, please check

@s2mr
Copy link
Owner

s2mr commented Jun 17, 2019

Thanks!
LGTM🎉

@s2mr s2mr merged commit df84cb0 into s2mr:master Jun 17, 2019
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