mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
[ASCornerLayoutSpec] New layout spec class for declarative corner element layout. (#657)
* Add new layout spec class with snapshot testing. Update examples and CHANGELOG.md * Code review updates. * Open curly bracket in a new line.
This commit is contained in:
@@ -74,7 +74,21 @@ extension UIImage {
|
||||
|
||||
return roundedImage ?? self
|
||||
}
|
||||
|
||||
|
||||
class func draw(size: CGSize, fillColor: UIColor, shapeClosure: () -> UIBezierPath) -> UIImage {
|
||||
UIGraphicsBeginImageContext(size)
|
||||
|
||||
let path = shapeClosure()
|
||||
path.addClip()
|
||||
|
||||
fillColor.setFill()
|
||||
path.fill()
|
||||
|
||||
let image = UIGraphicsGetImageFromCurrentImageContext()
|
||||
UIGraphicsEndImageContext()
|
||||
|
||||
return image!
|
||||
}
|
||||
}
|
||||
|
||||
extension NSAttributedString {
|
||||
|
||||
Reference in New Issue
Block a user