Merge branch 'feature/label_export_box' into 'develop'

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

See merge request BPHV_MIPS/mvm_core_ui!92
This commit is contained in:
Pfeil, Scott Robert 2019-07-02 10:42:27 -04:00
commit eaa8397493
6 changed files with 48 additions and 0 deletions

View File

@ -341,6 +341,25 @@ public typealias ActionBlock = () -> Void
standardFontSize = 0
}
}
///Appends an external link image to the end of the attributed string.
public func addExternalLinkIcon() {
let size = round(font.pointSize * 0.8)
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: size, height: size)
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