Added exportIcon images. Added convenience function which adds the new images to attributed string.

This commit is contained in:
Kevin G Christiano 2019-06-27 15:29:33 -04:00
parent cd577288c3
commit 8813646852
6 changed files with 51 additions and 0 deletions

View File

@ -340,6 +340,28 @@ public typealias ActionBlock = () -> Void
standardFontSize = 0
}
}
/**
Appends an external link imcage to the end of the attributed string.
- Attention: This method expects text to be set first. Otherwise, it will do nothing.
- Parameters:
- magnitude: Applied to Width and Height of image for congruency.
*/
public func addExternalLinkIcon(magnitude: Int = 12) {
guard let attributedText = self.attributedText else { return }
let fullString = NSMutableAttributedString(attributedString: attributedText)
let imageAttachment = NSTextAttachment()
imageAttachment.image = MVMCoreUIUtility.imageNamed("externalLink")
imageAttachment.bounds = CGRect(x: 0, y: 0, width: magnitude, height: magnitude)
fullString.append(NSAttributedString(string: " "))
fullString.append(NSAttributedString(attachment: imageAttachment))
self.attributedText = fullString
}
}
// MARK: - Atomization

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "exportBlack.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "exportBlack@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "exportBlack@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 B