-
Notifications
You must be signed in to change notification settings - Fork 149
Remove gridicons references from the main Aztec pod. #559
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
Conversation
Only keep references that are done on the demo project.
|
While having no dependencies is very convenient, I don't want to do it in detriment of not having default images. The only scenario in which I'd consider removing those defaults is if we could force the client app to set those defaults. Unfortunately, I don't think it's very feasible since our TextView could be instantiated in a number of different ways (in some cases with the initializer not taking any input parameters from the client app). |
|
To be honest at the moment if you don't set an attachment delegate the app will assert crash when trying to render an image. And that delegate is also not initiated by default. The default image could be one of the pre-conditions also. |
|
@SergioEstevao - I'm ok with having the client app provide the default images through a delegate, but if that's the idea I'd need us to do the full conversion. That is:
If that sounds fine then let me know when the changes are up. |
|
@diegoreymendez and/or @jleandroperez ready for another look. |
diegoreymendez
left a comment
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.
There are several spots in which the default image was removed, but the new ones are not being set.
| private extension BlockquoteFormatterTests { | ||
| var testTextView: TextView { | ||
| let view = TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: Gridicon.iconOfType(.image)) | ||
| let view = TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: UIImage()) |
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.
We're removing the default here, but not assigning a new one.
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.
Test file
| switch attachment { | ||
| case _ as ImageAttachment: | ||
| placeholderImage = Gridicon.iconOfType(.image, withSize: imageSize) | ||
| placeholderImage = UIImage() |
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.
We're removing the default here, but not assigning a new one.
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.
Test file.
| placeholderImage = UIImage() | ||
| case _ as VideoAttachment: | ||
| placeholderImage = Gridicon.iconOfType(.video, withSize: imageSize) | ||
| placeholderImage = UIImage() |
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.
We're removing the default here, but not assigning a new one.
| placeholderImage = UIImage() | ||
| default: | ||
| placeholderImage = Gridicon.iconOfType(.attachment, withSize: imageSize) | ||
| placeholderImage = UIImage() |
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.
We're removing the default here, but not assigning a new one.
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.
Test File.
|
|
||
| func createEmptyTextView() -> Aztec.TextView { | ||
| let richTextView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: Gridicon.iconOfType(.attachment)) | ||
| let richTextView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: UIImage()) |
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.
We're removing the default here, but not assigning a new one.
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.
Test file.
|
|
||
| func createTextView(withHTML html: String) -> Aztec.TextView { | ||
| let richTextView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: Gridicon.iconOfType(.attachment)) | ||
| let richTextView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: UIImage()) |
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.
We're removing the default here, but not assigning a new one.
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.
Test file.
| func createTextViewWithContent() -> Aztec.TextView { | ||
| let paragraph = "Lorem ipsum dolar sit amet.\n" | ||
| let richTextView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: Gridicon.iconOfType(.attachment)) | ||
| let richTextView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: UIImage()) |
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.
We're removing the default here, but not assigning a new one.
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.
Test File
| func testTextViewReferencesStorage() { | ||
|
|
||
| let textView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: Gridicon.iconOfType(.attachment)) | ||
| let textView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: UIImage()) |
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.
We're removing the default here, but not assigning a new one.
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.
Test file.
|
|
||
| func testMaxIndex() { | ||
| let textView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: Gridicon.iconOfType(.attachment)) | ||
| let textView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: UIImage()) |
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.
We're removing the default here, but not assigning a new one.
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.
Test file.
|
|
||
| func testAdjustedIndex() { | ||
| let textView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: Gridicon.iconOfType(.attachment)) | ||
| let textView = Aztec.TextView(defaultFont: UIFont.systemFont(ofSize: 14), defaultMissingImage: UIImage()) |
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.
We're removing the default here, but not assigning a new one.
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.
Test file.
diegoreymendez
left a comment
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.
Good job!
Only keep references that are done on the demo project.
There is only things that I see as issues if we remove Gridicons from the pod:
If we agree with this solution I can go ahead and implement the play icon and remove the Gridicon dependency.
To test: