-
Notifications
You must be signed in to change notification settings - Fork 34
Fix avatars #102
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
Fix avatars #102
Conversation
Stepic/AvatarImageView.swift
Outdated
| private func extractLetters(from svgString: String) -> String? { | ||
| let xmlWOClosingTags = svgString.replacingOccurrences(of: "</text></svg>", with: "") | ||
| let letters = xmlWOClosingTags.components(separatedBy: ">").last | ||
| return letters |
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.
Возможно, тут стоит проверить длину letters, чтобы не получилось, что мы что-то другое распарсили
| import Alamofire | ||
| import SVGKit | ||
|
|
||
| class AvatarImageView: UIImageView { |
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.
Здесь стоит еще делать setRoundedBounds() для UIImageView. Так мы в дальнейшем сможем изменять форму всех аватаров одновременно, не изменяя ее во всех местах, где AvatarImageView задействован
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.
Теперь делаем setRoundedBounds(width: 0) внутри вьюхи (из других мест это выпилено).
При этом, в TeacherCollectionViewCell есть вызов setRoundedBounds(width: 1, color: UIColor.white). Нам действительно нужна однопиксельная обводка у аватарок преподавателей на странице инфы о курсе? 🤔
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 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.
выпилено
Задача: #APPS-1420
Коротко для Release Notes, в формате «Сделали/Добавили/Исправили N»:
Исправлено отображение аватаров
Описание:
SVGKit плохо рендерит текст в svg аватаре. Теперь пытаемся сами взять текст из полученного аватара, после чего генерируем новый средствами UIKit.